aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/tuner-core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-09-03[media] tuner-core: use true/false for boolean varsMauro Carvalho Chehab1-1/+1
Instead of using 0 or 1 for boolean, use the true/false defines. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-21[media] dvb-frontend: add core support for tuner suspend/resumeMauro Carvalho Chehab1-2/+6
While several tuners have some sort of suspend/resume implementation, this is currently mangled with an optional .sleep callback that it is also used to put the device on low power mode. Not all drivers implement it, as returning the driver from low power may require to re-load the firmware, with takes some time. Also, some drivers may delay it. So, the more coherent is to add two new optional callbacks that will let the tuners to directy implement suspend and resume callbacks if they need. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-24[media] v4l: subdev: Move [gs]_std operation to video opsLaurent Pinchart1-1/+5
The g_std and s_std operations are video-related, move them to the video ops where they belong. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-11-18Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linuxLinus Torvalds1-3/+3
Pull i2c changes from Wolfram Sang: - new drivers for exynos5, bcm kona, and st micro - bigger overhauls for drivers mxs and rcar - typical driver bugfixes, cleanups, improvements - got rid of the superfluous 'driver' member in i2c_client struct This touches a few drivers in other subsystems. All acked. * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits) i2c: bcm-kona: fix error return code in bcm_kona_i2c_probe() i2c: i2c-eg20t: do not print error message in syslog if no ACK received i2c: bcm-kona: Introduce Broadcom I2C Driver i2c: cbus-gpio: Fix device tree binding i2c: wmt: add missing clk_disable_unprepare() on error i2c: designware: add new ACPI IDs i2c: i801: Add Device IDs for Intel Wildcat Point-LP PCH i2c: exynos5: Remove incorrect clk_disable_unprepare i2c: i2c-st: Add ST I2C controller i2c: exynos5: add High Speed I2C controller driver i2c: rcar: fixup rcar type naming i2c: scmi: remove some bogus NULL checks i2c: sh_mobile & rcar: Enable the driver on all ARM platforms i2c: sh_mobile: Convert to clk_prepare/unprepare i2c: mux: gpio: use reg value for i2c_add_mux_adapter i2c: mux: gpio: use gpio_set_value_cansleep() i2c: Include linux/of.h header i2c: mxs: Fix PIO mode on i.MX23 i2c: mxs: Rework the PIO mode operation i2c: mxs: distinguish i.MX23 and i.MX28 based I2C controller ...
2013-10-17[media] v4l: tuner-core: fix typoLad, Prabhakar1-1/+1
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-03media: core: Don't use i2c_client->driverLars-Peter Clausen1-3/+3
The 'driver' field of the i2c_client struct is redundant and is going to be removed. The results of the expressions 'client->driver.driver->field' and 'client->dev.driver->field' are identical, so replace all occurrences of the former with the later. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-04-14[media] tuner-core/simple: get_rf_strength can be tuner mode specificHans Verkuil1-16/+13
The get_rf_strength op in tuner-simple is valid only for the radio mode. But due to the way get_signal in analog_demod_ops was designed it would overwrite the signal value with a bogus value when in TV mode. Pass a pointer to the signal value instead, and when not in radio mode leave it alone in the tuner-simple. This broke in commit 030755bde42bbed133182b0ece7c7a9c759478e8 (tuner-core: call has_signal for both TV and radio) in kernel 3.6. Before that this was working correctly. That commit did the right thing, but what wasn't realized at the time was that tuner-simple should have been updated as well to restrict setting the signal strength to the radio mode only. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-14[media] tuner-core/tda9887: get_afc can be tuner mode specificHans Verkuil1-12/+2
The get_afc op in tda9887 is valid only for the radio mode. But due to the way get_afc in analog_demod_ops was designed it would overwrite the afc value with a bogus value when in TV mode. Pass a pointer to the afc value instead, and when not in radio mode leave it alone in the tda9887. This broke a long time ago in 2.6.19 when the get_afc op was introduced. Before that the afc was only set for radio mode in the tda9887. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-08[media] tuner-core: Change config from unsigned int to void *Ondrej Zary1-13/+7
config looks like a hack that was added to tuner-core to allow some configuration of TDA8290 tuner (it's not used by any other driver). But with the new configuration options of tda8290 driver (no_i2c_gate and std_map), it's no longer sufficient. Change config to be void * instead, which allows passing tuner-dependent config struct to drivers. Also update saa7134 driver to reflect this change (no other driver uses this). Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] tuner-core: handle errors when getting signal strength/afcMauro Carvalho Chehab1-4/+6
If those callbacks fail, it should return zero, and not a random value. The previous code assumed that all drivers would only change signal strength if it succeeds, but this may not be true. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] tuner-core: Remove the now uneeded checks at fe_has_signal/get_afcMauro Carvalho Chehab1-10/+6
Now that those functions are only used when the corresponding function calls are defined, we don't need to check if those function calls are present at the structure before using it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] tuner-core: return afc instead of zeroMauro Carvalho Chehab1-1/+1
While the driver gets AFC from the tuner, it doesn't return it back via V4L2 API due to a mistake at the return. fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] tuner-core: don't set has_signal/get_afc if not supportedHans Verkuil1-1/+6
If the tuner frontend does not support get_rf_strength, then don't set the has_signal callback. Ditto for get_afc. Both callbacks overwrite the signal and afc fields of struct v4l2_tuner but that should only happen if the tuner can actually detect this. If it can't, then it should leave those fields alone so other subdevices can try and detect the signal/afc. This fixes the bug where the au8522 detected a signal and then tuner-core overwrote it with 0 since the xc5000 tuner does not support get_rf_strength. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2: add const to argument of write-only s_tuner ioctlHans Verkuil1-1/+1
This ioctl is defined as IOW, so pass the argument as const. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2: add const to argument of write-only s_frequency ioctlHans Verkuil1-1/+1
This ioctl is defined as IOW, so pass the argument as const. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05[media] tuner-core: map audmode to STEREO for radio devicesHans Verkuil1-1/+16
Fixes a v4l2-compliance error: setting audmode to a value other than mono or stereo for a radio device should map to MODE_STEREO. The spec specifies that for radio devices only mono and stereo audmodes are valid. If the user specifies another audmode in v4l2_tuner, then that should be mapped to valid audmode. That didn't happen here. Note that tuner drivers might decide to limit the possible audmode even further if it only supports mono. In that case the tuner driver can set audmode to mono. However, that new value wasn't copied back to t->audmode, and that has been fixed as well in this patch. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-13[media] v4l: move v4l2 core into a separate directoryMauro Carvalho Chehab1-0/+1354
Currently, the v4l2 core is mixed together with other non-core drivers. Move them into a separate directory. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>