summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/rtl2832_priv.h
AgeCommit message (Collapse)Author
2023-07-09lib/math: Move dvb_math.c into lib/math/int_log.cAndy Shevchenko
Some existing and new users may benefit from the intlog2() and intlog10() APIs, make them wide available. Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org> Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org> Link: https://lore.kernel.org/r/20230619172019.21457-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20230703135211.87416-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-21treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1Thomas Gleixner
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option [no]_[pad]_[ctrl] any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 176 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-28media: move dvb kAPI headers to include/mediaMauro Carvalho Chehab
Except for DVB, all media kAPI headers are at include/media. Move the headers to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-06-09[media] rtl2832: add support for slave ts pid filterMartin Blumenstingl
The rtl2832 demod has 2 sets of PID filters. This patch enables the filter support when using a slave demod. Signed-off-by: Benjamin Larsson <benjamin@southpole.se> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-05-04[media] rtl2832: regmap is aware of lockdep, drop local locking hackPeter Rosin
Tested-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-04-22[media] rtl2832: convert to use an explicit i2c mux corePeter Rosin
Allocate an explicit i2c mux core to handle parent and child adapters etc. Update the select/deselect ops to be in terms of the i2c mux core instead of the child adapter. Tested-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-03-03[media] rtl2832: move stats polling to read statusAntti Palosaari
Do statistics polling on read status in order to avoid unnecessary delayed work. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-06-09[media] dvb: Get rid of typedev usage for enumsMauro Carvalho Chehab
The DVB API was originally defined using typedefs. This is against Kernel CodingStyle, and there's no good usage here. While we can't remove its usage on userspace, we can avoid its usage in Kernelspace. So, let's do it. This patch was generated by this shell script: for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done While here, make CodingStyle fixes on the affected lines. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*
2015-05-18[media] rtl2832: add inittab for FC2580 tunerAntti Palosaari
Add reg/val inittab for FC2580 tuner. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-12[media] rtl2832: add support for GoTView MasterHD 3 USB tunerOlli Salonen
GoTView MasterHD 3 is a DVB-T2/C USB 2.0 tuner. It's based on the following components: - USB bridge: RTL2832P (contains also DVB-T demodulator) - Demodulator: Si2168-A30 - Tuner: Si2148-A20 The demodulator and the tuner will need firmwares. The Si2148 uses Si2158 firmware. Antti has the firmwares available for download: http://palosaari.fi/linux/v4l-dvb/firmware/ Do note that for DVB-T either of the demodulators can be used. DVB-C and DVB-T2 are only supported by the Si2168 demodulator. The driver will register 2 frontends for the same adapter. Frontend 0 will be the RTL2832 demodulator and frontend 1 will be the Si2168 demodulator. The same tuner is used for both. As a consequence of the above, it's recommended to use application that does implement proper DVBv5 support. For some reason, the old I2C write method sporadically fails. Thus the need for an option to only use the new I2C write method supported by the RTL2832. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: implement own lock for regmapAntti Palosaari
Introduce own lock to silence lockdep warning. lockdep validator makes wrong decision when two similar (&map->mutex) locks were taken recursively, even those are different mutexes in a two different drivers. After that patch, functionality remains same, but mutex names are different. That is a temporary hack, proper solution is make regmap aware of locked nested locking rules. ============================================= [ INFO: possible recursive locking detected ] 3.18.0-rc4+ #4 Tainted: G O --------------------------------------------- kdvb-ad-0-fe-0/2814 is trying to acquire lock: (&map->mutex){+.+.+.}, at: [<ffffffff814ec90f>] regmap_lock_mutex+0x2f/0x40 but task is already holding lock: (&map->mutex){+.+.+.}, at: [<ffffffff814ec90f>] regmap_lock_mutex+0x2f/0x40 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&map->mutex); lock(&map->mutex); *** DEADLOCK *** May be due to missing lock nesting notation 1 lock held by kdvb-ad-0-fe-0/2814: #0: (&map->mutex){+.+.+.}, at: [<ffffffff814ec90f>] regmap_lock_mutex+0x2f/0x40 stack backtrace: CPU: 3 PID: 2814 Comm: kdvb-ad-0-fe-0 Tainted: G O 3.18.0-rc4+ #4 Hardware name: System manufacturer System Product Name/M5A78L-M/USB3, BIOS 2001 09/11/2014 0000000000000000 00000000410c8772 ffff880293af3868 ffffffff817a6f82 0000000000000000 ffff8800b3462be0 ffff880293af3968 ffffffff810e7f94 ffff880293af3888 00000000410c8772 ffffffff82dfee60 ffffffff81ab8f89 Call Trace: [<ffffffff817a6f82>] dump_stack+0x4e/0x68 [<ffffffff810e7f94>] __lock_acquire+0x1ea4/0x1f50 [<ffffffff810e2a7d>] ? trace_hardirqs_off+0xd/0x10 [<ffffffff817b01f3>] ? _raw_spin_lock_irqsave+0x83/0xa0 [<ffffffff810e13e6>] ? up+0x16/0x50 [<ffffffff810e2a7d>] ? trace_hardirqs_off+0xd/0x10 [<ffffffff817af8bf>] ? _raw_spin_unlock_irqrestore+0x5f/0x70 [<ffffffff810e9069>] lock_acquire+0xc9/0x170 [<ffffffff814ec90f>] ? regmap_lock_mutex+0x2f/0x40 [<ffffffff817ab50e>] mutex_lock_nested+0x7e/0x430 [<ffffffff814ec90f>] ? regmap_lock_mutex+0x2f/0x40 [<ffffffff814ec90f>] ? regmap_lock_mutex+0x2f/0x40 [<ffffffff817a530b>] ? printk+0x70/0x86 [<ffffffff8110d9e8>] ? mod_timer+0x168/0x240 [<ffffffff814ec90f>] regmap_lock_mutex+0x2f/0x40 [<ffffffff814f08d9>] regmap_update_bits+0x29/0x60 [<ffffffffa03e9778>] rtl2832_select+0x38/0x70 [rtl2832] [<ffffffffa039b03d>] i2c_mux_master_xfer+0x3d/0x90 [i2c_mux] [<ffffffff815da493>] __i2c_transfer+0x73/0x2e0 [<ffffffff815dbaba>] i2c_transfer+0x5a/0xc0 [<ffffffff815dbb6e>] i2c_master_send+0x4e/0x70 [<ffffffffa03ff25a>] regmap_i2c_write+0x1a/0x50 [regmap_i2c] [<ffffffff817ab713>] ? mutex_lock_nested+0x283/0x430 [<ffffffff814f06b2>] _regmap_raw_write+0x862/0x880 [<ffffffff814ec90f>] ? regmap_lock_mutex+0x2f/0x40 [<ffffffff814f0744>] _regmap_bus_raw_write+0x74/0xa0 [<ffffffff814ef3d2>] _regmap_write+0x92/0x140 [<ffffffff814f0b7b>] regmap_write+0x4b/0x70 [<ffffffffa032b090>] ? dvb_frontend_release+0x110/0x110 [dvb_core] [<ffffffffa05141d4>] e4000_init+0x34/0x210 [e4000] [<ffffffffa032a029>] dvb_frontend_init+0x59/0xc0 [dvb_core] [<ffffffff810bde30>] ? finish_task_switch+0x80/0x180 [<ffffffff810bddf2>] ? finish_task_switch+0x42/0x180 [<ffffffffa032b116>] dvb_frontend_thread+0x86/0x7b0 [dvb_core] [<ffffffff817a9203>] ? __schedule+0x343/0x930 [<ffffffffa032b090>] ? dvb_frontend_release+0x110/0x110 [dvb_core] [<ffffffff810b826b>] kthread+0x10b/0x130 [<ffffffff81020099>] ? sched_clock+0x9/0x10 [<ffffffff810b8160>] ? kthread_create_on_node+0x250/0x250 [<ffffffff817b063c>] ret_from_fork+0x7c/0xb0 [<ffffffff810b8160>] ? kthread_create_on_node+0x250/0x250 Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: remove internal mux I2C adapterAntti Palosaari
There was 2 muxed I2C adapters, one for demod tuner bus and one for internal use. Idea of internal I2C adapter was to force I2C repeater close when demod access its registers. Driver has also delayed work queue based method to close I2C repeater. After regmap conversion internal I2C adapter based repeater close left unused - only work queue method was in use. We could not use internal mux adapter method with regmap as it makes recursive regmap call, which causes deadlock as regmap has own locking. Due to that remove whole method totally. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: claim copyright and module authorAntti Palosaari
I have implemented tons of things for that driver, more than anyone else, so lets claim copyright and module authorship. Cc: Thomas Mair <thomas.mair86@gmail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: cleanups and minor changesAntti Palosaari
Remove all the stuff that is not needed anymore. Rename variable. Remove extra new lines. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: merge reg page as a part of reg addressAntti Palosaari
Chips uses 8-bit register addresses with 5 pages. Extend register address by using register page as a first byte of address, defining virtual register addresses. That is common method of handling register pages and regmap also uses it. Remove page + address conversion glue which was there for regmap. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: implement PID filterAntti Palosaari
Implement PID filter. This demod has PID filter size of 32 PIDs. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: drop FE i2c gate control supportAntti Palosaari
We don't need it anymore as all users are using muxed I2C adapter. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: wrap DVBv5 BER to DVBv3Antti Palosaari
Change legacy DVBv3 read BER to return values calculated by DVBv5 statistics. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: wrap DVBv5 CNR to DVBv3 SNRAntti Palosaari
Change legacy DVBv3 read SNR to return values calculated by DVBv5 statistics. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: implement DVBv5 BER statisticAntti Palosaari
DVBv5 BER. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: implement DVBv5 CNR statisticAntti Palosaari
DVBv5 CNR. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: convert to regmap APIAntti Palosaari
Use regmap to cover register access routines. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: move all configuration to platform data structAntti Palosaari
Move all needed configuration values to platform data structure and remove old configuration code where possible. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: rename driver state variable from 'priv' to 'dev'Antti Palosaari
Rename it device state variable to dev. Both priv and dev are very common terms for such variable in kernel, but I like use dev in order to keep drivers consistent. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-27[media] rtl2832: convert driver to I2C bindingAntti Palosaari
Convert that driver to I2C driver model. Legacy DVB binding is left also for later removal... Tested-by: Benjamin Larsson <benjamin@southpole.se> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-03-05[media] rtl2832: implement delayed I2C gate closeAntti Palosaari
Delay possible I2C gate close a little bit in order to see if there is next message coming to tuner in a sequence. Also, export private muxed I2C adapter. That is aimed only for SDR extension module as SDR belongs to same RTL2832 physical I2C bus (it is physically property of RTL2832, whilst it is own kernel module). Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-05[media] rtl2832: add muxed I2C adapter for demod itselfAntti Palosaari
There was a deadlock between master I2C adapter and muxed I2C adapter. Implement two I2C muxed I2C adapters and leave master alone, just only for offering I2C adapter for these mux adapters. Reported-by: Luis Alves <ljalvs@gmail.com> Reported-by: Benjamin Larsson <benjamin@southpole.se> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-05[media] rtl2832: provide muxed I2C adapterAntti Palosaari
RTL2832 provides gated / repeater I2C adapter for tuner. Implement it as a muxed I2C adapter. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-05[media] rtl2832: style changes and minor cleanupAntti Palosaari
Most of those were reported by checkpatch.pl... debug module parameter is not used anywhere so remove it. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-04-16[media] rtl2832: add code to bind r820t on itMauro Carvalho Chehab
There are some init stuff to be done for each new tuner at the demod code. Add the code there for r820t. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Tested-by: Antti Palosaari <crope@iki.fi>
2012-09-27[media] rtl2832: add configuration for e4000 tunerAntti Palosaari
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-23[media] rtl2832: use dev_foo() loggingAntti Palosaari
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-23[media] rtl2832: support for tua9001 tunerAntti Palosaari
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-09-23[media] rtl2832: separate tuner specific init from generalAntti Palosaari
It is first step closer to support multiple tuners. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13[media] move the dvb/frontends to drivers/media/dvb-frontendsMauro Carvalho Chehab
Raise the DVB frontends one level up, as the intention is to remove the drivers/media/dvb directory. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>