summaryrefslogtreecommitdiff
path: root/drivers/media/video/cx18/cx18-av-core.c
AgeCommit message (Collapse)Author
2012-08-15[media] rename most media/video pci drivers to media/pciMauro Carvalho Chehab
Rename all PCI drivers with their own directory under drivers/media/video into drivers/media/pci and update the building system. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] cx18: Use the control frameworkHans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01V4L/DVB: cx18, cx23885, v4l2 doc, MAINTAINERS: Update Andy Walls' email addressAndy Walls
A trivial change to update my email address from my dead awalls@radix.net address to my current awalls@md.metrocast.net address. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01V4L/DVB: cx18: remove old g/s_fmt from the cx18_av subdevHans Verkuil
cx18 has now switched over completely to the new mediabus subdev ops. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01V4L/DVB: cx18: add s_mbus_fmt supportHans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: cx18/cx25840/saa7115/tvp5150: remove vbi support from s_fmtHans Verkuil
Now that s_fmt is no longer used for VBI format setup in subdevs, remove the VBI support from s_fmt. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: cx18: support new vbi ops to set/get VBI formatHans Verkuil
Also removed the bogus zeroing of fmt.sliced when setting up raw VBI. This should have been removed in ivtv, but it was just copied-and-pasted into cx18. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: v4l: move vbi-specific video ops to a new vbi ops structHans Verkuil
Only a relatively small number of video receivers and transmitters actually support VBI. So start moving the vbi specific ops to an ops struct of their own. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18V4L/DVB: cx18: Add support for component video inputsAndy Walls
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05V4L/DVB (13478): cx18: remove bogus init call.Hans Verkuil
The cx18 av core implemented an init call for no good reason. It's now turned into an internal function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Reviewed-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11898): cx18: Perform 64 bit divide so it works for 32 bit systemsAndy Walls
Thanks to David Ward and Mike Krufky for reporting the problem and debugging this as an unresolved symbol due to a 64 bit divide on a 32 bit system. David Ward provided the content of this patch; Andy Walls only performed some cosmetic edits. Reported-by: David Ward <david.ward@gatech.edu> Signed-off-by: David Ward <david.ward@gatech.edu> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11865): cx18: Tweak color burst gate delay and initial color ↵Andy Walls
sub-carrier freq Fix the burst gate delays to use a crystal value of 28636360 as assumed by the rest of the driver. Also have the initial color sub-carrier freq paramter use the src decimation ratio per the documentation, instead of the actual crystal/pixel clock ratio. The tracking circuit will find the correct color subcarrier in any case, as long as we're close. Also fix up some debug print statements. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11864): cx18: Complete support for Sliced and Raw VBI for 625 line ↵Andy Walls
systems Finish changes for sliced and raw VBI for 625 line systems. Tested with VPS and WSS being emitted by a PVR-350 in field 1 lines 16 and 23. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11863): cx18: Initial attempt to get sliced VBI working for 625 ↵Andy Walls
line systems Initial changes to get sliced VBI for 625 line system working. This is patch is untested. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-06-16V4L/DVB (11703): cx18: Have audio decoder drive SIF gain control, and rework ↵Andy Walls
AFE config Ensure the variable gain amplifier gain for SIF is driven by the audio deocder and not the video decoder. This forced rework of the analog front end (AFE) configuration to not rely on autoconfiguration, but instead set up the AFE mux, AFE parameters, and ADC1 & ADC2 configurations explicitly. Reported-by: Helen Buus <mythtv@hbuus.com> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06V4L/DVB (11380): v4l2-subdev: change s_routing prototypeHans Verkuil
It is no longer needed to use a struct pointer as argument, since v4l2_subdev doesn't require that ioctl-like approach anymore. Instead just pass the input, output and config (new!) arguments directly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06V4L/DVB (11370): v4l2-subdev: move s_std from tuner to core.Hans Verkuil
s_std didn't belong in the tuner ops. Stricly speaking it should be part of the video ops, but it is used by audio and tuner devices as well, so it is more efficient to make it part of the core ops. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-04-06V4L/DVB (11369): v4l2-subdev: add load_fw and use that instead of abusing ↵Hans Verkuil
core->init. The init callback was used in several places to load firmware. Make a separate load_fw callback for that. This makes the code a lot more understandable. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (11310): cx18: remove intermediate 'ioctl' stepHans Verkuil
The audio and vbi parts still used an 'ioctl'-like interface. Replace this with normal functions. Cc: Andy Walls <awalls@radix.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10854): cx18: Correct comments about vertical and horizontal ↵Andy Walls
blanking timings This change only affects comments. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10851): cx18: Fix a video scaling check problem introduced by ↵Andy Walls
sliced VBI changes Fix a scaling check that was failing, due to a magic number I missed fixing during previous slice VBI changes. Now $ v4l2-ctl -v width=480,height=480,pixelformat=MPEG yields proper visual results again. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10761): cx18: Change log lines for internal subdevs and fix ↵Andy Walls
tveeprom reads Give messages originating from internal subdevs a header using the subdev's name. Fixed an uninitialized variable problem with reading the EEPROM, noticed from log output. Got rid of the unused cx18_av_exit() function. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10758): cx18: Convert I2C devices to v4l2_subdevicesAndy Walls
This is a major perturbation to cx18 I2C device handling to convert it to the v4l2_device/subdeivce framework. This change breaks GPIO audio multiplexer control for the time being. It will be fixed in a coming change. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10757): cx18, v4l2-chip-ident: Finish conversion of AV decoder core ↵Andy Walls
to v4l2_subdev Added a new chip identifer to v4l2-chip-ident for the integrated A/V broadcast decoder core internal to the CX23418. Completed separation and encapsulation of the A/V decoder core interface as a v4l2_subdevice. The cx18 driver now compiles and links again. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10755): cx18: Convert the integrated A/V decoder core interface to ↵Andy Walls
a v4l2_subdev This is the next step in converting the cx18 driver to use the v4l2_device/ v4l2_subdevice framework. This is a straightforward conversion of the cx18_av_*[ch] files. It compiles, but leaves the driver in an unlinkable state at the moment. Note, the cx18 integrated A/V digitizer will now make a host match at address 1, as far as v4l2-dbg is concerned. That means it identifies itself as a separate "chip", and acts as an alias to the integrated A/V decoder registers that are also available with the host match at address 0. Signed-off-by: Andy Walls <awalls@radix.net> [mchehab@redhat.com: fix merge conflicts due to the removal of v4l2_ctrl_query_fill_std()] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10698): v4l2-common: remove v4l2_ctrl_query_fill_stdHans Verkuil
The v4l2_ctrl_query_fill_std() function wasn't one the best idea I ever had. It doesn't add anything valuable that cannot be expressed equally well with v4l2_ctrl_query_fill and only adds overhead. Replace it with v4l2_ctrl_query_fill() everywhere it is used and remove it from v4l2_common.c. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10446): cx18: Finally get sliced VBI working - for 525 line 60 Hz ↵Andy Walls
systems at least Sliced VBI, in the manner that ivtv implements it as a separate data stream, now works for 525 line 60 Hz systems like NTSC-M. It may work for 625 line 50 Hz systems, but I have more engineering work to do, to verify it is operating properly. Sliced data insertion into the MPEG PS should be working, but is untested. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10439): cx18: Clean-up and enable sliced VBI handlingAndy Walls
Removed legacy ivtv state variables, added comments, and cleaned up sliced VBI related code. Enabled sliced VBI. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10436): cx18: Fix coding style of a switch statement per checkpatch.plAndy Walls
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10433): cx18: Defer A/V core initialization until a valid ↵Andy Walls
cx18_av_cmd arrives Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30V4L/DVB (10408): v4l2: fix incorrect hue range checkHans Verkuil
A hue of -128 was rejected due to an incorrect range check, which was faithfully copy-and-pasted into four drivers... Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (9937): cx18: Use a consistent crystal value for computing all PLL ↵Andy Walls
parameters Use a consistent crystal value of 28.636360 MHz for computing all PLL parameters so clocks don't have relative error due to assumed crystal value mismatches. Also aimed to have all PLLs run their VOCs at close to 400 MHz to minimze the error of these PLLs as frequency synthesizers. Also set the VDCLK and AIMCLK PLLs to sane values before the APU and CPU firmware are loaded. Also fixed I2S Master clock dividers. Many thanks to Mike Bradley and Jeff Campbell for reporting this problem and suggesting the solution, researching and experimenting, and performing extensive testing to support their suggested solution. Reported-by: Jeff Campbell <jac1dlists@gmail.com> Reported-by: Mike Bradley <mike.bradley@incanetworks.com> Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (9728): cx18: Copyright attribution update for files modified by awallsAndy Walls
Add copyright attribution for files modified by awalls in 2008 Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30V4L/DVB (9724): cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry ↵Andy Walls
strategy cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy so that write retries always occur and read retries never occur (as they never help). Remove MMIO statistics logging to speed up MMIO accesses. Deprecate & ignore retry_mmio and mmio_ndelay module parameters, to essentially force retry_mmio=1 and mmio_ndelay=0. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9514): cx18: Fix PLL freq computation for debug displayAndy Walls
cx18: Fix PLL freq computation for debug display. The code to compute the PLL freq from register values was storing an intermediate 56 bit result in a 32 bit type, causing a nonsense value to be displayed. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-29V4L/DVB (9512): cx18: Fix write retries for registers that always change - ↵Andy Walls
part 3. cx18: Fix write retries for registers that always change - part 3. Fix the io for the rest of the registers that will often not read back the value just written. Modified register readback checks to make sure the intended effect was achieved without constantly rewriting the registers. The one outstanding register remaining is 0xc72014 CX18_AUDIO_ENABLE, whose behavior on writes I have yet to determine. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (9110): cx18: Add default behavior of checking and retrying PCI MMIO ↵Andy Walls
accesses cx18: Add default behavior of checking and retrying PCI MMIO accesses. The concept of checking and retrying PCI MMIO accesses for better reliability in older motherboards was suggested by Steve Toth <stoth@linuxtv.org>. This change implements MMIO retries and the retry_mmio module parameter that is enabled by default. Limited experiments have shown this is more reliable than the mmio_ndelay parameter. mmio_ndelay has insignificant effect with retries enabled. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-12V4L/DVB (8913): cx18: Create cx18_ specific wrappers for all pci mmio ↵Andy Walls
accessesors. cx18: Create cx18_ specific wrappers for all pci mmio accessesors. This is a first step in instrumenting all CX23418 PCI bus IO, to debug problems with accessing the CX23418's PCI memory mapped IO. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-07-20V4L/DVB (8378): cx18: move cx18_av_vbi_setup to av-core.c and rename to ↵Hans Verkuil
cx18_av_std_setup Same issue as for cx25840: this function sets up the standard timings and has nothing to do with VBI setup. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8377): ivtv/cx18: ensure the default control values are correctHans Verkuil
For several MPEG controls and the volume control the default as returned by VIDIOC_QUERYCTRL was incorrect and did not match the actual initial value. This is now fixed for cx18 and ivtv. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8167): cx18: set correct audio inputs for tuner and line-in 2.Hans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-20V4L/DVB (8162): cx18: fix PAL/SECAM supportHans Verkuil
Reverted the 'Fix unintended auto configurations in cx18-av-core' patch, instead disable the auto config completely. Fix a bug in cx18_av_vbi_setup() where the standard tests were done in the wrong order. Tested with NTSC-M, PAL-BG, PAL-I, PAL-DK, PAL-M, PAL-Nc, SECAM-DK, SECAM-L and SECAM-BG. The last one does not work at the moment due to a tda9887.c bug. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26V4L/DVB (8063): cx18: Fix unintended auto configurations in cx18-av-coreAndy Walls
Change the cx18-av-core code so that accesses to cx23418 av core that cause auto-configuration will be adjusted to emulate the auto-configuration behavior of the cx25843. This fixes the VBI displayed as video at the top of the frame for NTSC and probably other things. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-26V4L/DVB (8007): cx18/cx25840: the S-Video LUMA input can use all In1-In8 inputsHans Verkuil
The S-Video LUMA input was restricted to the In1-In4 inputs, but it turns out that it can use the full range of In1-In8. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-05V4L/DVB (7928): cx18: fix audio registers 808 and 80cHans Verkuil
The handling of the audio registers 808 and 80c were based on old datasheets. Updated to the latest information. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-29V4L/DVB (7786): cx18: new driver for the Conexant CX23418 MPEG encoder chipHans Verkuil
Many thanks to Steve Toth from Hauppauge and Nattu Dakshinamurthy from Conexant for their support. I am in particular thankful to Hauppauge since without their help this driver would not exist. It should also be noted that Steve did the work to get the DVB part up and running. Thank you! Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Steven Toth <stoth@hauppauge.com> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: G. Andrew Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>