aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-02-03[media] stb0899: use sign_extend32() for sign extensionMartin Kepplinger1-3/+2
Instead of implement its own logic, use the already-defined one. Signed-off-by: Martin Kepplinger <martink@posteo.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] si2168: add support for 1.7MHz bandwidthOlli Salonen1-1/+3
This patch is based on Antti's silabs branch. Add support for 1.7 MHz bandwidth. Supported in all versions of Si2168 according to short data sheets. [mchehab@osg.samsung.com: Fix CodingStyle] Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] si2168: return error if set_frontend is called with invalid parametersOlli Salonen1-1/+4
This patch should is based on Antti's silabs branch. According to dvb-frontend.h set_frontend may be called with bandwidth_hz set to 0 if automatic bandwidth is required. Si2168 does not support automatic bandwidth and does not declare FE_CAN_BANDWIDTH_AUTO in caps. This patch will change the behaviour in a way that EINVAL is returned if bandwidth_hz is 0. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] dvb: tc90522: re-add symbol-rate reportAkihiro Tsukada1-0/+1
symbol-rate report was wrongly removed off by the commit:906aaf5a . Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: declare functions as staticMauro Carvalho Chehab1-6/+6
drivers/media/dvb-frontends/rtl2832.c:157:5: warning: no previous prototype for ‘rtl2832_bulk_write’ [-Wmissing-prototypes] int rtl2832_bulk_write(struct i2c_client *client, unsigned int reg, ^ drivers/media/dvb-frontends/rtl2832.c:169:5: warning: no previous prototype for ‘rtl2832_update_bits’ [-Wmissing-prototypes] int rtl2832_update_bits(struct i2c_client *client, unsigned int reg, ^ drivers/media/dvb-frontends/rtl2832.c:181:5: warning: no previous prototype for ‘rtl2832_bulk_read’ [-Wmissing-prototypes] int rtl2832_bulk_read(struct i2c_client *client, unsigned int reg, void *val, Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2830: declare functions as staticMauro Carvalho Chehab1-6/+6
drivers/media/dvb-frontends/rtl2830.c:21:5: warning: no previous prototype for ‘rtl2830_bulk_write’ [-Wmissing-prototypes] int rtl2830_bulk_write(struct i2c_client *client, unsigned int reg, ^ drivers/media/dvb-frontends/rtl2830.c:33:5: warning: no previous prototype for ‘rtl2830_update_bits’ [-Wmissing-prototypes] int rtl2830_update_bits(struct i2c_client *client, unsigned int reg, ^ drivers/media/dvb-frontends/rtl2830.c:45:5: warning: no previous prototype for ‘rtl2830_bulk_read’ [-Wmissing-prototypes] int rtl2830_bulk_read(struct i2c_client *client, unsigned int reg, void *val, ^ Cc: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: add kernel-doc comments for platform_dataAntti Palosaari1-7/+13
Add kernel-doc comments for platform_data configuration structure. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: add kernel-doc comments for platform_dataAntti Palosaari1-11/+12
Add kernel-doc comments for platform_data configuration structure. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2830: add kernel-doc comments for platform_dataAntti Palosaari1-20/+13
Add kernel-doc comments for platform_data configuration structure. 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 Palosaari2-10/+40
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 Palosaari2-21/+4
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_sdr: refcount to rtl28xxuAntti Palosaari1-2/+15
We are consumer of DVB frontend provided by rtl28xxu module. Due to that we must use refcount to ensure none could remove rtl28xxu when we are alive (or when we are streaming, if more fine-grained refcounting is wanted). Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: implement sleepAntti Palosaari1-0/+10
Put demod to soft reset in order to save power when sleep. That drops power usage ~30mA @5V on USB dongle I tested. In real life it does not matter much as USB IF powers off demod too, but now it is done twice - demod and USB IF. 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 Palosaari3-0/+4
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 Palosaari3-88/+25
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_sdr: cleanupsAntti Palosaari2-40/+23
Small cleanups. Remove unneeded variables. Some checkpatch issues. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: fix loggingAntti Palosaari1-65/+86
Pass correct device, platform device, for logging system in order to format printouts correctly. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: convert to platform driverAntti Palosaari2-241/+156
That SDR driver module was abusing DVB frontend SEC (satellite equipment controller) device and due to that it was also using legacy DVB binding. Platform bus is pseudo-bus provided by kernel driver model and it fits cases like that, where any other busses are not suitable. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832_sdr: rename state variable from 's' to 'dev'Antti Palosaari1-429/+429
'dev' sounds better than 's' for such variable. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: provide register IO callbacksAntti Palosaari2-0/+7
Provide register read and write callbacks for SDR module. 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 Palosaari2-173/+144
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: remove unneeded software reset from init()Antti Palosaari1-15/+0
There is no need to do software reset on init() as it is done a bit later on end of set_frontend(). Software reset usually means restarting (resetting to starting point) chip internal state machine (FSM). Naturally it is done after all parameters are programmed. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: use regmap reg cacheAntti Palosaari1-0/+18
Enable regmap register cache in order to reduce IO. 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 Palosaari3-0/+72
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: define more demod lock statusesAntti Palosaari1-4/+2
Demod lock flags are derived from demod state machine states. States are running from 1 to 11, where highest state 11 means demod is fully locked and streaming. Naturally smaller state numbers means there is some partial locks. Define now state 10 as missing synch and lock. 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 Palosaari2-34/+0
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: implement DVBv5 signal strength statisticsAntti Palosaari1-0/+20
Estimate signal strength from IF digital AGC. 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 Palosaari2-11/+3
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 Palosaari2-38/+5
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 Palosaari2-0/+27
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 Palosaari2-3/+73
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 Palosaari3-161/+173
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 Palosaari3-27/+45
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: enhance / fix loggingAntti Palosaari1-45/+57
Pass correct device pointer to dev_* logging functions in order print logs correctly. 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 Palosaari2-137/+137
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-02-03[media] rtl2832: remove exported resourcesAntti Palosaari2-198/+0
Exported resources are not needed anymore as all users are using callbacks carried via platform data. Due to that we will remove those. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2832: add platform data callbacks for exported resourcesAntti Palosaari2-8/+89
Add callback for all of those functions which are currently exported using EXPORT_SYMBOL. That allows us convert every user to callbacks and eventually all exported symbols could be removed. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl2830: convert to regmap APIAntti Palosaari3-238/+182
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] rtl2830: implement own I2C lockingAntti Palosaari2-7/+39
Own I2C locking is needed due to two special reasons: 1) Chips uses multiple register pages/banks on single I2C slave. Page is changed via I2C register access. 2) Chip offers muxed/gated I2C adapter for tuner. Gate/mux is controlled by I2C register access. Due to these reasons, I2C locking did not fit very well. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: implement PID filterAntti Palosaari3-0/+70
Implement PID filter. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: wrap DVBv5 CNR to DVBv3 SNRAntti Palosaari2-41/+4
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-02[media] rtl2830: wrap DVBv5 BER to DVBv3Antti Palosaari2-13/+3
Change legacy DVBv3 read BER 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-02[media] rtl2830: wrap DVBv5 signal strength to DVBv3Antti Palosaari1-23/+4
Change legacy DVBv3 signal strength 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-02[media] rtl2830: implement DVBv5 BER statisticAntti Palosaari2-0/+27
DVBv5 BER. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: implement DVBv5 signal strength statisticsAntti Palosaari1-0/+24
Estimate signal strength from IF AGC. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: implement DVBv5 CNR statisticAntti Palosaari2-0/+77
DVBv5 CNR. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: style related changesAntti Palosaari3-72/+60
Trivial changes proposed by checkpatch.pl and some more. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: get rid of internal config dataAntti Palosaari2-40/+18
Remove internal config and use configuration values directly from the platform data. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: fix loggingAntti Palosaari1-22/+21
Pass correct device for dev_foo() logging in order to print logs correctly. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-02[media] rtl2830: carry pointer to I2C client for every functionAntti Palosaari1-43/+54
As a I2C driver struct i2c_client is top level structure representing the driver. Use it as parameter to carry all needed information for each function in order to simplify things. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>