aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-02-03[media] rtl28xxu: fix loggingAntti Palosaari1-48/+42
Pass correct device pointer to dev_* logging in order to print module name and bus id correctly. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl28xxu: rename state variable 'priv' to 'dev'Antti Palosaari2-120/+120
I prefer dev over priv and I want keep all my drivers in line with that. 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] rtl28xxu: do not refcount rtl2832_sdr moduleAntti Palosaari1-8/+2
This driver, rtl28xxu, offers frontend service for rtl2832_sdr module, thus we are producer and rtl2832_sdr module is consumer. Due to that, reference counting should be done in way rtl2832_sdr takes refrence to rtl28xxu. Remove wrong refcount. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl28xxu: simplify FE callback handlingAntti Palosaari1-18/+9
Logic is so simple that there is no idea to separate tuner selection to own function, instead do it in a callback and get rid of one function. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl28xxu: fix DVB FE callbackAntti Palosaari1-2/+17
DVB FE callback functionality went broken after I moved tuners to demod muxed I2C adapter. That happens because driver state was carried by I2C adapter and when mux is used there is one adapter more in a chain. USB adapter <-> I2C adapter <-> 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 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] rtl28xxu: use master I2C adapter for slave demodsAntti Palosaari1-2/+2
Both mn88472 and mn88473 slave demods are connected to master I2C bus, not the bus behind master demod I2C gate like tuners. Use correct bus. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-02-03[media] rtl28xxu: switch SDR module to platform driverAntti Palosaari2-79/+50
RTL2832 SDR module implements kernel platform driver. Change old binding to that one. 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] rtl28xxu: add support for RTL2832U/RTL2832 PID filterAntti Palosaari1-4/+29
RTL2832 demod integrated into RTL2832U has PID filter. PID filtering is provided by rtl2832 demod driver. Add support for it. 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] rtl28xxu: use demod mux I2C adapter for every tunerAntti Palosaari1-5/+8
Tuners are connected to demod I2C adapter. Use that muxed adapter for each tuner. That allows us to get rid of hackish FE gate control solution. 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] rtl28xxu: use platform data config for rtl2832 demodAntti Palosaari1-6/+32
Use platform data configuration for rtl2832 demod driver. Old configuration are still left as it is used for rtl2832_sdr driver. 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] rtl28xxu: use rtl2832 demod callbacks accessing its resourcesAntti Palosaari2-20/+24
Switch demod resource use from exported symbols to callbacks its provides. 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] rtl28xxu: add support for RTL2831U/RTL2830 PID filterAntti Palosaari1-0/+25
RTL2830 demod integrated to RTL2831U has PID filter. PID filtering is provided by rtl2830 demod driver. Add support for it. 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>