summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-xc2028.c
Commit message (Collapse)AuthorAgeFilesLines
* V4L/DVB (7200): Fix FM firmware loadingMauro Carvalho Chehab2008-02-181-0/+3
| | | | | | There's no need to load SCode table for FM. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6954): There isn't a MTS radio firmwareMauro Carvalho Chehab2008-01-251-1/+1
| | | | | | Try to load non-MTS firmware instead. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6897): xc2028: ignore HAS_IF during specific S-Code type searchesChris Pascoe2008-01-251-4/+7
| | | | | | | | 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6893): tuner-xc2028: fix xc2028_attach functionMichael Krufky2008-01-251-1/+2
| | | | | | | | | | | 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6875): tuner-xc2028: ATSC requires 1.75 MHz tuning offsetMichael Krufky2008-01-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* V4L/DVB (6858): Fix offset for ATSCMauro Carvalho Chehab2008-01-251-1/+1
| | | | | | ATSC works with offset=0 Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6855): xc2028: select DTV78 firmware if tuning 7MHz VHF / 8MHz UHFChris Pascoe2008-01-251-8/+15
| | | | | | | | | | | | | 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6854): xc2028: be more specific about when applying offset for 7MHz ↵Chris Pascoe2008-01-251-1/+10
| | | | | | | | | | | | channels 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6853): xc2028: check HAS_IF flag against tableChris Pascoe2008-01-251-2/+2
| | | | | | | | | | 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6852): xc2028: s-code offset should not modify internal control ↵Chris Pascoe2008-01-251-2/+3
| | | | | | | | | | structure 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6851): xc2028: include int_freq in firmware version displayChris Pascoe2008-01-251-8/+16
| | | | | | | | 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6827): Auto-selects D2633 for ATSCMauro Carvalho Chehab2008-01-251-0/+3
| | | | | | | 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>
* V4L/DVB (6683): Fix DVB compatibilityMauro Carvalho Chehab2008-01-251-2/+7
| | | | | | | | | | 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>
* V4L/DVB (6677): Fix xc2028 driver for non OFDMMauro Carvalho Chehab2008-01-251-2/+0
| | | | | | | | | 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>
* V4L/DVB (6676): Improve s-code supportMauro Carvalho Chehab2008-01-251-37/+51
| | | | | | | | | | | | | 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>
* V4L/DVB (6675): Allow selecting the proper SCode table for DTVMauro Carvalho Chehab2008-01-251-0/+18
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6674): Add support for other DTV typesMauro Carvalho Chehab2008-01-251-15/+27
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6672): Add support for radioMauro Carvalho Chehab2008-01-251-0/+8
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6671): Avoids checking digital/analog at check_firmwareMauro Carvalho Chehab2008-01-251-56/+50
| | | | | | | | | | | 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>
* V4L/DVB (6662): Fix standard selection for PALMauro Carvalho Chehab2008-01-251-0/+3
| | | | | | Not all 8MHz firmware are marked with F8MHz. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6661): Remove firmware reload hack for analogMauro Carvalho Chehab2008-01-251-5/+10
| | | | | | | | | | | | 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>
* V4L/DVB (6660): Allow fully configuring xc3028 during xc2028_attachMauro Carvalho Chehab2008-01-251-1/+4
| | | | | | | | | | 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>
* V4L/DVB (6659): Convert MTS to bitfieldMauro Carvalho Chehab2008-01-251-1/+1
| | | | | | | | | | | | | | | 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>
* V4L/DVB (6658): Sets a default std, if not specifiedMauro Carvalho Chehab2008-01-251-1/+5
| | | | | | | 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>
* V4L/DVB (6657): Fix standard selection for PAL/M, PAL/N, PAL/Nc and NTSCMauro Carvalho Chehab2008-01-251-2/+8
| | | | | | Those standards use 6 MHz firmware. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6652): xc2028: try non-8MHZ init1 firmwareChris Pascoe2008-01-251-0/+3
| | | | | | | | 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>
* V4L/DVB (6651): xc2028: mask off type correctly when searching for ↵Chris Pascoe2008-01-251-1/+3
| | | | | | | | | | | standard-specific types 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>
* V4L/DVB (6650): xc2028: base firmwares should have std0Chris Pascoe2008-01-251-2/+5
| | | | | | | 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>
* V4L/DVB (6648): xc2028: add sleep hookChris Pascoe2008-01-251-0/+23
| | | | | | | 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>
* V4L/DVB (6647): xc2028: retry firmware load if tuner does not respondChris Pascoe2008-01-251-3/+34
| | | | | | | | | | 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>
* V4L/DVB (6646): xc2028: rework firmware (re)loading processChris Pascoe2008-01-251-97/+115
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* V4L/DVB (6645): xc2028: allow selection of D2633 firmwareChris Pascoe2008-01-251-3/+4
| | | | | | | | 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>
* V4L/DVB (6644): xc2028: use correct offset into scode firmwareChris Pascoe2008-01-251-2/+10
| | | | | | | | 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>
* V4L/DVB (6643): xc2028: use best match instead of first partial match during ↵Chris Pascoe2008-01-251-8/+38
| | | | | | | | | | | | firmware selection 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>
* V4L/DVB (6642): xc2028: don't duplicate max_len in privChris Pascoe2008-01-251-21/+16
| | | | | | | | | | | | | | 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>
* V4L/DVB (6641): xc2028: correct tuner offset for 7MHz DTVChris Pascoe2008-01-251-1/+4
| | | | | | | | 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>
* V4L/DVB (6640): xc2028: correctly select 8MHz firmwareChris Pascoe2008-01-251-2/+4
| | | | | | | | | 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>
* V4L/DVB (6639): xc2028: correct divisor lengthChris Pascoe2008-01-251-7/+5
| | | | | | | | 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>
* V4L/DVB (6638): xc2028: firmware loading cleanupChris Pascoe2008-01-251-44/+38
| | | | | | | | | | | 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>
* V4L/DVB (6637): xc2028: add missing breakChris Pascoe2008-01-251-0/+1
| | | | | | | 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>
* V4L/DVB (6636): xc2028: protect device listChris Pascoe2008-01-251-1/+13
| | | | | | | 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>
* V4L/DVB (6635): xc2028: v4l2_std_id needs to be long long to display completelyChris Pascoe2008-01-251-5/+5
| | | | | | | 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>
* V4L/DVB (6634): xc2028: error messages missing whitespaceChris Pascoe2008-01-251-2/+2
| | | | | | | 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>
* V4L/DVB (6633): xc2028: make register reads atomicChris Pascoe2008-01-251-25/+30
| | | | | | | | | | 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>
* V4L/DVB (6632): xc2028: fix inverted logic in audio standard checkChris Pascoe2008-01-251-6/+6
| | | | | | | 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>
* V4L/DVB (6631): xc2028: eliminate i2c macro side-effectsChris Pascoe2008-01-251-36/+46
| | | | | | | | 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>
* V4L/DVB (6614): Fix driver for i386 architecturesMauro Carvalho Chehab2008-01-251-4/+6
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6613): Fix: add a missing continue statementMauro Carvalho Chehab2008-01-251-0/+1
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (6612): Allow RESET_CLK callback and avoids unneeded loadingMichel Ludwig2008-01-251-0/+20
| | | | | | | | | | 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>
* V4L/DVB (6611): Change xc2028_attach method to make easier for DVBMichel Ludwig2008-01-251-26/+27
| | | | | | | | | 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>
OpenPOWER on IntegriCloud