summaryrefslogtreecommitdiff
path: root/drivers/media/common
AgeCommit message (Collapse)Author
2012-07-30[media] tuner-xc2028: unlock on error in xc2028_get_afc()Dan Carpenter
We need to do a mutex_unlock(&priv->lock) before returning. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-30[media] tuner-xc2028: fix "=" vs "==" typoDan Carpenter
We intended to do a compare here, not an assignment. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06[media] tuner-xc2028: tag the usual firmwares to help dracutMauro Carvalho Chehab
When tuner-xc2028 is not compiled as a module, dracut will need to copy the firmware inside the initfs image. So, use MODULE_FIRMWARE() to indicate such need. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05[media] media: Remove VIDEO_MEDIA Kconfig optionMauro Carvalho Chehab
In the past, it was possible to have either DVB or V4L2 core as module and the other as builtin. Such config never make much sense, and created several issues in order to make the Kconfig dependency to work, as all drivers that depend on both (most TV drivers) would need to be compiled as 'm'. Due to that, the VIDEO_MEDIA config option were added. Instead of such weird approach, let's just use the MEDIA_SUPPORT =y or =m to select if the media subsystem core will be either builtin or module, simplifying the building system logic. Also, fix the tuners configuration, by enabling them only if a tuner is required. So, if just webcam/grabbers support is selected, no tuner option will be selected. Also, if only digital TV is selected, no analog tuner support is selected. That removes the need of using EXPERT customise options, when analog TV is not selected. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05[media] media: reorganize the main Kconfig itemsMauro Carvalho Chehab
Change the main items to: <m> Multimedia support ---> [ ] Cameras/video grabbers support [ ] Analog TV support [ ] Digital TV support [ ] AM/FM radio receivers/transmitters support [ ] Remote Controller support This provides an interface that is clearer to end users that are compiling the Kernel, and will allow the building system to automatically unselect drivers for unused functions. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-05[media] xc5000: Add support for DMB-TH and ISDB-TMauro Carvalho Chehab
xc5000 is just a tuner, not a decoder, so both DMB-TH and ISDB-T should work properly there: it is just a matter of teaching the driver what saw filter should be used and how to calculate the center frequency. Requested-by: Choi Wing Chan <chanchoiwing@gmail.com> Cc: Steven Toth <stoth@linuxtv.org> Cc: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-04[media] tuner, xc2028: add support for get_afc()Mauro Carvalho Chehab
Implement API support to return AFC frequency shift, as this device supports it. The only other driver that implements it is tda9887, and the frequency there is reported in Hz. So, use Hz also for this tuner. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-04[media] tuner-xc2028: Fix signal strength reportMauro Carvalho Chehab
There are several bugs at the signal strength algorithm: - It is using logical OR, instead of bit OR; - It doesn't wait up to 18 ms as it should; - the strength range is not ok. Rework on it, in order to make it work. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-30[media] tuner-xc2028: use request_firmware_nowait()Mauro Carvalho Chehab
Change the firmware logic to use request_firmware_nowait(), and to preserve the loaded firmwares in memory, to reduce the risk of troubles with buggy userspace apps. With this change, while the firmware is being loaded, the driver will return -EAGAIN to any calls. If, for some reason, firmware failed to be loaded from userspace, it will return -ENODEV. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-06-18[media] saa7146: Variable set but not usedPeter Senna Tschudin
In function fops_open variable type was set but not used. Tested by compilation only. Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Acked-by: Michael Hunold <michael@mihu.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20[media] fc0013 ver. 0.2: introduction of get_rf_strength functionHans-Frieder Vogt
Changes compared to version 0.1 of driver (sent 6 May): - Initial implementation of get_rf_strength function. - Introduction of a warning message Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20[media] fc0012 ver. 0.6: introduction of get_rf_strength functionHans-Frieder Vogt
Changes compared to version 0.5 of driver (sent 6 May): - Initial implementation of get_rf_strength function. Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20[media] fc001x: tuner driver for FC0013Hans-Frieder Vogt
Support for tuner Fitipower FC0013 Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20[media] fc001x: tuner driver for FC0012, version 0.5Hans-Frieder Vogt
Support for tuner Fitipower FC0012 Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20[media] fc001x: common header file for FC0012 and FC0013Hans-Frieder Vogt
Common defines for the FC0012 (v0.5) and FC0013 tuner drivers Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] av7110: fix v4l2_compliance test issuesHans Verkuil
Besides the usual inconsistencies in input enumeration there was also a kernel crash if you tried to poll on a vbi node. The checks for sliced vbi output vs vbi capture were not complete enough. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] saa7146: fix querycap, vbi/video separation and g/s_registerHans Verkuil
The querycap ioctl returned an incorrect version number and incorrect capabilities (mixing up vbi and video caps). The reason for that was that video nodes could do vbi activities: that should be separated between the vbi and video nodes. There were also a few minor problems with dbg_g/s_register that have been resolved. The mxb/saa7146 driver now passes the v4l2_compliance tests. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] saa7146: support control events and priority handlingHans Verkuil
Use v4l2_fh which gives you control events and priority handling for free. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] saa7146: rename vbi/video_q to vbi/video_dmaqHans Verkuil
There was also a vbi_q and video_q in saa7146_fh, so that was confusing. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] saa7146: remove the unneeded type field from saa7146_fhHans Verkuil
This information can also be retrieved from struct video_device. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] saa7146: move vbi fields from saa7146_fh to saa7146_vvHans Verkuil
This fields are global and don't belong in a fh struct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] saa7146: move video_fmt from saa7146_fh to saa7146_vvHans Verkuil
This is a global structure and does not belong to saa7146_fh. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] saa7146: move overlay information from saa7146_fh into saa7146_vvHans Verkuil
This is global information, not per-filehandle information. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] mxb/saa7146: first round of cleanupsHans Verkuil
Convert to the control framework, fix the easy v4l2-compliance failures. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14[media] v4l2-dev: add flag to have the core lock all file operationsHans Verkuil
This used to be the default if the lock pointer was set, but now that lock is by default only used for ioctl serialization. Those drivers that already used core locking have this flag set explicitly, except for some drivers where it was obvious that there was no need to serialize any file operations other than ioctl. The drivers that didn't need this flag were: drivers/media/radio/dsbr100.c drivers/media/radio/radio-isa.c drivers/media/radio/radio-keene.c drivers/media/radio/radio-miropcm20.c drivers/media/radio/radio-mr800.c drivers/media/radio/radio-tea5764.c drivers/media/radio/radio-timb.c drivers/media/video/vivi.c sound/i2c/other/tea575x-tuner.c The other drivers that use core locking and where it was not immediately obvious that this flag wasn't needed were changed so that the flag is set together with a comment that that driver needs work to avoid having to set that flag. This will often involve taking the core lock in the fops themselves. Eventually this flag should go and it should not be used in new drivers. There are a few reasons why we want to avoid core locking of non-ioctl fops: in the case of mmap this can lead to a deadlock in rare situations since when mmap is called the mmap_sem is held and it is possible for other parts of the code to take that lock as well (copy_from_user()/copy_to_user() perform a down_read(&mm->mmap_sem) when a page fault occurs). It is very unlikely that that happens since the core lock serializes all fops, but the kernel warns about it if lock validation is turned on. For poll it is also undesirable to take the core lock as that can introduce increased latency. The same is true for read/write. While it was possible to make flags or something to turn on/off taking the core lock for each file operation, in practice it is much simpler to just not take it at all except for ioctl and leave it to the driver to take the lock. There are only a handful fops compared to the zillion ioctls we have. I also wanted to make it obvious which drivers still take the lock for all fops, so that's why I chose to have drivers set it explicitly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-19[media] xc5000: xtal_khz should be a u16 rather than a u32Michael Krufky
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-19[media] xc5000: log firmware upload failures in xc5000_fwuploadMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-19[media] xc5000: support 32MHz & 31.875MHz xtal using the 41.024.5 firmwareMichael Krufky
Rather than loading firmware specific for the xtal frequency, just use the standard firmware and set the xtal frequency after firmware upload. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-09[media] fc0011: Reduce number of retriesMichael Büsch
Now that i2c transfers are fixed, 3 retries are enough. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-09[media] fc0011: use usleep_range()Michael Büsch
Use usleep_range() instead of msleep() to improve power saving opportunities. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-09[media] Add fc0011 tuner driverMichael Büsch
This adds support for the Fitipower fc0011 DVB-t tuner. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-04-09[media] Infineon TUA 9001 silicon tuner driverAntti Palosaari
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-03-08[media] media: tuners: append $(srctree) to -I parametersAndy Shevchenko
Without this we have got the warnings like following if build with "make W=1 O=/var/tmp": cc1: warning: drivers/media/dvb/dvb-core: No such file or directory [enabled by default] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-28[media] mt2063: remove mt2063_setTune from headerDanny Kukawka
Commit 99ac54125490f16f7434f82fcb73bbb88290b38e removed the function mt2063_setTune() from mt2063.c. Remove it also from the header file. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14[media] xc5000: declare firmware configuration structures as static constMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14[media] xc5000: drivers should specify chip revision rather than firmwareMichael Krufky
Specify chip revision at attach time rather than a firmware image. This is a better way to ensure that the correct firmware is loaded for the correct revision of the chip. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14[media] xc5000: remove static dependencies on xc5000 created by previous ↵Michael Krufky
changesets convert the firmware configuration attach-time parameter from a pointer to an integer so as to remove the static dependency created by the previous changesets. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14[media] remove unneeded #define's in xc5000.hMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14[media] tuner: add support for Xceive XC5000CMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14[media] xc5000: add XC5000C_DEFAULT_FIRMWARE: dvb-fe-xc5000c-41.024.5-31875.fwMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-14[media] xc5000: allow drivers to set desired firmware in xc5000_attachMichael Krufky
newer versions of the xc5000 silicon require newer firmware while remaining 100% driver compatible. original versions of the xc5000a continue to use the same firmware. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-13[media] max2165: trival fix for some -Wuninitialized warningDanny Kukawka
Fix for some -Wuninitialized compiler warnings. Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-08[media] mt2063: increase frequency_max to tune channel 69Jose Alberto Reguero
Increase mt2063 frequency_max to tune to channel 69(858Mhz). Jose Alberto Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-21[media] az6007: Fix compilation troubles at az6007Mauro Carvalho Chehab
Some changes are needed, in order to make az6007 compile with the upstream tree. Most of the changes are due to the upstream drxk module. Even allowing its compilation, the driver is not working yet. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-16[media] Add registers names to XC2028 tuner from datahseet and use themMiroslav Slugen
Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-16[media] xc4000: add support for signal strength measuresMiroslav Slugen
In xc4000 chipsets real signal and noise level is stored in register 0x0A and 0x0B,so we can use those registers to monitor signal strength. I tested this patch on 2 different cards Leadtek DVR3200 and DTV2000H Plus, both with same results, I used special antenna hubs (toner 4x, 6x, 8x and 12x) with mesured signal lost, both registers are in dB value, first represent signal with limit value -113.5dB (should be -114dB) and exactly match with test results. Second represents noise level also in dB and there is no maximum value, but from tests we can drop everything above 32dB which tuner realy can't use, signal was usable till 20dB noise level. In digital mode we can take signal strength but sadly noise level is not relevant and real value is stored in demodulator for now just zl10353, also digital mode is just for testing, because it needs changing other parts of code which reads data only from demodulator. In analog mode I was able to test only FM radio, signal level is not important, it says something about cable and hub losts, but nothing about real quality of reception, so even if we have signal level at minimum 113dB we can still here radio, because of that it is displaied only in debug mode, but for real signal level is used noise register which is again very accurate, radio noise level was betwen 6-20dB for good signal, 20-25dB for medium signal, and above 25dB signal is unusable. For now real benefit of this patch is only for FM radio mode. Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-11[media] mxl5007t: bugfix DVB-T 7 MHz and 8 MHz bandwidthAntti Palosaari
DVB-T did not work at all - only 6 MHz was working but it is not commonly used. Fix it. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-11[media] tda18271-fe: Fix support for ISDB-TMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06[media] xc3028: fix center frequency calculation for DTV78 firmwareGianluca Gennari
This patch replaces the previous one proposed in the thread "xc3028: force reload of DTV7 firmware in VHF band with Zarlink demodulator", at the linux-media@vger.kernel.org ML. The problem is that the firmware DTV78 works fine in UHF band (8 MHz bandwidth) but is not working at all in VHF band (7 MHz bandwidth). Reading the comments inside the code, I figured out that the real problem could be connected to the formula used to calculate the center frequency offset in VHF band. In fact, removing this adjustment fixes the problem: if ((priv->cur_fw.type & DTV78) && freq < 470000000) offset -= 500000; This is coherent to what was implemented for the DTV7 firmware by an Australian user: if (priv->cur_fw.type & DTV7) offset += 500000; In the end, now the center frequency is the same for all firmwares (DTV7, DTV8, DTV78) and doesn't depend on channel bandwidth. The final code looks clean and simple, and there is no need for any "magic" adjustment: if (priv->cur_fw.type & DTV6) offset = 1750000; else /* DTV7 or DTV8 or DTV78 */ offset = 2750000; Signed-off-by: Gianluca Gennari <gennarone@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-06[media] drivers: media: tuners: Fix dependency for MEDIA_TUNER_TEA5761Fabio Estevam
Fix the following build warning: warning: (MEDIA_TUNER) selects MEDIA_TUNER_TEA5761 which has unmet direct dependencies (MEDIA_SUPPORT && VIDEO_MEDIA && I2C && EXPERIMENTAL) Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>