summaryrefslogtreecommitdiff
path: root/drivers/media/common/tuners/xc5000.c
AgeCommit message (Collapse)Author
2012-08-13[media] common: move media/common/tuners to media/tunersMauro Carvalho Chehab
Move the tuners one level up, as the "common" directory will be used by drivers that are shared between more than one driver. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: change filename to production/redistributable xc5000c firmwareDevin Heitmueller
The original xc5000c driver support was based on a beta version of the firmware, and there were no redistribution rights. Change over to using the release version, for which freely redistributable firmware can be found here: http://kernellabs.com/firmware/xc5000/README.xc5000c http://kernellabs.com/firmware/xc5000/dvb-fe-xc5000c-4.1.30.7.fw Thanks to Ramon Cazares from Cresta Technology for making the firmware available as well as working out the licensing issues. [mchehab@redhat.com: Fix a merge conflict with the patch that added support for MODULE_FIRMWARE() macro] Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Cc: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: show debug version fields in decimal instead of hexDevin Heitmueller
The driver prints out a dotted version number but it's in hex. As a result, the version doesn't visibly match the filename for the firmware, and it caused a bunch of confusion while discussing different versions with the chip manufacturer. Change the firmware printout to be in decimal. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: add support for firmware load check and init statusDevin Heitmueller
The xc5000c and newer versions of the xc5000a firmware need minor revisions to their initialization process. Add support for validating the firmware was properly loaded, as well as checking the init status after initialization. Based on advice from CrestaTech support as well as xc5000 datasheet v2.3. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: reset device if encountering PLL lock failureDevin Heitmueller
It's possible for the xc5000 to enter an unknown state such that all subsequent tuning requests fail. The only way to recover is to reset the tuner and reload the firmware. This problem was detected after several days straight of issuing tuning requests every five seconds. Reset the firmware in the event that the PLL is in an unlocked state. This solution was provided by the engineer at CrestaTech (the company that acquired Xceive). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: don't invoke auto calibration unless we really did reset tunerDevin Heitmueller
The current code invokes the auto calibration of the tuner whenever the init routine is called (whenever the DVB frontend opens the device). However we should really only be invoking the calibration if we actually did reset the device and reload the firmware. Rework the routine to only do calibration if reset and firmware load was performed. Also because the called function is now a no-op if the firmware is already loaded, the caller no longer needs to invoke is_firmware_loaded(). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: properly report i2c write failuresDevin Heitmueller
The logic as written would *never* actually return an error condition, since the loop would run until the counter hit zero but the check was for a value less than zero. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: add support for showing the SNR and gain in the debug outputDevin Heitmueller
When debugging is enabled, also show the analog SNR and the total gain status values. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-09[media] xc5000: properly show quality register valuesDevin Heitmueller
The quality register only has relevant data in bits 2-0, so discard the other bits (which results in a value being printed that is consistent with the expected 0-7 range). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-30[media] xc5000: Add MODULE_FIRMWARE statementsTim Gardner
This will make modinfo more useful with regard to discovering necessary firmware files. Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: Michael Krufky <mkrufky@kernellabs.com> Cc: Eddi De Pieri <eddi@depieri.net> Cc: linux-media@vger.kernel.org Signed-off-by: Tim Gardner <tim.gardner@canonical.com> 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-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-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] 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>
2011-12-31[media] dvb: don't use DVBv3 bandwidth macrosMauro Carvalho Chehab
Every frontend now uses DVBv5 way. So, let's not use the DVBv3 macros internally anymore. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31[media] tuners: remove dvb_frontend_parameters from set_params()Mauro Carvalho Chehab
This is a big patch, yet trivial: now that all tuners use the DVBv5 way to pass parameters (e. g. via fe->dtv_property_cache), the extra parameter can be removed from set_params() call. After this change, very few DVBv3 specific stuff are left at the tuners. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-20[media] Remove Annex A/C selection via roll-off factorMauro Carvalho Chehab
Instead of using a roll-off factor, change DRX-K & friends to select the bandwidth filter and the Nyquist half roll-off via delivery system. This provides a cleaner support for Annex A/C switch. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-09[media] xc5000: Add support for 7MHz bandwidth for DVB-C/DVB-TMauro Carvalho Chehab
While xc5000 supports 7MHz bandwidth, the driver were lacking the code implementing this feature, causing tuning issues with VHF chanels used in Countries like Italy. After this patch: >>> tune to: 177500000:INVERSION_AUTO:BANDWIDTH_7_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE 0x0000 0x0d49: pmt_pid 0x0102 RAI -- Rai 1 (running) 0x0000 0x0d4a: pmt_pid 0x0101 RAI -- Rai 2 (running) 0x0000 0x0d4b: pmt_pid 0x0100 RAI -- Rai 3 TGR Veneto (running) 0x0000 0x0d53: pmt_pid 0x0118 RAI -- Rai News (running) 0x0000 0x0d54: pmt_pid 0x0119 Rai -- Rai 3 TGR Emilia Romagna (running) 0x0000 0x0d4c: pmt_pid 0x0103 Rai -- Rai Radio1 (running) 0x0000 0x0d4d: pmt_pid 0x0104 Rai -- Rai Radio2 (running) 0x0000 0x0d4e: pmt_pid 0x0105 Rai -- Rai Radio3 (running) Network Name 'Rai' Tested-by: Eddi De Pieri <eddi@depieri.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-08[media] xc5000,tda18271c2dd: Fix bandwidth calculusMauro Carvalho Chehab
While here, add a debug message, to easy detecting bugs on it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-07[media] xc5000: Remove the global mutex lock at xc5000 firmware initMauro Carvalho Chehab
As reported by Devin Heitmueller <dheitmueller@kernellabs.com>: > It seems like a change such as this could significantly change the > timing of tuner initialization if you have multiple xc5000 based > products that might have a slow i2c bus. Was that intentional? After discussed with Eddi de Pierri <eddi@depieri.net>, it was pointed that the change was not intentional, and it was just a trial while developing the patches that add support for HVR-930C. So, remove this hack. Reported-by: Devin Heitmueller <dheitmueller@kernellabs.com> Acked by: Eddi de Pierri <eddi@depieri.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-20[media] em28xx: initial support for HAUPPAUGE HVR-930C againEddi De Pieri
With this patch I try again to add initial support for HVR930C. Tested only DVB-T, since in Italy Analog service is stopped. Actually "scan -a0 -f1", find only about 50 channel while 400 should be available. [mchehab@redhat.com: Tested with DVB-C and fixed a few whitespace issues] Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Eddi De Pieri <eddi@depieri.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-20[media] xc5000: Add support for get_if_frequencyMauro Carvalho Chehab
This is needed for devices with DRX-K and xc5000. Tested with a HVR 930C hardware. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-11[media] Properly implement ITU-T J.88 Annex C supportMauro Carvalho Chehab
The Annex C support were broken with the previous implementation, as, at xc5000 and tda18271c2dd, it were choosing the wrong bandwidth for some symbol rates. At DRX-J, it were always selecting Annex A, even having Annex C support coded there. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20[media] xc5000: Improve it to work better with 6MHz-spaced channelsMauro Carvalho Chehab
Brazil uses 6MHz-spaced channels. So, the nyquist filter for DVB-C should be different, otherwise, inter-channel interference may badly affect the device, and signal may not be properly decoded. On my tests here, without this patch, sometimes channels are seen, but, most of the time, PID filter returns with timeout. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] xc5000: add set_config and otherDmitri Belimov
Add one more radio input, usefull for tm6010 Add control output amplitude. Add set_config function for configure tuner when TV card hasn't dvb part. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] xc5000: add support for DVB-C tuningIgor M. Liplianin
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: drivers/media: Make static data tables and strings constlawrence rust
Making static data const avoids allocation of additional r/w memory and reduces initialisation time. It also provides some additional opportunities for compiler optimisations. Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: xc5000: Fix a few warningsMauro Carvalho Chehab
drivers/media/common/tuners/xc5000.c: In function ‘xc_write_reg’: drivers/media/common/tuners/xc5000.c:298: warning: passing argument 3 of ‘xc5000_readreg’ from incompatible pointer type drivers/media/common/tuners/xc5000.c:235: note: expected ‘u16 *’ but argument is of type ‘u8 *’ drivers/media/common/tuners/xc5000.c: At top level: drivers/media/common/tuners/xc5000.c:223: warning: ‘xc_read_i2c_data’ defined but not used Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-02V4L/DVB: xc5000, rework xc_write_regDmitri Belimov
Rework xc_write_reg function for correct read register of the xc5000. It is very useful for tm6000. Tested for tm6000 and for saa7134 works well. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05V4L/DVB (13188): xc5000: return an error on tuning attempts if firmware not ↵Devin Heitmueller
loaded Xc5000 tuning attempts shouldn't return zero in the case where the firmware did not load successfully. Thanks to Michael Krufky for pointing out this issue. Cc: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05V4L/DVB (13076): xc5000: make the definition of the FM input part of the ↵Devin Heitmueller
xc5000 config struct Remove hard-coded definition of the xc5000 FM radio input, making it a parameter passed in when doing the attach call. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05V4L/DVB (13075): xc5000: add FM radio supportBeholder Intl. Ltd. Dmitry Belimov
Add FM radio for the xc5000 silicon tuner chip. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11806): xc5000: add copyright lineDevin Heitmueller
Add copyright line for xc5000.c. Cc: Steven Toth <stoth@kernellabs.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11804): xc5000: poll at 5ms interval for register write command ↵Devin Heitmueller
completion Instead of polling at 100ms intervals for register writes, poll at 5ms intervals. This is consistent with the xc5000 specification, and improves tuning time by up to 500 ms on devices that such as the au0828 which do not properly implement i2c clock stretching (since the five register writes that occur for a tuning request often do not complete immediately but do complete far before 100ms has gone by). The net amount of time we wait before timing out is unchanged (500ms). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11803): xc5000: add support for DVB-T tuningDavid T.L. Wong
This patch adds XC5000 supports for DVB-T 6MHz and 8MHz bandwidth. Signed-off-by: David T.L. Wong <davidtlwong@gmail.com> Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11802): xc5000: switch to new xc5000 firmware 1.6.114 with ↵Devin Heitmueller
redistribution rights Xceive has graciously allowed us to now freely redistribute the xc5000 firmware, which eliminates the need for users to manually extract the blob from the Hauppauge driver. Thanks to Brian Mathews <bmathews@xceive.com> for providing this code Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11798): xc5000: add "no_poweroff" module optionDevin Heitmueller
Provide for the ability for a user to disable putting the tuner to sleep, in case he doesn't want to incur the cost of reloading the firmware when starting up his/her application. The module options are intentionally identical to xc3028. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11797): xc5000: cleanup firmware loading messagesDevin Heitmueller
Make it a little more obvious in the dmesg output what is going on during firmware upload. This is more important for boards like the HVR-950q that take nearly seven seconds to do the upload. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11796): xc5000: start using the newer "finerfreq" tuning commandDevin Heitmueller
Starting in firmware version 1.1.44, Xceive recommends using the FINERFREQ for all normal tuning (the doc indicates reg 0x03 should only be used for fast scanning for channel lock) Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11795): xc5000: add build version to debug infoDevin Heitmueller
Expose the firmware build number along with the other version info Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11793): xc5000: Properly support power down for newer firmwareDevin Heitmueller
Xceive got rid of the XREG_POWER_DOWN register in later firmware revisions. Their technical support informed me that the correct way to put the tuner to sleep is to pull the reset pin (but don't reload the firmware). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11792): xc5000: switch to new version of Xceive firmwareDevin Heitmueller
This switches to a new version of the xc5000 firmware, extracted from the latest Hauppauge driver. It includes the support for the XREG_BUSY register (a lack of which was causing tuning to take 3200ms instead of around 300ms). Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11791): xc5000: do not sleep after digital tuningDevin Heitmueller
Don't sleep for 400ms polling the tuner's lock if in digital mode (since the xc5000 lock status registers appear to only be reliable in analog mode) Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11790): xc5000: restore sleep routineDevin Heitmueller
Bring back the code that puts the xc5000 to sleep. For the Pinnacle 801e this results in power consumption at idle dropping from 325ma to 124ma. If there are *actually* any devices that don't work in this configuration, they should set dvb_frontend.ops.tuner_ops.sleep to NULL (per mkrufky's suggestion) Also, had to make sure we were making sure the firmware was loaded in the digital version of set_params, or else we end up get i2c errors if the device is asleep Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11789): xc5000: check xc5000_readreg return value for XC_RESULT_SUCCESSDevin Heitmueller
Make return value checking for calls to i2c routines explicit. Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>