summaryrefslogtreecommitdiff
path: root/drivers/media/dvb
AgeCommit message (Collapse)Author
2011-11-11dib0700: protect the dib0700 buffer accessOlivier Grenie
commit bff469f4167fdabfe15294f375577d7eadbaa1bb upstream. This patch protects the common buffer access inside the dib0700 in order to manage concurrent access. This protection is done using mutex. Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Florian Mickler <florian@mickler.org> Signed-off-by: Javier Marcet <javier@marcet.info> Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr> Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr> [mchehab@redhat.com: dprint requires 3 arguments. Replaced by dib_info] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11DiBcom: protect the I2C bufer accessPatrick Boettcher
commit 79fcce3230b140f7675f8529ee53fe2f9644f902 upstream. This patch protects the I2C buffer access in order to manage concurrent access. This protection is done using mutex. Furthermore, for the dib9000, if a pid filtering command is received during the tuning, this pid filtering command is delayed to avoid any concurrent access issue. Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Florian Mickler <florian@mickler.org> Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr> Signed-off-by: Patrick Boettcher <Patrick.Boettcher@dibcom.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-11[media] vp7045: fix buffer setupFlorian Mickler
dvb_usb_device_init calls the frontend_attach method of this driver which uses vp7045_usb_ob. In order to have a buffer ready in vp7045_usb_op, it has to be allocated before that happens. Luckily we can use the whole private data as the buffer as it gets separately allocated on the heap via kzalloc in dvb_usb_device_init and is thus apt for use via usb_control_msg. This fixes a BUG: unable to handle kernel paging request at 0000000000001e78 reported by Tino Keitel and diagnosed by Dan Carpenter. Cc: stable@kernel.org # For v3.0 and upper Tested-by: Tino Keitel <tino.keitel@tikei.de> Signed-off-by: Florian Mickler <florian@mickler.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-30Merge branch 'v4l_for_linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (430 commits) [media] ir-mce_kbd-decoder: include module.h for its facilities [media] ov5642: include module.h for its facilities [media] em28xx: Fix DVB-C maxsize for em2884 [media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHz [media] v4l: mt9v032: Fix Bayer pattern [media] V4L: mt9m111: rewrite set_pixfmt [media] V4L: mt9m111: fix missing return value check mt9m111_reg_clear [media] V4L: initial driver for ov5642 CMOS sensor [media] V4L: sh_mobile_ceu_camera: fix Oops when USERPTR mapping fails [media] V4L: soc-camera: remove soc-camera bus and devices on it [media] V4L: soc-camera: un-export the soc-camera bus [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier [media] V4L: add media bus configuration subdev operations [media] V4L: soc-camera: group struct field initialisations together [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks [media] V4L: pxa-camera: switch to using standard PM hooks [media] NetUP Dual DVB-T/C CI RF: force card hardware revision by module param [media] Don't OOPS if videobuf_dvb_get_frontend return NULL [media] NetUP Dual DVB-T/C CI RF: load firmware according card revision [media] omap3isp: Support configurable HS/VS polarities ... Fix up conflicts: - arch/arm/mach-omap2/board-rx51-peripherals.c: cleanup regulator supply definitions in mach-omap2 vs OMAP3: RX-51: define vdds_csib regulator supply - drivers/staging/tm6000/tm6000-alsa.c (trivial)
2011-07-28[media] tda18271c2dd: Fix saw filter configuration for DVB-C @6MHzMauro Carvalho Chehab
Currently, the driver assumes that all QAM carriers are spaced with 8MHz. This is wrong, and may decrease QoS on Countries like Brazil, that have DVB-C carriers with 6MHz-spaced. Fortunately, both ITU-T J-83 and EN 300 429 specifies a way to associate the symbol rate with the bandwidth needed for it. For ITU-T J-83 2007 annex A, the maximum symbol rate for 6 MHz is: 6 MHz / 1.15 = 5217391 Bauds For ITU-T J-83 2007 annex C, the maximum symbol rate for 6 MHz is: 6 MHz / 1.13 = 5309735 Bauds. As this tuner is currently used only for DRX-K, and it is currently hard-coded to annex A, I've opted to use the roll-off factor of 0.15, instead of 0.13. If we ever support annex C, the better would be to add a DVB S2API call to allow changing between Annex A and C, and add the 0.13 roll-off factor to it. This code is currently being used on other frontends, so I think we should later add a core function with this code, to warrant that it will be properly implemented everywhere. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] au8522: set signal field to 100% when signal presentDevin Heitmueller
The signal state field in G_TUNER is typically scaled from 0-100%. Since we don't know the signal level, we really would prefer the field to contain 100% than 1/256, which in many utilities (such as v4l2-ctl) rounds to 0% even when a signal is actually present. This patch makes the behavior consistent with other drivers. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Fix the logic that selects between DVB-C annex A and CMauro Carvalho Chehab
Fix the DRX-K logic that selects between DVB-C annex A and C Fix a typo where DVB-C annex type is set via setEnvParameters, but the driver, uses, instead, setParamParameters[2]. While here, cleans up the code, fixing a bad identation at the fallback code for other types of firmware, and put the multiple-line comments into the Linux CodingStyle. Acked-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Fix read debug messageMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Fix error return code during drxk initMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Remove goto/break after returnMauro Carvalho Chehab
After return, we don't need any other statement to change the function flux ;) Reported-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Fix a bug at some switches that broke DVB-TMauro Carvalho Chehab
The error propagation changeset c23bf4402 broke the DVB-T code. The legacy way for propagate errors was: do { status = foo_func() if (status < 0) break; } while (0); return status; However, on a few places, it was doing: do { switch(foo) { case bar: status = foo_func() if (status < 0) break; break; } switch(foo2) { case bar: status = foo_func() if (status < 0) break; break; } ... } while (0); return (status) The inner error break were not working, as it were breaking only the switch, instead of the do. The solution used were to do a s/break/goto error/ at the inner breaks, but preserving the last break. Onfortunately, on a few switches, the replacement were applied also to the final break for the case statements. Fix the broken logic, by reverting them to break, where pertinent, in order to fix DVB-T support. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] Remove the double symbol increment hack from drxk_hardMauro Carvalho Chehab
Both ngene and ddbrige calls dvb_attach once for drxk_attach. The logic used there, and by tda18271c2dd driver is different from similar logic on other frontends. The right fix is to change them to use the same logic, but, while we don't do that, we need to patch em28xx-dvb in order to do cope with ngene/ddbridge magic. While here, document why drxk_t_release should do nothing. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27Revert "[media] DVB: dvb_frontend: off by one in dtv_property_dump()"Mauro Carvalho Chehab
This reverts commit a3e4adf274f86b2363fedaa964297cb38526cef0. As pointed by Andread Oberritter <obi@linuxtv.org>: That's wrong, because the array size is DTV_MAX_COMMAND + 1. Using the ARRAY_SIZE macro instead might reduce the confusion. Also, changeset 3995223038 already fixed this issue. Reported-by: Andread Oberritter <obi@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] af9015: add support for Sveon STV22 [1b80:e401]Emilio David Diaus Lopez
Signed-off-by: Emilio David Diaus Lopez <reality_es@yahoo.es> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] af9015: remove 2nd I2C-adapterAntti Palosaari
It is useless. There is only one physical I2C-adapter. 2nd adapter was added originally due to some plans for allowing only one demod to access bus at time. But I never implemented proper locking... Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] af9015: remove old FW based IR polling codeAntti Palosaari
Remove old code which is not used anymore since IR code is read directly from memory nowadays. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] af9015: add more I2C msg checksAntti Palosaari
Return EOPNOTSUPP for too long messages. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] af9015: small optimizationAntti Palosaari
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] af9015: map remote for MSI DIGIVOX DuoAntti Palosaari
Reported-by: Jacek M. Holeczek <jacek.m.holeczek@gmail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] af9015: setup rc keytable for LC-Power LC-USB-DVBTJuergen Lock
That's this tuner: The credit card sized remote more or less works if I set remote=4, so I added the hash to get it autodetected. (`more or less' there meaning sometimes buttons are `stuck on repeat', i.e. ir-keytable -t keeps repeating the same scancode until i press another button.) Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] media, Micronas dvb-t: Fix mem leaks, don't needlessly zero mem, fix ↵Jesper Juhl
spelling In drivers/media/dvb/frontends/drxd_hard.c::load_firmware() I see 3 small issues: 1) When the 'fw' variable goes out of scope we'll leak the memory allocated to it by request_firmware() by neglecting to call release_firmware(). 2) After a successful request_firmware() we allocate fw->size bytes of memory using kzalloc() only to immediately overwrite all that memory with memcpy(), so asking for zeroed memory seems like wasted effort - just use kmalloc(). 3) In one of the error messages "no memory" lacks a space and is written as "nomemory". This patch fixes all 3 issues. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] DVB: dvb_frontend: off by one in dtv_property_dump()Dan Carpenter
If the tvp->cmd == DTV_MAX_COMMAND then we read past the end of the array. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27tda18271c2dd: Fix compilation when module is not selectedMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] tda18271c2dd.h: Don't add the same symbol twiceMauro Carvalho Chehab
Should be folded with the next patch when sending upstream Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] dvb: don't cause missing symbols for drxk/tda18271c2ddMauro Carvalho Chehab
If those demods are unselected, but a bridge driver requires them, produce a runtime message, instead of missing symbols. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: remove a now unused variableMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Add a fallback method for QAM parameter settingMauro Carvalho Chehab
The QAM standard is set using this scu_command: SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM The driver implements a version that has 4 parameters, however, Terratec H5 needs to break this into two separate commands, otherwise, DVB-C doesn't work. With this fix, scan is now properly working and getting the channel list: >>> tune to: 609000000:INVERSION_AUTO:5217000:FEC_3_4:QAM_256 >>> tuning status == 0x00 >>> tuning status == 0x07 >>> tuning status == 0x1f 0x0093 0x0026: pmt_pid 0x0758 (null) -- SporTV2 (running, scrambled) 0x0093 0x0027: pmt_pid 0x0748 (null) -- SporTV (running, scrambled) 0x0093 0x0036: pmt_pid 0x0768 (null) -- FX (running, scrambled) 0x0093 0x0052: pmt_pid 0x0788 (null) -- The History Channel (running, scrambled) Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Improve the scu_command error messageMauro Carvalho Chehab
Now, it outputs: [10927.639641] drxk: SCU_RESULT_INVPAR while sending cmd 0x0203 with params: [10927.646283] drxk: 02 00 00 00 10 00 07 00 03 02 .......... Better than ERROR -3. This happens with Terratec H5 firmware. It adds 2 new error conditions, and something useful to track what the heck is that. I suspect that the scu_command is dependent on the firmware revision. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Simplify the DVB-C set mode logicMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Fix driver removalMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Improves the UIO handlingMauro Carvalho Chehab
The driver is too limited: it assumes that UIO is used only for controlling the antenna, and that only UIO-1 is in usage. However, from Terratec H7 driver [1], 3 UIO's can be used. In fact, it seems that H7 needs to use all 3. So, make the code generic enough to handle the most complex scenario. For now, only antena GPIO can be specified, but is is easier now to add the other GPIO/UIO needs. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Print detected configurationMauro Carvalho Chehab
DRX-K configuration is interesting when writing/testing new devices. Add an info line showing the discovered info. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Fix the antenna switch logicMauro Carvalho Chehab
Terratec H5 doesn't require to switch mode, but generates an error due to this logic. Also, GPIO's are board-dependent. So, add it at the board config struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: change mode before calling the set mode routinesMauro Carvalho Chehab
The set mode routines assume that state were changed to the new mode, otherwise, they'll fail. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Proper handle/propagate the error codesMauro Carvalho Chehab
This driver is very big and complex. An error happening in the middle of any initialization may cause the frontend to not work. So, it needs to properly propagate error codes internally and to userspace. Also, printing the error codes at the places it happened helps to discover were's a bug at the code. Before this change, a do { } while (0) loop and lots of breaks inside were used to propagate errors. While this works, if there are loops inside other loops, it could be easy to forget to add another break, causing the error to not abort the function. Also, as not all functions were reporting errors, it is hard to discover why something failed. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Allow to disable I2C Bridge control switchMauro Carvalho Chehab
On em28xx, tda18271C2 is accessible when the i2c port is not touched. Touching on it breaks the driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Add a parameter for the microcode nameMauro Carvalho Chehab
The microcode firmware provided on Terratec H5 seems to be different. Add a parameter to allow specifying a different firmware per-device. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Print an error if firmware is not loadedMauro Carvalho Chehab
If something bad happens during firmware load, an error should be printed at dmesg. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Avoid OOPSes if firmware is corruptedMauro Carvalho Chehab
Don't read paste the buffer, if the firmware is corrupted. Instead, print an error message. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Convert an #ifdef logic as a new config parameterMauro Carvalho Chehab
Instead of using #ifdef I2C_LONG_ADR for some devices, convert it into a parameter. Terratec H5 logs from the original driver seems to need this mode. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Move I2C address into a config structureMauro Carvalho Chehab
Currently, the only parameter to be configured is the I2C address. However, Terratec H5 logs shows that it needs a different setting for some things, and it has its own firmware. So, move the addr into a config structure, in order to allow adding the required configuration bits. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: remove _0 from read/write routinesMauro Carvalho Chehab
The normal 16-bits read routine is called as "Read16_0". This is due to a flags that could optionally be passed. Yet, on no places at the code, a flag is passed there. The same happens with 16-bits write and 32-read/write routines, and with WriteBlock. Also, using flags, is an exception: there's no place currently using flags, except for an #ifdef at WriteBlock. Rename the function as just "read16", and the one that requires flags, as "read16_flags". This helps to see where the flags are used, and also avoid using CamelCase on Kernel. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Add debug printk'sMauro Carvalho Chehab
This is a complex driver. Adding support for other devices with drxk requires to be able to debug it and see where it is failing. So, add optional printk messages to allow debugging it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] tda18271c2dd: add tda18271c2dd prefix to the errorsMauro Carvalho Chehab
It is hard to identify the origin for those errors without a prefix to indicate which driver produced them: [ 1390.220984] i2c_write error [ 1390.224133] I2C Write error [ 1391.284202] i2c_read error [ 1392.288685] i2c_read error Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: add drxk prefix to the errorsMauro Carvalho Chehab
It is hard to identify the origin for those errors without a prefix to indicate which driver produced them: [ 1390.220984] i2c_write error [ 1390.224133] I2C Write error [ 1391.284202] i2c_read error [ 1392.288685] i2c_read error Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] ddbridge: use linux/io.h, instead of asm/io.hMauro Carvalho Chehab
WARNING: Use #include <linux/io.h> instead of <asm/io.h> +#include <asm/io.h> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] ddbridge: Avoid duplicated symbol definitionMauro Carvalho Chehab
drivers/media/dvb/ddbridge/built-in.o: In function `my_dvb_dmx_ts_card_init': /home/v4l/v4l/patchwork/drivers/media/dvb/ddbridge/ddbridge-core.c:718: multiple definition of `my_dvb_dmx_ts_card_init' drivers/media/dvb/ngene/built-in.o:/home/v4l/v4l/patchwork/drivers/media/dvb/ngene/ngene-dvb.c:227: first defined here drivers/media/dvb/ddbridge/built-in.o: In function `my_dvb_dmxdev_ts_card_init': /home/v4l/v4l/patchwork/drivers/media/dvb/ddbridge/ddbridge-core.c:737: multiple definition of `my_dvb_dmxdev_ts_card_init' drivers/media/dvb/ngene/built-in.o:/home/v4l/v4l/patchwork/drivers/media/dvb/ngene/ngene-dvb.c:246: first defined here Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] ddbridge: Allow compiling of the driverOliver Endriss
Driver added to Makefile and Kconfig. Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] ddbridge: Codingstyle fixesOliver Endriss
Codingstyle fixes Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] ddbridge: Initial check-inRalph Metzler
Driver support for Digital Devices ddbridge-based cards: Octopus, Octopus mini, Octopus LE, cineS2(v6) with DuoFlex S2 and/or DuoFlex CT tuners. Driver was taken from ddbridge-0.6.1.tar.bz2. Signed-off-by: Ralph Metzler <rmetzler@digitaldevices.de> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>