summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-xc2028.c
AgeCommit message (Collapse)Author
2008-01-06Fix CodingStyleMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-05There isn't a MTS radio firmwareMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Try to load non-MTS firmware instead. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-02xc2028: ignore HAS_IF during specific S-Code type searchesChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> If we are selecting the S-Code firmware to load by name, then we must mask off the HAS_IF bit during the search. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
2007-12-21tuner-xc2028: fix xc2028_attach functionMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> xc2028_attach was returning an integer when disabled from the build, where it should instead be returning NULL. Declare xc2028_attach as type dvb_frontend * instead of void *. The prototype declaration must be marked as extern in the header. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-12-18 tuner-xc2028: ATSC requires 1.75 MHz tuning offsetMauro Carvalho Chehab
From: Michael Krufky <mkrufky@infradead.org> In my testing yesterday, I was using a scan file tailored specifically for a unique test situation -- As it turns out, this scan file was bad, and I will use the one included inside dvb-apps for testing for now on. I've tested with other ATSC tuners just to confirm, using: us-ATSC-center-frequencies-8VSB Anyhow, as it turns out, the tuner-xc2028 *does* require a tuning offset for ATSC. Even though the linux-dvb api passes in center frequencies from userspace, apparantly the xceive firmware is already factoring in the tuning offset to center. In order to make the device function using the same scan files / channels.conf configurations as other atsc devices, we must offset by 1.75 MHz. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-18Fix offset for ATSCMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> ATSC works with offset=0 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-02xc2028: select DTV78 firmware if tuning 7MHz VHF / 8MHz UHFChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> It seems that the DTV78 firmware is intended for use in locations where VHF channels have 7MHz bandwidth and UHF channels have 8MHz bandwidth. If we switch to DTV78 firmware when we detect this condition, we can avoid firmware reloads when switching between VHF and UHF transponders. Place the state for this in the control structure so that card drivers can hint to us to use DTV78 firmware from the first tuning attempt. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
2007-12-02xc2028: be more specific about when applying offset for 7MHz channelsChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> We have been inserting a mystery 500kHz offset for tuning 7MHz channels, however some experimentation reveals it is only needed under certain conditions with specific firmware combinations. Document these and only apply the offset when we know it is required. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
2007-12-02xc2028: check HAS_IF flag against tableChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> When searching for the right S-Code table to load, check the HAS_IF flag against the firmware we are checking instead of against the the "type" requested. We already ignore the scode type requested if the caller passed an int_freq; this makes the search by frequency consistent with that behaviour. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
2007-12-02xc2028: s-code offset should not modify internal control structureChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Don't modify the control structure that was provided at attach when applying an offset to the S-Code, otherwise it will be incorrect on subsequent tunes. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
2007-12-02xc2028: include int_freq in firmware version displayChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Add "int_freq" to the debugging output when selecting firmware and the HAS_IF flag when dumping firmware during load. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
2007-12-16Auto-selects D2633 for ATSCMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> ATSC standard-specific firmware is D2633 on both v2.5 and v2.7. Better to auto-select this firmware, overriding ctrl.d2633. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-12-02Fix DVB compatibilityMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> DVB-S is not supported. Also, there are some QAM6 firmwares for xc3028, but it is reported that this doesn't work fine. Thanks to Manu Abraham, Michael Krufky and Patrick Boettcher for their insights. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-25Fix xc2028 driver for non OFDMMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> A previous patch implemented support for non-OFDM digital TV. However, the previous bandwidth ofdm parameter were left at the code by mistake. Thanks to Michael Krufky and Patrick Boettcher for noticing this mistake. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-25Improve s-code supportMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> s-code tables are related to IF frequency used for video demodulation. The s-codes for analog are automatically loaded, according with video standard. However, for digital, they will depend on the IF of the demoduler chip. IF of the demoduler. Before this patch, only a few IF's where possible to use. This patch allows selecting any IF defined at firmware file. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-24Allow selecting the proper SCode table for DTVMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-24Add support for other DTV typesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-24Add support for radioMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-24Avoids checking digital/analog at check_firmwareMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since check_firmware is called via analog or digital set freq routines, move type selection to those routines. This avoids having several if's at the code, and simplifies the source code. A sideback effect is that implementing radio and other dvb types will become simpler. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-22Fix standard selection for PALMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Not all 8MHz firmware are marked with F8MHz. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/tuner-xc2028.c | 3 +++ 1 file changed, 3 insertions(+)
2007-11-22Remove firmware reload hack for analogMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> On some cases, xc2028/xc3028 wents into "turn off" mode. It seems that this happens when very weak signals are tuned. To solve this, specific standard reaload were done previously. Christopher patches changed this behavior to a complete firmware reload. This patch removes the hack. A much cleaner solution for this trouble is just to sent a xc2028/3028 software reset. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/tuner-xc2028.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
2007-11-22Allow fully configuring xc3028 during xc2028_attachMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> xc3028 can be used on some DTV only designs (for example, DVB-S boards). Before this patch, a DTV only board would need to call set_tuner_config callback. This patch allows to optionally pass a xc3028_ctrl parameter, via xc3028_config struct, fully initializing the driver for DTV. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/tuner-xc2028.c | 5 ++++- linux/drivers/media/video/tuner-xc2028.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)
2007-11-22Convert MTS to bitfieldMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Xc2028.3028 has two type of firmwares: audio-standard specific ones and baseband MTS firmwares. MTS firmwares provide stereo decoding for 6 MHz BTSC/EIAJ and for monoaural audio decoding on 8 MHz firmwares. It seems that the option to use MTS or a standard-specific audio decoding depends on the way xc2028/3028 is connected. Instead of wasting 32 (or 64 bits) to signalize if the driver needs to use MTS firmware, this patch converts it to a bitfield that can be shared with other proprieties of xc2028/3028. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-23Sets a default std, if not specifiedMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Some drivers call set_frequency before selecting the video standard. Before this patch, an invalid standard ID could be assumed. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/tuner-xc2028.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
2007-11-22Fix standard selection for PAL/M, PAL/N, PAL/Nc and NTSCMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Those standards use 6 MHz firmware. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-20xc2028: try non-8MHZ init1 firmwareChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> When loading init1 firmware, there may not be an 8MHz specific version. Load the non-8MHz version if it exists. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-20xc2028: mask off type correctly when searching for standard-specific typesChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> When searching for standard-specific analog firmware, only certain type bits are valid, much like for DTV. Mask them off when finding the firmware to load. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-20xc2028: base firmwares should have std0Chris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> When loading BASE firmware, we must use std = 0. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-20xc2028: add sleep hookChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Add sleep method to enable putting the tuner into standby mode. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-20xc2028: retry firmware load if tuner does not respondChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> In practice, the tuner occasionally fails to respond correctly after a firmware load. Retry the firmware load if the firmware/hardware version we read back from the tuner after programming does not match what we expect. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-20xc2028: rework firmware (re)loading processChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Define a list of valid "firmware types" for each combination of BASE, DTV and SCODEs. By masking the appropriate firmware bits off we can just use one "type" for the firmware searching and also flag when we are looking for a BASE, DTV or SCODE type firmware. This makes it much easier to track if we need to change device modes or flash an individual firmware part. Add a structure to remember what firmware properties we have. This contains the currently loaded/wanted base firmware (type), video std (id), video std requested (std_req), scode file and number in use. Incorporate said structure into the tuner private data. When checking whether the current firmware needs to be reloaded, first figure out exactly what "type" of firmware we want (base, std and scode), and then proceed to load the appropriate matching base, std-specific and scode records iff there are any changes required. This removes guesswork from the process because we no longer need to individually code a check for every tuning parameter's interactions. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: allow selection of D2633 firmwareChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Add a bit to select D2633 DTV firmware to struct xc2028_ctrl, so that it can be enabled via .set_config. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: use correct offset into scode firmwareChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> When validating and loading SCODE firmware we need to take into account the two-byte size header before each entry. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: use best match instead of first partial match during firmware selectionChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Rather than picking the first video standard firmware that supports any of the standards that the user has requested, try to select one that supports as many of them as possible. This improves the likelihood that the firmware we select will support the user's desired TV standard. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: don't duplicate max_len in privChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> There is no need to duplicate the max_len field from the ctrl structure in the private data. If we use it directly from priv->ctrl, we can memcpy the structure (apart from strings) to reduce maintenance as it grows. Enforce a minimum max_len length of 8 data bytes (+ 1 address byte) as seems to be required by the tuner. Also, use kstrdup instead of open coding the string duplication. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: correct tuner offset for 7MHz DTVChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> 7MHz bandwidth DVB-T needs an adjusted offset at the PLL to ensure the IF output is correctly centered. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: correctly select 8MHz firmwareChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> We were using priv->bandwidth to select the base firmware to load, not the requested bandwidth value, oops. Also, 7MHz Digital TV needs 8MHz base firmware loaded. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: correct divisor lengthChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> The frequency divisor should only be four bytes long. Also, display the frequency and divisor correctly in the debug output. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: firmware loading cleanupChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Hold the private lock over set_config and set priv->firm_size to 0 after a failed firmware load to prevent firmware accidentally being freed on us. Clean up the firmware load/error messages somewhat and rename priv->version to priv->firm_version to make it clear which "version" it is. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: add missing breakChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Add break to stop us from following the default failure path even upon success. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: protect device listChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Protect refcount changes and modifications to xc2028_list with a mutex. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: v4l2_std_id needs to be long long to display completelyChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Cast v4l2_std_id variables to unsigned long long so they will printk properly. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: error messages missing whitespaceChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Fix some missing spaces in errors that may be emitted during attach failure. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: make register reads atomicChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> Issuing register reads as a separate address write and data read transactions means that other I2C activity could occur in between and state could get out of sync. Issue both the write and read in a single transaction so that the i2c layer can prevent other users accessing the bus until we are complete. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: fix inverted logic in audio standard checkChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> strcasecmp returns 0 on match, not true. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-19xc2028: eliminate i2c macro side-effectsChris Pascoe
From: Chris Pascoe <c.pascoe@itee.uq.edu.au> The I2C macros have side effects and send_seq could cause a return from a function with a mutex held. Change them to behave like real functions. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-16Fix driver for i386 architecturesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Also, fixed backporting up to 2.6.20 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-16Fix: add a missing continue statementMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-16Allow RESET_CLK callback and avoids unneeded loadingMauro Carvalho Chehab
From: Michel Ludwig <michel.ludwig@gmail.com> TM5600/TM6000 needs clock reset during firmware load. This patch adds the capability of caling a callback method for this. Also, avoids uneeded firmware loads. Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-16Change xc2028_attach method to make easier for DVBMauro Carvalho Chehab
From: Michel Ludwig <michel.ludwig@gmail.com> Removes uneeded parameters and adds an structure for passing the parameters This patch is co-authored by Mauro Carvalho Chehab. Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>