aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/tuners (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-01-29[media] si2157: change firmware variable name and typeAntti Palosaari1-8/+8
Rename firmware variable from fw_file to fw_name and change its type from u8 to const char as request_firmware() input is. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] si2157: print chip versionAntti Palosaari1-4/+7
Print chip version once using log level into when init() is called. Remove cold/warm state printing as those are not very useful. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] si2157: print firmware versionAntti Palosaari1-0/+11
Firmware version could be printed similarly than si2168 driver does. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] si2157: add own goto label for kfree() on probe errorAntti Palosaari1-2/+4
Use own goto label for error case mem free is needed, even kfree could be called with NULL. I think it is better to have it, even not required. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] si2157: trivial ID table changesAntti Palosaari1-5/+5
- Rename ID table. - Remove magic numbers from ID table driver data field. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] si2157: change firmware download error handlingAntti Palosaari1-5/+4
Rename firmare download error path goto label. Remove firmware NULL set as NULL value is not needed anymore, due to recent change which started using goto labels for firmware error handling. Cc: 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-01-29[media] si2157: carry pointer to client instead of state in tuner_privAntti Palosaari2-41/+38
Carry struct i2c_client pointer in tuner_priv. This driver is I2C driver, which is represented as a struct i2c_client, so better to carry this top level structure for each routine in order to unify things. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] si2157: simplify si2157_cmd_execute() error pathAntti Palosaari1-6/+2
Remove if () from firmware command error path as there should not be any error prone conditional logic there. Use goto labels instead. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-01-29[media] si2157: rename device state variable from 's' to 'dev'Antti Palosaari2-61/+59
'dev' is likely most common name in kernel for structure containing device state instance, so rename it in order to keep things consistent. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-22[media] media: remove emacs editor variablesHans Verkuil13-96/+0
1) This is not allowed by the kernel coding style 2) Just configure your editor correctly 3) It's really ugly Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04[media] si2157: One function call less in si2157_init() after errorMarkus Elfring1-4/+4
The release_firmware() function was called in some cases by the si2157_init() function during error handling even if the passed variable contained still a null pointer. This implementation detail could be improved by the introduction of another jump label. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04[media] tuners: remove uneeded checks before release_firmware()Markus Elfring2-4/+2
The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-04[media] tda18271: Fix identationMauro Carvalho Chehab1-1/+1
As reported by smatch: drivers/media/tuners/tda18271-common.c:176 tda18271_read_extended() warn: if statement not indented Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] si2157: Si2148 supportCrazyCat3-6/+8
Si2148-A20 silicon tuner support. [Antti: Resolved conflict] Signed-off-by: Evgeny Plehov <EvgenyPlehov@ukr.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] si2157: make checkpatch.pl happy (remove break after goto)Olli Salonen1-1/+0
Break after goto is unnecessary. 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>
2014-11-25[media] si2157: Add support for Si2146-A10Olli Salonen3-10/+29
The Silicon Labs Si2146 tuner seems to work with the same driver as the Si2157, but there a few exceptions. The powerup command seems to be quite a bit different. In addition there's a property 0207 that requires a different value. Thus another entry is created in the si2157_id table to support also si2146 in this driver. The datasheet is available on manufacturer's website: http://www.silabs.com/support%20documents/technicaldocs/Si2146-short.pdf 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>
2014-11-14[media] r820t: add DVB-C configAntti Palosaari1-0/+12
Add config values for SYS_DVBC_ANNEX_A. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11[media] [PATH,2/2] mxl5007 move loop_thru to attachJose Alberto Reguero1-1/+12
This patch move the loop_thru configuration to the attach function, because with dual tuners until loop_tru configuration the other tuner don't work. Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-11[media] [PATH,1/2] mxl5007 move reset to attachJose Alberto Reguero1-4/+13
This patch move the soft reset to the attach function because with dual tuners, when one tuner do reset, the other one is perturbed, and the stream has errors. Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03[media] m88rs6000t: add new dvb-s/s2 tuner for integrated chip M88RS6000nibble.max4-0/+782
M88RS6000 is the integrated chip, which includes tuner and demod. Here splite its tuner as a standalone driver. .set_config is used to config its demod clock, which sits inside tuner die. Signed-off-by: Nibble Max <nibble.max@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03[media] xc5000: add IF output level controlRichard Vollkommer2-1/+14
Adds control of the IF output level to the xc5000 tuner configuration structure. Increases the IF level to the demodulator to fix failure to lock and picture breakup issues (with the au8522 demodulator, in the case of the Hauppauge HVR950Q). This patch works with all XC5000 firmware versions. Signed-off-by: Richard Vollkommer <linux@hauppauge.com> Signed-off-by: Michael Ira Krufky <mkrufky@linuxtv.org> Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-03[media] m88ts2022: return the err code in its probe function when error occursnibble.max1-0/+2
if "chip_id" is wrong or "dev->cfg.clock_out" is invalid, the i2c model is still loaded. It will cause "kernel NULL pointer dereference" oops when the i2c model remove. returning the err code will prevent the i2c model load. Signed-off-by: Nibble Max <nibble.max@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-30[media] si2157: add support for SYS_DVBC_ANNEX_BOlli Salonen1-0/+3
Set the property for delivery system also in case of SYS_DVBC_ANNEX_B. This behaviour is observed in the sniffs taken with Hauppauge HVR-955Q Windows driver. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-24[media] xc5000: use after free in release()Dan Carpenter1-1/+1
I moved the call to hybrid_tuner_release_state(priv) after "priv->firmware" dereference. Fixes: 5264a522a597 ('[media] media: tuner xc5000 - release firmwware from xc5000_release()') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-26[media] qm1d1c0042: fix compilation on 32 bitsMauro Carvalho Chehab1-1/+4
drivers/built-in.o: In function `qm1d1c0042_set_params': >> qm1d1c0042.c:(.text+0x2519730): undefined reference to `__divdi3' Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23[media] qm1d1c0042: add driver for Sharp QM1D1C0042 ISDB-S tunerAkihiro Tsukada4-0/+490
This patch adds driver for qm1d1c0042 tuner chips. It is used as an ISDB-S tuner in earthsoft pt3 cards. Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23[media] mxl301rf: add driver for MaxLinear MxL301RF OFDM tunerAkihiro Tsukada4-0/+383
This patch adds driver for mxl301rf OFDM tuner chips. It is used as an ISDB-T tuner in earthsoft pt3 cards. Note that this driver does not initilize the chip, because the initilization sequence / register setting is not disclosed. Thus, the driver assumes that the chips are initilized externally by its parent board driver before tuner_ops->init() are called, like in PT3 driver where the bridge chip contains the init sequence in its private memory and provides a command to trigger the sequence. Signed-off-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23[media] tda18271-common: Convert _tda_printk to return voidJoe Perches2-13/+10
No caller or macro uses the return value so make it void. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23[media] media: tuner xc5000 - try to avoid firmware load in resume pathShuah Khan1-1/+15
xc5000 doesn't load firmware at attach time instead loads it when it needs to set and change configuration from its init, frequency, digital and analog mode set interffaces. As a result, when system is suspended before firmware is loaded, firmware load can be avoided during resume. Loading formware in this scenario results in slowpath warnings during resume as it won't be in the suspend firmware cache. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23[media] media: tuner xc5000 - release firmwware from xc5000_release()Shuah Khan1-14/+20
xc5000 releases firmware right after loading it. Change it to save the firmware and release it from xc5000_release(). This helps avoid fecthing firmware when forced firmware load requests come in to change analog tv frequence and when firmware needs to be reloaded after suspend and resume. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-23[media] si2157: Add support for Si2147-A30 tunerOlli Salonen3-4/+13
This patch adds support for Si2147-A30 tuner. Fairly trivial, no firmware needed for this tuner. However, command 14 00 02 07 01 00 seems to be mandatory. On Si2157 and Si2158 the value 0x0100 is the default value, so this patch does not impact the existing tuners/devices. On Si2147 the default is 0x0000 and I can't get a lock with that value. While here, fix the return length of the previous set command to 4 bytes. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Acked-by: Antti Palosaari <crope@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] tda18212: convert to RegMap APIAntti Palosaari2-114/+18
Use RegMap API to handle all the boring I2C register access boilerplate stuff. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] tda18212: rename state from 'priv' to 'dev'Antti Palosaari1-53/+51
foo_dev seems to be most correct term for the structure holding data of each device instance. It is most used term in Kernel codebase and also examples from book Linux Device Drivers, Third Edition, uses it. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] tda18212: clean loggingAntti Palosaari1-17/+18
There is no need to print module name nor function name as those are done by kernel logging system when dev_xxx logging is used and driver is proper I2C driver. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] tda18212: convert driver to I2C bindingAntti Palosaari2-64/+79
Convert driver from DVB proprietary model to common I2C model. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] tda18212: prepare for I2C client conversionAntti Palosaari1-0/+5
We need carry pointer to frontend via config struct (I2C platform_data ptr) when I2C model is used. Add that pointer first in order to keep build unbreakable during conversion. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: replace udelay polling with jiffiesAntti Palosaari1-9/+20
udelay based I/O polling loop is a bad idea, especially system performance point of view. Kernel jiffies are preferred solution for such situations. Use it instead. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: refactor code largelyAntti Palosaari1-162/+194
Refactor code largely. Try to keep order of register read/write same as windows driver does as it makes comparing sniffs easier. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: get rid of script loader and and private header fileAntti Palosaari2-79/+31
Used script loader is quite useless and hides register numbers making code hard to understand. Get rid of it and use standard RegMap register write functions directly. it913x_priv.h file leaves empty after that change and is also removed. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: remove dead codeAntti Palosaari2-19/+1
Remove unused tuner set template. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: re-implement sleepAntti Palosaari3-44/+69
Re-implement sleep. Based USB sniffs taken from the latest Hauppauge windows driver version 07/10/2014, 14.6.23.32191. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: convert to RegMap APIAntti Palosaari3-105/+34
Use RegMap API to cover I2C register access routines. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: rename 'state' to 'dev'Antti Palosaari1-75/+75
foo_dev seems to be most correct term for the structure holding data of each device instance. It is most used term in Kernel and also examples from book Linux Device Drivers, Third Edition, uses it. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: change reg read/write routines more commonAntti Palosaari2-67/+60
Change register write and read routines to similar which are typically used. We have to add processor core as a part of register address in order to simplify register access. Chip has two cores, called link and ofdm. As for now, use address bit 24 to address used core. Bits 15:0 are register address in given core. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: convert to I2C driverAntti Palosaari3-77/+90
Change the it913x driver to use the I2C high lever tuner binding model. As af9035 depends on it, add a code there to do the binding. [mchehab@osg.samsung.com: Merge 3 patches into one, because we don't want to break bisect due to the conversion] Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: rename tuner_it913x => it913xAntti Palosaari4-3/+3
Remove tuner_ prefix from module name and file names. Prefix was added due to file name conflict on media out-tree build system. Demodulator having same name does not exists anymore. So lets remove dumb prefix. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: make checkpatch.pl happyAntti Palosaari1-0/+4
Correct issues reported by checkpatch.pl Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: fix IT9135 AX sleepAntti Palosaari2-1/+16
Old IT9135 AX needs a little bit different register settings for sleep than newer IT9135 BX. This has been broken always, as power management of the whole driver, but it started to be problem as I fixed clock. Earlier clock was disabled very first on sleep and rest of the commands were skipped by the chip as no clock, leaving tuner full power state. When I fixed clocks these PM bugs started raising out as I/O errors. Cc: Bimow Chen <Bimow.Chen@ite.com.tw> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: avoid division by zero on error caseAntti Palosaari1-0/+3
Error on init leaves some internal divisor zero, which causes oops later. Fix it by populating divisors even it fails. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] it913x: fix tuner sleep power leakAntti Palosaari2-2/+0
IT913x tuner driver disables own clock, provided by demod core, as very a first operation when tuner is put on *sleep*. That likely causes failure of all the rest commands on sleep sequence, which leads situation where tuner is not actually on sleep, but consuming a lot of power. I measured 102mA current consumption from the USB before change and after change it was only 32mA. Used device was single tuner IT9135 BX. Second reason to remove that register from tuner driver is reason it is simply on wrong driver (demod vs. tuner), breaking the principle of correct driver. Clock is now provided more correctly af9033 demod driver as a config option. Cc: Bimow Chen <Bimow.Chen@ite.com.tw> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>