Commit Graph

421 Commits (56835e6cc053c29bf1a15a07dbeb78f219a15214)

Author SHA1 Message Date
Ezequiel García 630081e990 [media] cx23885: Replace struct memcpy with struct assignment
Copying structs by assignment is type safe.
Plus, is shorter and easier to read.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-30 19:53:55 -03:00
Ezequiel García c410d09bf3 [media] cx23885: Remove useless struct i2c_algo_bit_data
The field 'struct i2c_algo_bit_data i2c_algo' is wrongly confused with
struct i2c_algorithm. Moreover, i2c_algo field is not used since
i2c is registered using i2c_add_adpater() and not i2c_bit_add_bus().
Therefore, it's safe to remove it.
Tested by compilation only.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-30 19:52:39 -03:00
Anton Blanchard c6cff16926 [media] cx23885: Silence unknown command warnings
I am seeing a constant stream of warnings on my cx23885 based card:
	cx23885_tuner_callback(): Unknown command 0x2.

Add a check in cx23885_tuner_callback to silence it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-07-06 19:36:37 -03:00
Devin Heitmueller 0ac60acb54 [media] cx23885: add support for HVR-1255 analog (cx23888 variant)
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 19:36:35 -03:00
Devin Heitmueller d214ddc868 [media] cx23885: make analog support work for HVR_1250 (cx23885 variant)
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-07-06 19:36:34 -03:00
Igor M. Liplianin 7b134e85b1 [media] cx23885: TeVii s471 card support
The card is similar to TeVii s470, but has different LNB power control.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-20 11:09:26 -03:00
Hans Verkuil e92ba2830b [media] v4l: fix compiler warnings
media_build/v4l/au0828-video.c: In function 'au0828_irq_callback':
media_build/v4l/au0828-video.c:123:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
media_build/v4l/cx23888-ir.c: In function 'pulse_clocks_to_clock_divider':
media_build/v4l/cx23888-ir.c:334:6: warning: variable 'rem' set but not used [-Wunused-but-set-variable]
media_build/v4l/cx25840-ir.c: In function 'pulse_clocks_to_clock_divider':
media_build/v4l/cx25840-ir.c:319:6: warning: variable 'rem' set but not used [-Wunused-but-set-variable]
media_build/v4l/cx25840-ir.c: In function 'cx25840_ir_tx_write':
media_build/v4l/cx25840-ir.c:863:21: warning: variable 'c' set but not used [-Wunused-but-set-variable]
media_build/v4l/em28xx-audio.c: In function 'snd_em28xx_hw_capture_params':
media_build/v4l/em28xx-audio.c:346:31: warning: variable 'format' set but not used [-Wunused-but-set-variable]
media_build/v4l/em28xx-audio.c:346:25: warning: variable 'rate' set but not used [-Wunused-but-set-variable]
media_build/v4l/em28xx-audio.c:346:15: warning: variable 'channels' set but not used [-Wunused-but-set-variable]
media_build/v4l/hdpvr-control.c: In function 'get_input_lines_info':
media_build/v4l/hdpvr-control.c:98:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/hdpvr-video.c: In function 'hdpvr_try_ctrl':
media_build/v4l/hdpvr-video.c:955:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
media_build/v4l/saa7134-video.c: In function 'saa7134_s_tuner':
media_build/v4l/saa7134-video.c:2030:6: warning: variable 'rx' set but not used [-Wunused-but-set-variable]
media_build/v4l/sn9c102_core.c: In function 'sn9c102_stream_interrupt':
media_build/v4l/sn9c102_core.c:998:7: warning: variable 'timeout' set but not used [-Wunused-but-set-variable]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Janne Grunau <j@jannau.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 14:47:03 -03:00
Miroslav Slugen 9ee8537f60 [media] cx23885: Don't duplicate xc4000 entry for radio
All radio tuners in cx23885 driver using same address for radio and
tuner, so there is no need to probe it twice for same tuner and we can
use radio_type UNSET.

Be aware radio support in cx23885 is not yet committed, so this is only
minor fix for future support.

Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-16 11:55:12 -02:00
Miroslav Slugen a7c8aadad3 [media] cx23885-dvb: check if dvb_attach() succeded
Fix possible null dereference for Leadtek DTV 3200H
XC4000 tuner when no firmware file available.

Cc: stable@kernel.org
Signed-off-by: Miroslav Slugen <thunder.mmm@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-16 11:54:50 -02:00
Dan Carpenter 0cb64f02b8 [media] cx23885: handle errors from videobuf_dvb_get_frontend()
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-16 09:27:57 -02:00
Steven Toth c147f61083 [media] cx23885: Query the CX25840 during enum_input for status
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-10 23:38:21 -02:00
Stefan Ringel 722c90eb76 [media] cx23885: add Terratec Cinergy T PCIe dual
Signed-off-by: Stefan Ringel <linuxtv@stefanringel.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-07 11:47:33 -02:00
Steven Toth 9def5ed716 [media] cx23885: Bugfix /sys/class/video4linux/videoX/name truncation
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 06:54:30 -02:00
Steven Toth 09b3bc223b [media] cx23885: Control cleanup on the MPEG Encoder
Added three new control calls (g_std, querystd and g_ctrl) to
the -417 driver. Also routed other controls through the main
cx23885 driver meaning that the controls for the 417 and the
raw video device all enter the driver code and are handled
in a single place.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-05 06:53:46 -02:00
Steven Toth 350451375d [media] cx23885: Hauppauge HVR1850 Analog driver support
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-05 06:52:02 -02:00
Steven Toth 9c9c3d078b [media] cx23885: Configure the MPEG encoder early to avoid jerky video
Found an odd bug while implementing support for the HVR1850 that
lead to jerky video during the first capture, if the encoder was
not initialized early. I've modied the driver to configure the
encoder early, and this avoids the issue - a reasonable workaround.

Regression tested against the HVR1800 and soon to be added HVR1850

[mchehab@redhat.com: Fix this compilation issue:  drivers/media/video/cx23885/cx23885-417.c:1351:2: error: too few arguments to function ‘cx23885_initialize_codec’]
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:51:18 -02:00
Steven Toth 38e3d7ce41 [media] cx23885: Ensure the MPEG encoder height is configured from the norm
Bugfix: The height was not always correctly configured if switching between
different video standards. Change the encode height based on the standard.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:48:29 -02:00
Steven Toth 182d29f307 [media] cx23885: Cleanup MPEG encoder GPIO handling
During initialization the prior GPIO's were not being preserved
and restore correctly. Small cleanups to configure the GPIO's
for the HVR1700, HVR1800 and HVR1850.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-01-04 20:48:09 -02:00
Steven Toth 4c3764d150 [media] cx25840 / cx23885: Fixing audio/volume regression
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>
2012-01-04 20:47:11 -02:00
Mauro Carvalho Chehab a7d44baaed [media] cx23885-dvb: Remove a dirty hack that would require DVBv3
The cx23885-dvb driver has a dirty hack:
	1) it hooks the DVBv3 legacy call to FE_SET_FRONTEND;
	2) it uses internally the DVBv3 struct to decide some
	   configs.

Replace it by a change during the gate control. This will
likely work, but requires testing. Anyway, the current way
will break, as soon as we stop copying data for DVBv3 for
pure DVBv5 calls.

Compile-tested only.

Cc: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-12-31 10:22:54 -02:00
Alfredo Jesús Delaiti 8798875369 [media] cx23885: add support for Mygica X8507
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-11-24 15:51:39 -02:00
Jean Delvare a824f0f445 [media] video: Drop undue references to i2c-algo-bit
There's one comment that has been copied from bttv to many other
media/video drivers:

/* init + register i2c algo-bit adapter */

Meanwhile, many drivers use hardware I2C implementations instead of
relying on i2c-algo-bit, so this comment is misleading. Remove the
reference to "algo-bit" from all drivers, to avoid any confusion. This
is the best way to ensure that the comments won't go out of sync
again. Anyone interested in the implementation details would rather
look at the code itself.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-11-24 15:11:17 -02:00
Steven Toth a461e0ad3d [media] cx23885: Stop the risc video fifo before reconfiguring it
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 17:23:20 -03:00
Steven Toth 19696f09da [media] cx23885: Avoid incorrect error handling and reporting
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 17:22:55 -03:00
Steven Toth d44aa2d7fc [media] cx23885: Avoid stopping the risc engine during buffer timeout
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 17:22:14 -03:00
Steven Toth 84f42af665 [media] cx23885: Removed a spurious function cx23885_set_scale()
Unused function removed.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:21:46 -03:00
Steven Toth 6c6f52fd60 [media] cx23885: v4l2 api compliance, set the audioset field correctly
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 17:21:34 -03:00
Steven Toth fa1e0fd371 [media] cx23885: hook the audio selection functions into the main driver
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 17:21:14 -03:00
Steven Toth fc1a889df7 [media] cx23885: add generic functions for dealing with audio input selection
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:20:12 -03:00
Steven Toth e92bcf8d8a [media] cx23885: fixes related to maximum number of inputs and range checking
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:19:46 -03:00
Steven Toth 2cb9ccd461 [media] cx23885: Initial support for the MPX-885 mini-card
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:19:27 -03:00
Steven Toth 33cdeb35f5 [media] cx23885: Enable audio line in support from the back panel
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 17:18:50 -03:00
Steven Toth 8304be888c [media] cx23885: Allow the audio mux config to be specified on a per input basis
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:18:50 -03:00
Steven Toth d9368da718 [media] cx23885: Name an internal i2c part and declare a bitfield by name
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:13:01 -03:00
Steven Toth 1ca3553aa4 [media] cx23885: Ensure VBI buffers timeout quickly - bugfix for vbi hangs during streaming
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:12:48 -03:00
Steven Toth 68776b30fe [media] cx23885: remove channel dump diagnostics when a vbi buffer times out
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:12:22 -03:00
Steven Toth 24465b4485 [media] cx23885: ensure video is streaming before allowing vbi to stream
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:12:01 -03:00
Steven Toth af76e9f625 [media] cx23885: Ensure the VBI pixel format is established correctly
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:11:42 -03:00
Steven Toth 5ab27e6d31 [media] cx23885: add vbi buffer formatting, window changes and video core changes
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:11:15 -03:00
Steven Toth 4f9c41439c [media] cx23885: vbi line window adjustments
Coding style and printk's cleaned up in following patches.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:10:27 -03:00
Steven Toth f88fb8e938 [media] cx23885: minor printk cleanups and device registration
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:09:35 -03:00
Steven Toth 79776c89e0 [media] cx23885: initialize VBI support in the core, add IRQ support, 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 17:09:20 -03:00
Steven Toth b5f7405004 [media] cx23885: initial support for VBI with the cx23885
A handlful of coding style issue cleaned up in the following patches.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:08:46 -03:00
Steven Toth 6aa07d9e63 [media] cx23885: add two additional defines to simplify VBI register bitmap handling
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:08:28 -03:00
Steven Toth 3273961fe1 [media] cx23885: setup the dma mapping for raw audio support
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:03:46 -03:00
Steven Toth efa762f597 [media] cx23885: minor function renaming to ensure uniformity
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:03:30 -03:00
Steven Toth 80f1e086e6 [media] cx23885: convert call clients into subdevices
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-10-14 17:02:25 -03:00
Mauro Carvalho Chehab d5492fb9ed [media] cx23885: Don't use memset on vidioc_ callbacks
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 17:00:19 -03:00
Mijhail Moreyra 97ce5670fc [media] cx23885: hooks the alsa changes into the video subsystem
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 16:59:42 -03:00
Mijhail Moreyra b12ab3f81c [media] cx23885: correct the contrast, saturation and hue controls
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 16:53:20 -03:00