Commit graph

360926 commits

Author SHA1 Message Date
Hans Verkuil
0752d98e1a [media] cx231xx: fix frequency clamping
Let the tuner clamp the frequency and store that clamped value.
This fixes a v4l2_compliance failure.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:58 -03:00
Hans Verkuil
8b735c1307 [media] cx231xx: zero priv field and use right width in try_fmt
The priv field of v4l2_pix_format must be zeroed. Also fix a bug in try_fmt
where the current width was used instead of the width passed to try_fmt.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:58 -03:00
Hans Verkuil
b251f95767 [media] cx231xx: fix tuner compliance issues
The g_tuner call wasn't passed on to the subdevices, g_frequency didn't
check for invalid tuners and a low-level function that was expected to
return 0 or a negative error returned a positive number instead, causing
s_frequency to return bogus errors.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:58 -03:00
Hans Verkuil
06c46003f7 [media] cx231xx: remove broken audio input support from the driver
The audio selection code is broken. Audio and video indices were
mixed up and s_audio would reject changing the audio input to
something else anyway, so what's the point?
All the audio input code has been removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:57 -03:00
Hans Verkuil
530e01e782 [media] cx231xx: clean up radio support
Radio should not use video or audio inputs.
In addition, fix a bug in radio_g_tuner where s_tuner was called in the tuner
subdev instead of g_tuner.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:57 -03:00
Hans Verkuil
fddd14c8f6 [media] cx231xx: add required VIDIOC_DBG_G_CHIP_IDENT support
This fixes a v4l2_compliance failure.

[mchehab@redhat.com: CodingStyle fixes]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:57 -03:00
Hans Verkuil
4bc837d414 [media] cx231xx: add device_caps support to QUERYCAP
This fixes a v4l2_compliance failure.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:57 -03:00
Hans Verkuil
e74d7e6d34 [media] bttv: remove g/s_audio since there is only one audio input
Note that the current driver does not implement enumaudio (so apps cannot
tell that audio inputs are present), it does not set V4L2_CAP_AUDIO, nor
does it set audioset when calling ENUM_INPUT. And G_AUDIO doesn't set the
stereo flag either. So these g/s_audio ioctls are quite pointless and
misleading. Especially since some surveillance boards do not have audio
at all.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:25:12 -03:00
Hans Verkuil
b8e2a361ce [media] bttv: do not switch to the radio tuner unless it is accessed
Just opening the radio tuner should not cause a switch to the radio tuner.
Only after calling g/s_tuner or g/s_frequency should this happen.
This prevents audio being unmuted as soon as the driver is loaded because
some process opens /dev/radioX just to see what sort of node it is, which
switches on the radio tuner and unmutes audio.
This code can be improved further by actually keeping track of who owns the
tuner and returning -EBUSY if switching tuner modes will cause problems.
But for now just fix the annoying case where on boot the radio turns on
automatically.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:24:58 -03:00
Hans Verkuil
c13eb7039f [media] bttv: fix try_fmt_vid_overlay and setup initial overlay size
try_fmt_vid_overlay should map incorrect sizes and fields to valid values.
It also expects that an initial overlay size is defined so g_fmt_vid_overlay
returns valid information.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:24:28 -03:00
Hans Verkuil
3d4b803505 [media] bttv: fix g_tuner capabilities override
The capability field of v4l2_tuner should be ORed by the various subdevs
and by the main driver. In this case the stereo capability was dropped.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:23:59 -03:00
Hans Verkuil
fafdc26b85 [media] bttv: there may be multiple tvaudio/tda7432 devices
Probe for additional tvaudio devices, and allow tvaudio+tda7432 to
co-exist. My STB TV PCI FM bttv card has a tda7432, a tda9850 and a
tea6420 and with this patch it finally works again (probably for the
first time in many years).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:23:37 -03:00
Hans Verkuil
6795cc5550 [media] bttv: use centralized std and implement g_std
The 'current_norm' field cannot be used if multiple device nodes (video and
vbi in this case) set the same std.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:23:02 -03:00
Hans Verkuil
8c14cc1f0a [media] bttv: fix priority handling
Replace the - incorrect - manual priority handling with the core priority
implementation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:22:35 -03:00
Hans Verkuil
ae50f0f83e [media] bttv: add support for control events
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:13:10 -03:00
Hans Verkuil
01df530c27 [media] bttv: convert to the control framework
Note that the private chroma agc control has been replaced with the standard
CHROMA_AGC control.
Also fixes a mute/automute problem where closing the file handle would force
mute on. That's not what you want since that would make the mute state out of
sync with the mute control. Instead check against the user count.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:12:05 -03:00
Hans Verkuil
5d478e0de8 [media] tda7432: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:08:14 -03:00
Hans Verkuil
ee70e3d803 [media] bttv: fix field handling inside TRY_FMT
- don't return -EINVAL for invalid field types, handle those as if it
  was FIELD_ANY.
- the handling of FIELD_SEQ_BT/TB was wrong as well: if such field formats
  aren't supported, then fall back to FIELD_ANY instead of returning an error.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:07:05 -03:00
Hans Verkuil
a12fd70e3b [media] bttv: fill in fb->flags for VIDIOC_G_FBUF
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:04:56 -03:00
Hans Verkuil
f586489993 [media] bttv: fill in colorspace
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:03:44 -03:00
Hans Verkuil
a652ef6095 [media] bttv: G_PARM: set readbuffers
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:03:23 -03:00
Hans Verkuil
76ea992a03 [media] bttv: set initial tv/radio frequencies
Set an initial frequencies when the driver is loaded. That way G_FREQUENCY will
give a frequency that corresponds with reality.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:02:58 -03:00
Hans Verkuil
d9b6707673 [media] bttv: disable g/s_tuner and g/s_freq when no tuner present, fix return codes
If no tuner is present, then disable the tuner and frequency ioctls.
We can remove a number of checks from those ioctls testing for the presence
of a tuner.
Also remove some tuner type checks (now done by the core) and fix an
error return when the prio check fails.
Finally some 'unlikely' statements are removed since those only make sense
in tightly often executed loops, otherwise they just clutter up the code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:01:59 -03:00
Hans Verkuil
f74f89cb1c [media] bttv: fix ENUM_INPUT and S_INPUT
- Fix ENUM_INPUT audioset.
- Fix incorrect input check in s_input.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:01:17 -03:00
Hans Verkuil
1b9e94dc69 [media] bttv: add VIDIOC_DBG_G_CHIP_IDENT
VIDIOC_DBG_G_CHIP_IDENT is a prerequisite for the G/S_REGISTER ioctls.
In addition, add support to call G/S_REGISTER for supporting i2c devices.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:00:16 -03:00
Hans Verkuil
78dea1aed4 [media] bttv: fix querycap and radio v4l2-compliance issues
The querycap ioctl didn't support V4L2_CAP_DEVICE_CAPS and the radio device
implemented audio and video inputs and s_std, which are not part of the radio
API.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 13:59:05 -03:00
Hans Verkuil
a545e2ea14 [media] tlg2300: update MAINTAINERS file
Remove two maintainers: telegent.com no longer exists, so those email
addresses are invalid as well.
Added myself as co-maintainer and change the status to 'Odd Fixes'.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 11:49:23 -03:00
Hans Verkuil
ca1178ed6a [media] tlg2300: Remove logs() macro
ioctl debugging can now be done through the debug parameter in sysfs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 11:49:01 -03:00
Hans Verkuil
60c66b6f27 [media] tlg2300: allow multiple opens
Due to a poor administration of the driver state it wasn't possible to open
a video or vbi device multiple times.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 11:00:26 -03:00
Hans Verkuil
d4de6e4062 [media] tlg2300: remove empty vidioc_try_fmt_vid_cap, add missing g_std
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 10:49:03 -03:00
Hans Verkuil
f29056ebd9 [media] tlg2300: implement the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 10:48:40 -03:00
Hans Verkuil
7cb2398750 [media] tlg2300: fix missing audioset
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 10:47:54 -03:00
Hans Verkuil
7556ba9bfb [media] tlg2300: fix frequency handling
The usual set of problems: the frequency isn't clamped to the frequency range,
no tuner index check and the frequency isn't initialized properly on module
load.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 10:47:37 -03:00
Hans Verkuil
c5d8907faa [media] tlg2300: fix querycap
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 10:45:12 -03:00
Hans Verkuil
1b952f17f3 [media] tlg2300: embed video_device
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 10:35:11 -03:00
Hans Verkuil
270ecca60e [media] tlg2300: add missing video_unregister_device
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 09:35:27 -03:00
Hans Verkuil
42e509c6d3 [media] tlg2300: fix radio querycap
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 09:35:05 -03:00
Hans Verkuil
668cb00ed5 [media] tlg2300: switch to v4l2_fh
This switch to v4l2_fh resolves the last v4l2_compliance issues with respect
to control events and priority handling.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 17:33:46 -03:00
Hans Verkuil
173fdb8aff [media] tlg2300: add control handler for radio device node
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 17:33:02 -03:00
Hans Verkuil
6fef490706 [media] tlg2300: embed video_device instead of allocating it
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 17:31:59 -03:00
Hans Verkuil
8f08294605 [media] tlg2300: remove ioctls that are invalid for radio devices
The input and audio ioctls are only valid for video/vbi nodes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 17:31:19 -03:00
Hans Verkuil
54dd0dde85 [media] tlg2300: switch to unlocked_ioctl
The driver already does locking, so it is safe to switch to unlocked_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 17:30:54 -03:00
Hans Verkuil
8bdfe557b8 [media] tlg2300: fix tuner and frequency handling of the radio device
This driver now passes the tuner and frequency tests of v4l2-compliance.
It's the usual bugs: frequency wasn't clamped to the valid frequency range,
incorrect tuner capabilities and tuner fields not filled in, missing test
for invalid tuner index, no initial frequency and incorrect error handling.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 17:30:35 -03:00
Hans Verkuil
919729237f [media] tlg2300: use correct device parent
Set the correct parent for v4l2_device_register and don't set the name
anymore (that's now deduced from the parent). Also remove an unnecessary
forward reference and fix two weird looking log messages.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 17:28:49 -03:00
Frank Schaefer
a61660185b [media] em28xx: enable tveeprom for device Hauppauge HVR-930C
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 16:38:05 -03:00
Mauro Carvalho Chehab
0e4bbedd63 [media] mb86a20s: Don't assume a 32.57142MHz clock
Now that some devices initialize register 0x2a with different
values, add the calculus formula, instead of hardcoding it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 16:37:07 -03:00
Mauro Carvalho Chehab
04fa725e7b [media] mb86a20s: Implement set_frontend cache logic
Up to now, the driver was simply assuming TV mode, 13 segs.
Implement the logic to control the ISDB operational mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 16:36:40 -03:00
Mauro Carvalho Chehab
385cd33c8d [media] em28xx-dvb: Don't put device in suspend mode at feed stop
Putting em28xx in suspend mode when a feed stops is just plain
wrong. Every time a new PES filter is changed, the DVB demux
code will stop the current feed, and then start a new one.
If are there any code that switches off the frontend, via
some GPIO setting, this would make the DVB fail.
This condition was actually trigged with one device, during
DVB scan, as, during scan, it is common that userspace apps
to change the filter several times, in order to get all
tables.
Also, this is not needed at all, since the em28xx code already
hooks into ops.ts_bus_ctrl(). This warrants that em28xx can
check there if DVB frontend is in usage or not. The code there
already puts the device on suspend mode, if the DVB frontend
is not used (closed).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 16:35:54 -03:00
Mauro Carvalho Chehab
84c09d723c [media] cx231xx: Improve signal reception for PV SBTVD
Instead of using 3.3 MHz IF, use 4MHz. That's the standard
value for the demod, and, while it can be adjusted, 3.3 MHz
is out of the recommended range. So, let's stick with the
default.
With regards to the IF voltage level, instead of using
0.5 V(p-p) for IF, use 2V, giving a 12dB gain.
The rationale is that, on PixelView SBTVD Hybrid,
even 2V(p-p) would be in the nominal range for IF,
as the maximum range on this particular device is 3V.
A higher gain here should help to improve reception under
weak signals.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 16:35:38 -03:00
Mauro Carvalho Chehab
3a2e47519e [media] mb86a20s: cleanup the status at set_frontend()
As the device got re-initialized, the stats should vanish
until the device gets lock again.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-04 16:35:16 -03:00