summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-xc2028.c
Commit message (Collapse)AuthorAgeFilesLines
* V4L/DVB(7767): Move tuners to common/tunersMauro Carvalho Chehab2008-04-291-1227/+0
| | | | | | | | | 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>
* V4L/DVB (7740): tuner-xc2028.c dubious !x & yHarvey Harrison2008-04-261-1/+1
| | | | | Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7731): tuner-xc2028: fix signal strength calculusMauro Carvalho Chehab2008-04-241-3/+10
| | | | Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7653): tuner-xc2028: drop the severity of version reportingDevin Heitmueller2008-04-241-4/+4
| | | | | | | | | | tuner-xc2028.c - Drop the severity level of the xc3028 version reporting, since it's only of interest to developers and user's don't need to have it show up in their dmesg output every time they change the channel. Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7651): tuner-xc2028: Several fixes to SCODEMauro Carvalho Chehab2008-04-241-8/+13
| | | | | | | | | | | | | | | | | | | This patch fixes several issues on SCODE: 1) The extracting tool weren't generating the proper tags for SCODE. This has almost no effect, since those tags shouldn't be used; 2) DIBCOM52 were using a wrong IF. It should be 5200, instead of 5700; 3) seek_firmware were wanting an exact match for firmware type. This is wrong. As result, no SCODE firmware were loaded; 4) A few files were including the wrong file for seeking demod firmwares; 5) XC3028_FE_DEFAULT can be used, if user doesn't want to load a firmware. However, this weren't documentated. This feature require more testing. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7608): em28xx-dvb: Some cleanups and fixesDevin Heitmueller2008-04-241-1/+1
| | | | | | | | | | | | | em28xx-dvb.c: - Remove unneeded xc3028_ctrl structure. The driver automatically preserves the previous value tuner-xc2028.c: - Make the return type for xc2028_get_reg signed, since all of the callers are looking for "< 0" to detect errors. Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7605): tuner-xc3028: Avoids too much firmware reloadsMauro Carvalho Chehab2008-04-241-30/+8
| | | | | | | xc3028_sleep function is being used with a different meaning. This should be called only before doing S1/S3 sleep. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7518): media/video/ replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-241-14/+14
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7439): tuner-xc2028: Adds an option to allow forcing to load an ↵Mauro Carvalho Chehab2008-04-241-7/+17
| | | | | | | | | | | | | specific firmware name There are a number of different firmware versions and variants, shipped together with boards. This patch adds an extra parameter to the tuner-xc2028 to allow specifying for an specific firmware name to be loaded. This helps to test for a firmware that better fits some board. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7399): Removes video_dev from tuner-xc2028 config structMauro Carvalho Chehab2008-04-241-3/+12
| | | | | | | | | | | | | | | The video_dev parameter, on tuner-xc2028 were used to pass i2c private data to tuner_callback. Since the driver already have a pointer to i2c_adap->algo_data, uses this instead. This parameter were used also as a magic number to idenfity if two drivers are trying to register the same xc3028 tuner. This occurs with boards with DVB support, where both DVB and V4L drivers will share the same tuner. Instead of using the algo_data as a private number, after this patch, the driver will use i2c_adap->dev, with seems more consistent. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7260): tuner-xc3028: Don't check return code for clock resetMauro Carvalho Chehab2008-04-241-3/+5
| | | | | | | | | Only tm6000 needs to be aware when a frequency is being changed. This seems to improve channel change detection. Other bridges don't need this. So, better to discard any errors if this fails, and proceed changing the channels. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7135): remove PREFIX from users of tuner_foo printk macrosMichael Krufky2008-04-241-4/+4
| | | | | | | | | Store a pointer to the device name in the name field of struct tuner_i2c_props, so that we can remove the printk macros defined in tuner-i2c.h Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7114): tuner-xc2028.c: make a function staticAdrian Bunk2008-04-241-1/+1
| | | | | | | dump_firm_type_and_int_freq() can become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* 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>
OpenPOWER on IntegriCloud