summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
AgeCommit message (Collapse)Author
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] drxk: fix warning: ‘status’ may be used uninitialized in this ↵Mauro Carvalho Chehab
function One of the problems of the old CHECK_ERROR is that it was hiding the status parameter. Maybe due to that, on a few places, the return code might lead to return incorrect status: drivers/media/dvb/frontends/drxk_hard.c: In function ‘load_microcode.clone.0’: drivers/media/dvb/frontends/drxk_hard.c:1281: warning: ‘status’ may be used uninitialized in this function drivers/media/dvb/frontends/drxk_hard.c:1281: note: ‘status’ was declared here drivers/media/dvb/frontends/drxk_hard.c: In function ‘GetLockStatus’: drivers/media/dvb/frontends/drxk_hard.c:1792: warning: ‘status’ may be used uninitialized in this function drivers/media/dvb/frontends/drxk_hard.c: In function ‘Start.clone.7’: drivers/media/dvb/frontends/drxk_hard.c:1734: warning: ‘status’ may be used uninitialized in this function Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Return -EINVAL if an invalid bandwidth is usedMauro Carvalho Chehab
drivers/media/dvb/frontends/drxk_hard.c: In function ‘SetDVBT’: drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_5_MHZ’ not handled in switch drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_10_MHZ’ not handled in switch drivers/media/dvb/frontends/drxk_hard.c:3766: warning: enumeration value ‘BANDWIDTH_1_712_MHZ’ not handled in switch Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] tda18271c2dd: Remove the CHK_ERROR macroMauro Carvalho Chehab
The CHK_ERROR macro does a flow control, violating chapter 12 of the Documentation/CodingStyle. Doing flow controls inside macros is a bad idea, as it hides what's happening. It also hides the var "status" with is also a bad idea. The changes were done by this small perl script: my $blk=0; while (<>) { s/^\s+// if ($blk); $f =~ s/\s+$// if ($blk && /^\(/); $blk = 1 if (!m/\#/ && m/CHK_ERROR/); $blk=0 if ($blk && m/\;/); s/\n/ / if ($blk); $f.=$_; }; $f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g; print $f; And manually fixed. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxk: Remove the CHK_ERROR macroMauro Carvalho Chehab
The CHK_ERROR macro does a flow control, violating chapter 12 of the Documentation/CodingStyle. Doing flow controls inside macros is a bad idea, as it hides what's happening. It also hides the var "status" with is also a bad idea. The changes were done by this small perl script: my $blk=0; while (<>) { s /^\s+// if ($blk); $f =~ s/\s+$// if ($blk && /^\(/); $blk = 1 if (!m/\#/ && m/CHK_ERROR/); $blk=0 if ($blk && m/\;/); s/\n/ / if ($blk); $f.=$_; }; $f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g; print $f; And manually fixed. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxd/drxk: Don't export MulDiv32 symbolMauro Carvalho Chehab
/home/v4l/v4l/patchwork/drivers/media/dvb/frontends/drxk_hard.c:181: multiple definition of `MulDiv32' drivers/media/dvb/frontends/drxd.o:/home/v4l/v4l/patchwork/drivers/media/dvb/frontends/drxd_hard.c:236: first defined here Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] DRX-K, TDA18271c2: Add build supportOliver Endriss
Add both drivers 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] DRX-K: Tons of coding-style fixesOliver Endriss
Tons of coding-style fixes Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] DRX-K: Shrink size of drxk_map.hOliver Endriss
Deleted all unused symbold from drxk_map.h, which reduced the size from 1.1M to 37K! Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] DRX-K: Initial check-inRalph Metzler
Driver for the DRX-K DVB-C/T demodulator. Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] tda18271c2dd: Lots of coding-style fixesOliver Endriss
Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] tda18271c2dd: Initial check-inRalph Metzler
Driver for the NXP TDA18271c2 silicon tuner. Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] nxt6000: i2c bus error should return -EIOMauro Carvalho Chehab
data from/to userspace. Don't mix it with I2C bus error (-EIO). Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] drxd, siano: Remove unused include linux/version.hMauro Carvalho Chehab
Both drxd and siano drivers were including linux/version.h without any reason. Probably, this is due to some compatibility code that used to exist before having their support added into the Linux Kernel. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] dvb: remove unnecessary codeGreg Dietsche
remove unnecessary code that matches this coccinelle pattern if (...) return ret; return ret; Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] frontends/s5h1420: Change: clock_settting to clock_settingJustin P. Mattock
Changes clock_settting to clock_setting. Note: This could be intentionally set this way from the beginning and/or is a typo. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] dib7000p: setup dev.parent for i2c master built into 7000pDevin Heitmueller
We need to set the dev.parent member on the dib7000p on its i2c master, or else calls to request_firmware() will hit an oops in 2.6.31. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Cc: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] cx24113: Don't reuse core macro namesHans Petter Selasky
The info and err macros are already defined by the USB stack. Rename these macros to avoid macro redefinition warnings. Signed-off-by: Hans Petter Selasky <hselasky@c2i.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] itd1000: Don't reuse core macro namesHans Petter Selasky
The dbg, warn and info macros are already defined by the USB stack. Rename these macros to avoid macro redefinition warnings. Refactor lineshift in printouts. Signed-off-by: Hans Petter Selasky <hselasky@c2i.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] cxd2820r: correct missing error checksAntti Palosaari
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] cxd2820r: fix bitfieldsAntti Palosaari
error: dubious one-bit signed bitfield Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] cxd2820r: malloc buffers instead of stackAntti Palosaari
kmalloc I2C buffers Signed-off-by: Antti Palosaari <crope@iki.fi> Cc: Dan Carpenter <error27@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-25[media] Inlined functions should be staticHans Petter Selasky
Signed-off-by: Hans Petter Selasky <hselasky@c2i.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-25[media] Remove invalid parameter descriptionHans Petter Selasky
Signed-off-by: Hans Petter Selasky <hselasky@c2i.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] cxd2820r: Update frontend capabilities to advertise QAM-256Steve Kerrison
This is supported in DVB-T2 mode, so added to the T/T2 frontend. Signed-off-by: Steve Kerrison <steve@stevekerrison.com> Acked-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] DVB: drxd_hard: handle new bandwidths by returning -EINVALAndreas Oberritter
drivers/media/dvb/frontends/drxd_hard.c: In function ‘DRX_Start’: drivers/media/dvb/frontends/drxd_hard.c:2327: warning: enumeration value ‘BANDWIDTH_5_MHZ’ not handled in switch drivers/media/dvb/frontends/drxd_hard.c:2327: warning: enumeration value ‘BANDWIDTH_10_MHZ’ not handled in switch drivers/media/dvb/frontends/drxd_hard.c:2327: warning: enumeration value ‘BANDWIDTH_1_712_MHZ’ not handled in switch [mchehab@redhat.com: removed the status = status assignment after the switch] Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] DVB: Add basic API support for DVB-T2 and bump minor versionAndreas Oberritter
[steve@stevekerrison.com: Remove private definitions from cxd2820r that existed before API was defined] Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: Steve Kerrison <steve@stevekerrison.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] DiBxxxx: get rid of DMA buffer on stackOlivier Grenie
This patch removes the remaining on-stack buffer for USB DMA transfer. This patch also reduces the stack memory usage. Cc: stable@kernel.org 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>
2011-05-20[media] cxd2820r: switch automatically between DVB-T and DVB-T2Antti Palosaari
Remove old DVB-T2 freq module param and detect DVB-T/T2 automatically. Implementation is trial and error, if DVB-T does not lock try DVB-T2 and vice versa. That's done by replacing normal DVBFE_ALGO_SW with DVBFE_ALGO_CUSTOM which gives better control for tuning process. DVB-C still uses normal software ZigZag, DVBFE_ALGO_SW. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] cxd2820r: whitespace fixAntti Palosaari
Make checkpatch.pl happy by fixing whitespaces introduced by commit 79e8b8e3b8cbf67130247a3f6d25732373fe2f34 Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] cxd2820r: make C, T, T2 and core components as linked objectsSteve Kerrison
Signed-off-by: Steve Kerrison <steve@stevekerrison.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] Sony CXD2820R DVB-T/T2/C demodulator driverAntti Palosaari
It is very first DVB-T2 Linux driver! Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] cx24116: make FW DL split more readableAntti Palosaari
Change firmware download split, which I introduced few patch earlier, a little bit to make it more readable as requested [1]. Anyhow, for some reason this seems to increase compiled binary size 52 bytes, on my AMD64 box, which is rather much for so small change. [1] http://www.spinics.net/lists/linux-media/msg31968.html Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] cx24116: add config option to split firmware downloadAntti Palosaari
It is very rare I2C adapter hardware which can provide 32kB I2C write as one write. Add .i2c_wr_max option to set desired max packet size. Split transaction to smaller pieces according to that option. Signed-off-by: Antti Palosaari <crope@iki.fi> Cc: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] STV0299 Register 02 on Opera1/Bsru6/z0194a/mantis_vp1033Malcolm Priestley
Bits 4 and 5 on register 02 should always be set to 1. Opera1/Bsru6/z0194a/mantis_vp1033 Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Acked-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] STV0299 incorrect standby setting issues register 02 (MCR)Malcolm Priestley
Issues with Register 02 causing spurious channel locking from standby. Should have always bits 4 & 5 written to 1. Lower nibble not used in any current driver. Usage if necessary can be applied through initab to mcr_reg. stv0299 not out of standby before writing inittab. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Acked-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] IX2505V Keep I2C gate control aliveMalcolm Priestley
Gate could close after first I2C message. On stv0288 it does. Keep 2nd and 3rd message I2C gate control alive. Remove unnecessary gate closing in this module. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] DVB, DiB9000: Fix leak in dib9000_attach()Jesper Juhl
If the second memory allocation in dib9000_attach() fails, we'll leak the memory allocated by the first. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] STV0288 Register 42 - Incorrect settingsMalcolm Priestley
Register 42 bits 2,3,6 and 7 should be set to 0. This gives difficult locking on some channels and may be compensated for by other methods. This affects any driver using the stv0288 frontend on the default or earda inittab. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] budget-ci: Add support for TT S-1500 with BSBE1-D01A tunerOliver Endriss
Add support for TT S-1500 with BSBE1-D01A tuner. Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>