summaryrefslogtreecommitdiff
path: root/drivers/media/common/tuners/xc5000.c
AgeCommit message (Collapse)Author
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>
2009-06-16V4L/DVB (11788): xc5000: cleanup i2c write routinesDevin Heitmueller
Cleanup the i2c write routine, getting rid of a passthrough function with only one caller 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 (11787): xc5000: cleanup i2c read routinesDevin Heitmueller
This patch centralizes the i2c read functions, and eliminates pass-through function only called by one caller. Make reading of xc5000 registers an atomic i2c transaction in case we're on a multi-master bus. 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 (11786): xc5000: handle tuner reset failures properlyDevin Heitmueller
Properly handle tuner reset failures (before it was always returning success) 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 (11723): Link firmware to physical deviceJean Delvare
Use the physical device rather than the i2c adapter as the reference device when loading firmwares. This will prevent the sysfs name collision with i2c-dev that has been reported many times. I may have missed other drivers which need the same fix. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (11059): xc5000: fix bug for hybrid xc5000 devices with IF other ↵Devin Heitmueller
than 5380 The xc5000 driver has a bug where the IF is always set to whatever the first caller to dvb_attach() provides. This fails when the device requires an IF other than 5380 and the analog driver is loaded first through tuner-core (which always supplies the hard-coded value of 5380). Thanks to Michael Krufky <mkrufky@linuxtv.org> and Steven Toth <stoth@linuxtv.org> for providing sample hardware, engineering level support, and testing. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10951): xc5000: Fix CodingStyle errors introduced by the last patchMauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10950): xc5000: prepare it to be used by cx231xx moduleSri Deevi
Signed-off-by: Srinivasa Deevi <srinivasa.deevi@conexant.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (9923): xc5000: remove init_fw optionDevin Heitmueller
The init_fw option was broken for the HVR-950q because we would call the reset callback inside of dvb_attach() and the callback had not been setup yet. Michael Krufky (who added the init_fw feature) says it's no longer required, so just remove the option completely. Thanks to user Zzeiss from #linuxtv chat for reporting the issue and Michael Krufky <mkrufky@linuxtv.org> for proposing the fix. Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Acked-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-17V4L/DVB (9261): xc5000: Checkpatch complianceSteven Toth
xc5000: Checkpatch compliance Signed-off-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (9049): convert tuner drivers to use dvb_frontend->callbackMichael Krufky
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8951): xc5000: dont pass devptr in xc5000_attach()Michael Krufky
Dont pass devptr in xc5000_attach, dont store it in xc5000_priv. This pointer is passed into the tuner_callback function, which always expects a pointer to fe->dvb->priv or i2c_adapter->algo_data. This prevents future possible bugs in new drivers, such as using a "devptr" other that the standard fe->dvb->priv in a DVB driver. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8950): xc5000: prevent an OOPS if analog driver is unloaded while ↵Michael Krufky
digital is in use Prevent an OOPS if xc5000_attach was called by tuner.ko before being called by the DVB adapter driver. The OOPS occurs when a digital tune request is made after tuner.ko is unloaded. When tuner.ko is unloaded, it takes the xc5000_config structure with it. Rather than storing a pointer to the xc5000_config structure, just store the if_khz and tuner_callback inside the xc5000_priv internal state structure. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8949): xc5000: allow multiple driver instances for the same ↵Michael Krufky
hardware to share state Convert xc5000 to use the hybrid_tuner_request_state and hybrid_tuner_release_state macros to manage state sharing between hybrid tuner instances. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8948): xc5000: kill xc5000_priv.hMichael Krufky
move struct xc5000_priv into xc5000.c and delete xc5000_priv.h Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03V4L/DVB (8805): Steven Toth email address changeSteven Toth
I need this so I can better isolate my linux email from my corporate email. Signed-off-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-07-20V4L/DVB (8098): xc5000: add module option to load firmware during driver attachMichael Krufky
The xc5000 firmware download process can be slow on certain devices. Add a module option, "init_fw" to perform the firmware download during xc5000_attach(), which would get the firmware download over with well before any tune request is made. When this option is enabled, it will reduce the time it takes to get a signal lock during the first tune after driver load, but will add a few seconds to the driver initialization. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-10tuners: treat firmware data as constDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-06-26V4L/DVB (8097): xc5000: check device hardware state to determine if firmware ↵Steven Toth
download is needed This patch ensures that the xc5000 will have firmware loaded as needed if the part is powered down or reset via gpio from the host. An example of this, in some cases, could be after the system resumes from standby or hibernate modes. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-14V4L/DVB (7893): xc5000: bug-fix: allow multiple devices in a single systemMichael Krufky
The current code passes a context pointer in the xc5000_config struct. This context pointer is used in the tuner_callback function, used to reset the device after firmware download. The xc5000_config struct is a static structure, whose .priv member was being assigned before calling xc5000_attach(). If there are more than one of the same device type installed on a single system, the last one to assign xc5000_config.priv will "win", and all others will cease to function properly. This patch passes the context pointer in xc5000_attach() rather that storing it within the static struct xc5000_config. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-29V4L/DVB(7767): Move tuners to common/tunersMauro Carvalho Chehab
There were several issues in the past, caused by the hybrid tuner design, since now, the same tuner can be used by drivers/media/dvb and drivers/media/video. Kconfig items were rearranged, to split V4L/DVB core from their drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>