summaryrefslogtreecommitdiff
path: root/drivers/media/video/cx23885/cx23885-video.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>
2012-07-06[media] cx23885: add support for HVR-1255 analog (cx23888 variant)Devin Heitmueller
Get the HVR-1255 analog support working for all supported inputs. This includes introduction of a new board profile for an OEM variant which doesn't have all the same inputs as the retail version of the board. Validated with the following boards: HVR-1255 (0070:2259) Thanks to Steven Toth and Hauppauge for loaning me various boards to regression test with. Thanks-to: Steven Toth <stoth@kernellabs.com> Signed-off-by: Devin Heitmueler <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06[media] cx23885: make analog support work for HVR_1250 (cx23885 variant)Devin Heitmueller
The analog support in the cx23885 driver was completely broken for the HVR-1250. Add the necessary code. Note that this only implements analog for the composite and s-video inputs. The tuner input continues to be non-functional due to a lack of analog support in the mt2131 driver. Validated with the following boards: HVR-1250 (0070:7911) Thanks to Steven Toth and Hauppauge for loaning me various boards to regression test with. Thanks-to: Steven Toth <stoth@kernellabs.com> Signed-off-by: Devin Heitmueler <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-16[media] cx23885: handle errors from videobuf_dvb_get_frontend()Dan Carpenter
The error handling in the original code wasn't complete so static checkers complained about a potential NULL deference. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-10[media] cx23885: Query the CX25840 during enum_input for statusSteven Toth
We can pass a NO_SIGNAL video decoder state back to applications if it's available. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05[media] cx23885: Bugfix /sys/class/video4linux/videoX/name truncationSteven Toth
The card names are being truncated in the video4linux sys class name file. Prior to this patch they were shown as: cx23885[0] mpeg (Hauppauge WinT cx23885[0] video (Hauppauge WinT cx23885[0] vbi (Hauppauge WinT After this patch they are shown as: Hauppauge WinTV-HVR1850 (video) Hauppauge WinTV-HVR1850 (mpeg) Hauppauge WinTV-HVR1850 (vbi) Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05[media] cx23885: Hauppauge HVR1850 Analog driver supportSteven Toth
First in a series of patches that adds support to the cx23885 driver for CX23888 analog video handling. Raw and MPEG video support is being added for the HVR1850 driver in the patch, and the following series of patches. Some basic cx23885 driver cleanup. Partly to add HVR1850 support and partly to allow -417.c V4L2 calls to be routed through thr driver core and handled in a single place. Make a number of core driver functions available to the -417.c driver to streamline the driver. Add the analog tuner ops definition so we can reach/tune the hardware when we need to. Added the tff field so 888 based cards (which have a weird field ordering issue) can be accomodated and worked around in the driver. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04[media] cx25840 / cx23885: Fixing audio/volume regressionSteven Toth
Since the conversion to subdev in Oct 2010 the audio controls have not functioned correctly in the cx23885 driver. Passing values of 0-3f did not translate into meaningfull register writes. I've converted the cx23885 driver to match the cx25840 volume control definition and now audio is working reliably again. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24[media] cx23885: add support for Mygica X8507Alfredo Jesús Delaiti
This patch supports card Mygica X8507 (analog part) This controller is a copy of driver card Mygica X8506 This patch depends on patch cx23885-alsa To do: FM, ISDB-t, remote control, audio for composite1, S-Video and video component. Signed-off-by: Alfredo J. Delaiti <alfredodelaiti@netscape.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Stop the risc video fifo before reconfiguring itSteven Toth
Safety reasons. We shouldn't be trying to reconfigure a risc processor instruction queue unless it's stopped. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Avoid incorrect error handling and reportingSteven Toth
Previous driver over-reported errors and stopped the video fifo (causing video to stop) if 1) A risc error occured 2) The risc processor detected that it has missing lines in the video frame 3) The risc fifo is about to overflow. The previous driver reported all three of these cases as risc errors when this is technically not correct. So, the function was cleaned up. 1. Ensure that risc opcode related errors are correctly shown as such, and not overly reported for non-risc-opcode cases. 2. Ensure that line sync and overflow errors are not reported as opcode errors. 3. Ensure that only the risc-op-code case can stop the fifo and dump channel / risc processor information. The net result is that if video becomes unstable, cable disconnect, this will not trigger a stop of the video firmware (due to missing lines errors). Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Avoid stopping the risc engine during buffer timeoutSteven Toth
1. Removed the verbose 'dump channel state to console', very noisy in weak signal conditions. 2. No need for the video buffer timeout to stop the risc engine here. Clearer and easier to maintain if start_video_dma() is the single place that this is done. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Removed a spurious function cx23885_set_scale()Steven Toth
Unused function removed. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: v4l2 api compliance, set the audioset field correctlySteven Toth
Inform applications that multiple audio inputs are available on non-tv inputs. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: hook the audio selection functions into the main driverSteven Toth
Ensure audio is established at driver start. Ensure the correct defaults are established for the audio path if the cards struct has nothing defined. Allow the caller to select one of the two baseband input paths. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: add generic functions for dealing with audio input selectionSteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: fixes related to maximum number of inputs and range checkingSteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Initial support for the MPX-885 mini-cardSteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Enable audio line in support from the back panelSteven Toth
Add code to program the flatiron internal i2c ADC and pass the appropriate audio mux enums to the cx25840 driver. Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: ensure video is streaming before allowing vbi to streamSteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Ensure the VBI pixel format is established correctlySteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: add vbi buffer formatting, window changes and video core ↵Steven Toth
changes Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: minor printk cleanups and device registrationSteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: initialize VBI support in the core, add IRQ support, ↵Steven Toth
register vbi device Coding style and printk's are cleaned up in subsequent patches Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: minor function renaming to ensure uniformitySteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: convert call clients into subdevicesSteven Toth
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: Don't use memset on vidioc_ callbacksMauro Carvalho Chehab
vidioc_g_tuner should not do any memset for the parameters. Core already does that. In particular, V4L2 core now does some handling for the tuner type, and the tuner-core module relies on that. So, doing any memset there is a very bad idea. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: hooks the alsa changes into the video subsystemMijhail Moreyra
Signed-off-by: Mijhail Moreyra <mijhail.moreyra@gmail.com> Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14[media] cx23885: correct the contrast, saturation and hue controlsMijhail Moreyra
Signed-off-by: Mijhail Moreyra <mijhail.moreyra@gmail.com> Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-07-27[media] Stop using linux/version.h on most video driversMauro Carvalho Chehab
All the modified drivers didn't have any version increment since Jan, 1 2011. Several of them didn't have any version increment for a long time, even having new features and important bug fixes happening. As we're now filling the QUERYCAP version with the current Kernel Release, we don't need to maintain a per-driver version control anymore. So, let's just use the default. In order to preserve the Kernel module version history, a KERNEL_VERSION() macro were added to all modified drivers, and the extraver number were incremented. I opted to preserve the per-driver version control to a few pwc, pvrusb2, s2255, s5p-fimc and sh_vou. A few drivers are still using the legacy way to handle ioctl's. So, we can't do such change on them, otherwise, they'll break. Those are: uvc, et61x251 and sn9c102. The rationale is that the per-driver version control seems to be actively maintained on those. Yet, I think that the better for them would be to just use the default version numbering, instead of doing that by themselves. While here, removed a few uneeded include linux/version.h Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-21[media] cx23885: implement tuner_bus parameter for cx23885_board structureIgor M. Liplianin
There is two external I2C buses in cx23885 chip. Currently, analog tuners supported for second I2C bus only In NetUP Dual DVB-T/C CI RF card tuners connected to first bus So, in order to support analog tuners sitting on first bus we need modifications. Signed-off-by: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-30[media] v4l: fix handling of v4l2_input.capabilitiesHans Verkuil
The v4l core sets the v4l2_input.capabilities field based on the supplied v4l2_ioctl_ops. However, several drivers do a memset or memcpy of the v4l2_input struct, thus overwriting that field incorrectly. Either remove the memset (which is already done by the v4l core), or add the proper capabilities field in case of a memcpy. The same is also true for v4l2_output, but that only affected the ivtv driver. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-12-29[media] V4L: remove V4L1 compatibility modeHans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-22[media] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functionsLaurent Pinchart
The argument isn't used anymore by the functions, remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-08[media] v4l: kill the BKLArnd Bergmann
All of the hard problems for BKL removal appear to be solved in the v4l-dvb/master tree. This removes the BKL from the various open functions that do not need it, or only use it to protect an open count. The zoran driver is nontrivial in this regard, so I introduce a new mutex that locks both the open/release and the ioctl functions. Someone with access to the hardware can probably improve that by using the existing lock in all cases. Finally, all drivers that still use the locked version of the ioctl function now get called under a new mutex instead of the BKL. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-22[media] v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev*Laurent Pinchart
With the v4l2_i2c_new_subdev* functions now supporting loading modules based on modaliases, replace the hardcoded module name passed to those functions by NULL. All corresponding I2C modules have been checked, and all of them include a module aliases table with names corresponding to what the drivers modified here use. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: videobuf: add ext_lock argument to the queue init functionsHans Verkuil
Add an ext_lock argument to the videobuf init functions. This allows drivers to pass the vdev->lock pointer (or any other externally held lock) to videobuf. For now all drivers just pass NULL. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-10-21V4L/DVB: drivers/media/video: Adjust confusing if indentationJulia Lawall
In cx23885/cx23885-video.c, cx88/cx88-video.c, davinci/vpif_capture.c, and davinci/vpif_display.c, group the aligned code into a single if branch. In saa7134/saa7134-video.c, outdent the code following the if. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable braces4@ position p1,p2; statement S1,S2; @@ ( if (...) { ... } | if (...) S1@p1 S2@p2 ) @script:python@ p1 << r.p1; p2 << r.p2; @@ if (p1[0].column == p2[0].column): cocci.print_main("branch",p1) cocci.print_secs("after",p2) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08V4L/DVB: cx23885: Protect PCI interrupt mask manipulations with a spinlockAndy Walls
This patch encapsulates access to the PCI_INT_MSK register and dev->pci_irqmask variable and protects them with a spinlock. This is needed because both the hard IRQ handler and a workhandler will need to manipulate the mask to disable the AV_CORE interrupt. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-08-08V4L/DVB: cx23885: Add a VIDIOC_LOG_STATUS ioctl function for analog video ↵Andy Walls
devices Add a simple log_status function for raw analog video capture device nodes, to provide insight into the state of the CX2388[578] A/V decoder core. Signed-off-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-06-01V4L/DVB: cx23885: convert to s_mbus_fmtHans Verkuil
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-19V4L/DVB: V4L2: Replace loops for finding max buffers in VIDIOC_REQBUFS callbacksAndreas Bombe
Due to obvious copy and paste coding a number of video capture drivers which implement a limit on the buffer memory decremented the user supplied buffer count in a while loop until it reaches an acceptable value. This is a silly thing to do when the maximum value can be directly computed. Signed-off-by: Andreas Bombe <aeb@debian.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-02-26V4L/DVB: cx23885: Add support for LEADTEK WinFast PxTV1200Kusanagi Kouichi
I tested only tv and composite. Video works fine but no audio. Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13556): v4l: Remove unneeded video_device::minor assignmentsLaurent Pinchart
Now that the video_device registration is tested using video_is_registered(), drivers don't need to initialize the video_device::minor field to -1 anymore. Remove those unneeded assignments. [mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13555): v4l: Use video_device_node_name() instead of the minor numberLaurent Pinchart
Instead of using the minor number in kernel log messages, use the device node name as returned by the video_device_node_name() function. This makes debug, informational and error messages easier to understand for end users. [mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13554a): v4l: Use the video_drvdata function in driversLaurent Pinchart
Fix all device drivers to use the video_drvdata function instead of maintaining a local list of minor to private data mappings. Call video_set_drvdata to register the driver private pointer when not already done. Where applicable, the local list of mappings is completely removed when it becomes unused. [mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13553): v4l: Use the video_is_registered function in device driversLaurent Pinchart
Fix all device drivers to use the video_is_registered function instead of checking video_device::minor. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-16V4L/DVB (13550): v4l: Use the new video_device_node_name functionLaurent Pinchart
Fix all device drivers to use the new video_device_node_name function. This also strips kernel log messages from the "/dev/" prefix, has the device node location is a userspace policy decision unknown to the kernel. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05V4L/DVB (13211): cx23885: card Mygica X8506 analog TV supportDavid T.L. Wong
Signed-off-by: David T.L. Wong <davidtlwong@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05V4L/DVB (13208): cx23885: fix uninitialized member bugDavid T.L. Wong
Signed-off-by: David T. L. Wong <davidtlwong@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>