platform/kernel/linux-rpi.git
11 years ago[media] cx231xx-417: use one querycap for all device nodes
Hans Verkuil [Tue, 29 Jan 2013 15:52:33 +0000 (12:52 -0300)]
[media] cx231xx-417: use one querycap for all device nodes

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx-417: remove empty functions
Hans Verkuil [Tue, 29 Jan 2013 15:50:18 +0000 (12:50 -0300)]
[media] cx231xx-417: remove empty functions

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: improve std handling
Hans Verkuil [Tue, 29 Jan 2013 13:50:54 +0000 (10:50 -0300)]
[media] cx231xx: improve std handling

Set the initial standard of subdevices instead of leaving it undefined.
Also update the width and height when a new standard is chosen and
return -EBUSY when attempting to change the standard while videobuf is
busy.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: get rid of a bunch of unused cx231xx_fh fields
Hans Verkuil [Mon, 28 Jan 2013 15:57:47 +0000 (12:57 -0300)]
[media] cx231xx: get rid of a bunch of unused cx231xx_fh fields

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: replace ioctl by unlocked_ioctl
Hans Verkuil [Mon, 17 Sep 2012 12:26:46 +0000 (09:26 -0300)]
[media] cx231xx: replace ioctl by unlocked_ioctl

There was already a core lock, so why wasn't ioctl already replaced by
unlock_ioctl?
This patch switches to unlocked_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: remove current_norm usage
Hans Verkuil [Mon, 17 Sep 2012 11:30:07 +0000 (08:30 -0300)]
[media] cx231xx: remove current_norm usage

The use of this field is deprecated since it will not work when multiple
device nodes reference the same video input (the video and vbi nodes in
this case). The norm field should be a device-global value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: add struct v4l2_fh to get prio and event support
Hans Verkuil [Mon, 17 Sep 2012 10:31:04 +0000 (07:31 -0300)]
[media] cx231xx: add struct v4l2_fh to get prio and event support

Required to resolve v4l2-compliance failures.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: convert to the control framework
Hans Verkuil [Mon, 17 Sep 2012 10:22:09 +0000 (07:22 -0300)]
[media] cx231xx: convert to the control framework

This is needed to resolve the v4l2-compliance complaints about the control
ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: fix vbi compliance issues
Hans Verkuil [Sat, 9 Feb 2013 09:41:11 +0000 (06:41 -0300)]
[media] cx231xx: fix vbi compliance issues

Various v4l2-compliance fixes: remove unused sliced VBI functions, zero the
reserved fields of struct v4l2_vbi_format and implement the missing s_fmt_vbi_cap.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] cx231xx: fix frequency clamping
Hans Verkuil [Sat, 9 Feb 2013 09:40:33 +0000 (06:40 -0300)]
[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>
11 years ago[media] cx231xx: zero priv field and use right width in try_fmt
Hans Verkuil [Sat, 9 Feb 2013 09:35:02 +0000 (06:35 -0300)]
[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>
11 years ago[media] cx231xx: fix tuner compliance issues
Hans Verkuil [Thu, 13 Sep 2012 15:54:36 +0000 (12:54 -0300)]
[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>
11 years ago[media] cx231xx: remove broken audio input support from the driver
Hans Verkuil [Thu, 13 Sep 2012 09:17:47 +0000 (06:17 -0300)]
[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>
11 years ago[media] cx231xx: clean up radio support
Hans Verkuil [Tue, 29 Jan 2013 15:32:20 +0000 (12:32 -0300)]
[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>
11 years ago[media] cx231xx: add required VIDIOC_DBG_G_CHIP_IDENT support
Hans Verkuil [Thu, 13 Sep 2012 08:37:11 +0000 (05:37 -0300)]
[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>
11 years ago[media] cx231xx: add device_caps support to QUERYCAP
Hans Verkuil [Thu, 13 Sep 2012 08:29:12 +0000 (05:29 -0300)]
[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>
11 years ago[media] bttv: remove g/s_audio since there is only one audio input
Hans Verkuil [Fri, 15 Feb 2013 09:56:48 +0000 (06:56 -0300)]
[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>
11 years ago[media] bttv: do not switch to the radio tuner unless it is accessed
Hans Verkuil [Sun, 10 Feb 2013 12:24:14 +0000 (09:24 -0300)]
[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>
11 years ago[media] bttv: fix try_fmt_vid_overlay and setup initial overlay size
Hans Verkuil [Thu, 7 Feb 2013 10:56:11 +0000 (07:56 -0300)]
[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>
11 years ago[media] bttv: fix g_tuner capabilities override
Hans Verkuil [Wed, 6 Feb 2013 15:44:07 +0000 (12:44 -0300)]
[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>
11 years ago[media] bttv: there may be multiple tvaudio/tda7432 devices
Hans Verkuil [Wed, 6 Feb 2013 15:43:37 +0000 (12:43 -0300)]
[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>
11 years ago[media] bttv: use centralized std and implement g_std
Hans Verkuil [Wed, 6 Feb 2013 15:43:07 +0000 (12:43 -0300)]
[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>
11 years ago[media] bttv: fix priority handling
Hans Verkuil [Wed, 6 Feb 2013 15:42:40 +0000 (12:42 -0300)]
[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>
11 years ago[media] bttv: add support for control events
Hans Verkuil [Wed, 6 Feb 2013 15:42:13 +0000 (12:42 -0300)]
[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>
11 years ago[media] bttv: convert to the control framework
Hans Verkuil [Wed, 6 Feb 2013 15:40:28 +0000 (12:40 -0300)]
[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>
11 years ago[media] tda7432: convert to the control framework
Hans Verkuil [Tue, 5 Feb 2013 15:17:38 +0000 (12:17 -0300)]
[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>
11 years ago[media] bttv: fix field handling inside TRY_FMT
Hans Verkuil [Wed, 6 Feb 2013 15:03:30 +0000 (12:03 -0300)]
[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>
11 years ago[media] bttv: fill in fb->flags for VIDIOC_G_FBUF
Hans Verkuil [Wed, 6 Feb 2013 15:00:03 +0000 (12:00 -0300)]
[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>
11 years ago[media] bttv: fill in colorspace
Hans Verkuil [Wed, 6 Feb 2013 14:58:59 +0000 (11:58 -0300)]
[media] bttv: fill in colorspace

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] bttv: G_PARM: set readbuffers
Hans Verkuil [Sun, 9 Sep 2012 13:27:57 +0000 (10:27 -0300)]
[media] bttv: G_PARM: set readbuffers

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] bttv: set initial tv/radio frequencies
Hans Verkuil [Wed, 6 Feb 2013 14:49:14 +0000 (11:49 -0300)]
[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>
11 years ago[media] bttv: disable g/s_tuner and g/s_freq when no tuner present, fix return codes
Hans Verkuil [Wed, 6 Feb 2013 14:43:07 +0000 (11:43 -0300)]
[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>
11 years ago[media] bttv: fix ENUM_INPUT and S_INPUT
Hans Verkuil [Thu, 31 Jan 2013 11:45:13 +0000 (08:45 -0300)]
[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>
11 years ago[media] bttv: add VIDIOC_DBG_G_CHIP_IDENT
Hans Verkuil [Sun, 9 Sep 2012 12:23:31 +0000 (09:23 -0300)]
[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>
11 years ago[media] bttv: fix querycap and radio v4l2-compliance issues
Hans Verkuil [Sun, 9 Sep 2012 12:03:29 +0000 (09:03 -0300)]
[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>
11 years ago[media] tlg2300: update MAINTAINERS file
Hans Verkuil [Thu, 7 Feb 2013 12:26:14 +0000 (09:26 -0300)]
[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>
11 years ago[media] tlg2300: Remove logs() macro
Hans Verkuil [Thu, 31 Jan 2013 09:39:09 +0000 (06:39 -0300)]
[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>
11 years ago[media] tlg2300: allow multiple opens
Hans Verkuil [Mon, 16 Jul 2012 14:52:41 +0000 (11:52 -0300)]
[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>
11 years ago[media] tlg2300: remove empty vidioc_try_fmt_vid_cap, add missing g_std
Hans Verkuil [Thu, 31 Jan 2013 09:33:35 +0000 (06:33 -0300)]
[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>
11 years ago[media] tlg2300: implement the control framework
Hans Verkuil [Mon, 16 Jul 2012 13:22:48 +0000 (10:22 -0300)]
[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>
11 years ago[media] tlg2300: fix missing audioset
Hans Verkuil [Mon, 16 Jul 2012 13:03:34 +0000 (10:03 -0300)]
[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>
11 years ago[media] tlg2300: fix frequency handling
Hans Verkuil [Thu, 31 Jan 2013 09:27:37 +0000 (06:27 -0300)]
[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>
11 years ago[media] tlg2300: fix querycap
Hans Verkuil [Thu, 31 Jan 2013 09:42:03 +0000 (06:42 -0300)]
[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>
11 years ago[media] tlg2300: embed video_device
Hans Verkuil [Mon, 16 Jul 2012 11:17:58 +0000 (08:17 -0300)]
[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>
11 years ago[media] tlg2300: add missing video_unregister_device
Hans Verkuil [Mon, 16 Jul 2012 11:17:34 +0000 (08:17 -0300)]
[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>
11 years ago[media] tlg2300: fix radio querycap
Hans Verkuil [Thu, 31 Jan 2013 09:17:52 +0000 (06:17 -0300)]
[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>
11 years ago[media] tlg2300: switch to v4l2_fh
Hans Verkuil [Mon, 16 Jul 2012 10:53:36 +0000 (07:53 -0300)]
[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>
11 years ago[media] tlg2300: add control handler for radio device node
Hans Verkuil [Thu, 12 Jul 2012 15:56:47 +0000 (12:56 -0300)]
[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>
11 years ago[media] tlg2300: embed video_device instead of allocating it
Hans Verkuil [Thu, 12 Jul 2012 15:39:58 +0000 (12:39 -0300)]
[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>
11 years ago[media] tlg2300: remove ioctls that are invalid for radio devices
Hans Verkuil [Thu, 31 Jan 2013 09:16:41 +0000 (06:16 -0300)]
[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>
11 years ago[media] tlg2300: switch to unlocked_ioctl
Hans Verkuil [Thu, 12 Jul 2012 15:33:41 +0000 (12:33 -0300)]
[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>
11 years ago[media] tlg2300: fix tuner and frequency handling of the radio device
Hans Verkuil [Thu, 12 Jul 2012 15:33:41 +0000 (12:33 -0300)]
[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>
11 years ago[media] tlg2300: use correct device parent
Hans Verkuil [Thu, 7 Feb 2013 12:31:33 +0000 (09:31 -0300)]
[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>
11 years ago[media] em28xx: enable tveeprom for device Hauppauge HVR-930C
Frank Schaefer [Sun, 3 Mar 2013 18:37:44 +0000 (15:37 -0300)]
[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>
11 years ago[media] mb86a20s: Don't assume a 32.57142MHz clock
Mauro Carvalho Chehab [Mon, 4 Mar 2013 11:15:49 +0000 (08:15 -0300)]
[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>
11 years ago[media] mb86a20s: Implement set_frontend cache logic
Mauro Carvalho Chehab [Mon, 4 Mar 2013 10:10:06 +0000 (07:10 -0300)]
[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>
11 years ago[media] em28xx-dvb: Don't put device in suspend mode at feed stop
Mauro Carvalho Chehab [Sun, 3 Mar 2013 12:34:41 +0000 (09:34 -0300)]
[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>
11 years ago[media] cx231xx: Improve signal reception for PV SBTVD
Mauro Carvalho Chehab [Sun, 3 Mar 2013 10:49:50 +0000 (07:49 -0300)]
[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>
11 years ago[media] mb86a20s: cleanup the status at set_frontend()
Mauro Carvalho Chehab [Sat, 2 Mar 2013 18:02:23 +0000 (15:02 -0300)]
[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>
11 years ago[media] mb86a20s: Don't reset strength with the other stats
Mauro Carvalho Chehab [Sat, 2 Mar 2013 17:54:49 +0000 (14:54 -0300)]
[media] mb86a20s: Don't reset strength with the other stats

Signal strength is always available. There's no reason to reset
it, as it has its own logic to reset it already.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: Always reset the frontend with set_frontend
Mauro Carvalho Chehab [Sat, 2 Mar 2013 16:45:31 +0000 (13:45 -0300)]
[media] mb86a20s: Always reset the frontend with set_frontend

Always init the frontend when set_frontend is called. The rationale
is: it was noticed that, on some devices, it fails to lock with a
different channel. It seems that some other registers need to be
restored to its initial state, when the channel changes.
As it is better to reset everything, even wasting a few more
miliseconds than to loose channel lock, let's change the logic
to always reset.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: change AGC tuning parameters
Mauro Carvalho Chehab [Fri, 1 Mar 2013 18:20:25 +0000 (15:20 -0300)]
[media] mb86a20s: change AGC tuning parameters

Use the AGC settings present on a newer device.
The initial settings were taken from one of the first devices with
mb86a20s, and there are several reports that this is not working
properly on some places.
So, instead of keeping using it, get the parameters taken from a
newer device. Tests are welcomed.
Tested also with cx231xx PixelView SBTVD Hybrid with no regressions
noticed so far.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: don't allow updating signal strength too fast
Mauro Carvalho Chehab [Sat, 2 Mar 2013 13:15:30 +0000 (10:15 -0300)]
[media] mb86a20s: don't allow updating signal strength too fast

Getting signal strength requires some loop poking with I2C.
Don't let it happen too fast.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: Fix signal strength calculus
Mauro Carvalho Chehab [Fri, 1 Mar 2013 19:15:16 +0000 (16:15 -0300)]
[media] mb86a20s: Fix signal strength calculus

A register typo made the calculation to not work. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: provide CNR stats before FE_HAS_SYNC
Mauro Carvalho Chehab [Sat, 2 Mar 2013 12:06:17 +0000 (09:06 -0300)]
[media] mb86a20s: provide CNR stats before FE_HAS_SYNC

State 9 means TS started to be output, and it should be
associated with FE_HAS_SYNC.
The mb86a20scan get CNR statistics at state 7, when frame sync
is obtained.
As CNR may help to adjust the antenna, provide it earlier.
A latter patch could eventually start outputing MER measures
earlier, but that would require a bigger change, and probably
won't be better than the current way, as the time between
changing from state 8 to 9 is generally lower than the time
to get the stats collected.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: adjust IF based on what's set on the tuner
Mauro Carvalho Chehab [Thu, 28 Feb 2013 19:45:39 +0000 (16:45 -0300)]
[media] mb86a20s: adjust IF based on what's set on the tuner

Instead of hardcoding a fixed IF frequency of 3.3 MHz, use
the IF frequency provided by the tuner driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] mb86a20s: don't pollute dmesg with debug messages
Mauro Carvalho Chehab [Sat, 2 Mar 2013 12:05:42 +0000 (09:05 -0300)]
[media] mb86a20s: don't pollute dmesg with debug messages

There are a few debug tests that are shown with dev_err() or
dev_info(). Replace them by dev_dbg().

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: extract the device configuration dataset from eeproms with 16 bit...
Frank Schaefer [Sun, 3 Mar 2013 18:37:43 +0000 (15:37 -0300)]
[media] em28xx: extract the device configuration dataset from eeproms with 16 bit address width

The new eeproms with 16 address width still have the the device config dataset
(the content of the old 8 bit eeproms) embedded.
Hauppauge also continues to include the tveeprom data structure inside this
dataset in their devices.
The start address of the dataset depends on the start address of the microcode
and a variable additional offset.
It should be mentioned that Camera devices seem to use a different dataset type,
which is not yet supported.
Tested with devices "Hauppauge HVR-930C". I've also checked the USB-log from the
"MSI Digivox ATSC" and it works the same way.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: do not store eeprom content permanently
Frank Schaefer [Sun, 3 Mar 2013 18:37:42 +0000 (15:37 -0300)]
[media] em28xx: do not store eeprom content permanently

We currently reserve an array of 256 bytes for the eeprom content in the device
struct. For eeproms with 16 bit address width it might even be necessary to
increase the buffer size further.
Having such a big chunk of memory reserved even if the device has no eeprom and
keeping it after it has already been processed seems to be a waste of memory.
Change the code to allocate + free the eeprom memory dynamically.
This also makes it possible to handle different dataset sizes depending on what
is stored/found in the eeprom.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: add helper function for reading data blocks from i2c clients
Frank Schaefer [Sun, 3 Mar 2013 18:37:41 +0000 (15:37 -0300)]
[media] em28xx: add helper function for reading data blocks from i2c clients

Add a helper function for reading data blocks from i2c devices with 8 or 16 bit
address width and 8 bit register width.
This allows us to reduce the size of new code added by the following patches.
Works only for devices with activated register auto incrementation.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: add basic support for eeproms with 16 bit address width
Frank Schaefer [Sun, 3 Mar 2013 18:37:40 +0000 (15:37 -0300)]
[media] em28xx: add basic support for eeproms with 16 bit address width

Newer devices (em2874, em2884, em28174, em25xx, em27[6,7,8]x) use eeproms with
16 bit instead of 8 bit address width.
The used eeprom type depends on the chip type, which makes sure eeproms can't
be damaged.
This patch adds basic support for 16 bit eeproms only, which includes
- reading the content
- calculating the eeprom hash
- displaying the content
The eeprom content uses a different format, for which support will be added with
subsequent patches.
Tested with the "Hauppauge HVR-930C" and the "Speedlink VAD Laplace webcam"
(with additional experimental patches).

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: fix eeprom data endianess
Frank Schaefer [Sun, 3 Mar 2013 18:37:38 +0000 (15:37 -0300)]
[media] em28xx: fix eeprom data endianess

The data is stored as little endian in the eeprom.
Hence the correct data types should be used and the data should be converted
to the machine endianess before using it.
The eeprom id (key) also isn't a 32 bit value but 4 separate bytes instead.

[mchehab@redhat.com: Fix CodingStyle]
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: do not interpret eeprom content if eeprom key is invalid
Frank Schaefer [Sun, 3 Mar 2013 18:37:37 +0000 (15:37 -0300)]
[media] em28xx: do not interpret eeprom content if eeprom key is invalid

If the eeprom key isn't valid, either a different (currently unknown) format
is used or the eeprom is corrupted.
In both cases it doesn't make sense to interpret the data.
Also print an error message.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx-i2c: also print debug messages at debug level 1
Frank Schaefer [Sun, 3 Mar 2013 18:37:36 +0000 (15:37 -0300)]
[media] em28xx-i2c: also print debug messages at debug level 1

The current code uses only a single debug level and all debug messages are
printed for i2c_debug >= 2 only. So debug level 1 is actually the same as
level 0, which is odd.
Users expect debugging messages to become enabled for anything else than
debug level 0.
Fix it and simplify the code a bit by printing the debug messages also at debug
level 1;

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx-i2c: replace printk() with the corresponding em28xx macros
Frank Schaefer [Sun, 3 Mar 2013 18:37:34 +0000 (15:37 -0300)]
[media] em28xx-i2c: replace printk() with the corresponding em28xx macros

Reduces the number of characters/lines, unifies the code and improves readability.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx-i2c: get rid of the dprintk2 macro
Frank Schaefer [Sun, 3 Mar 2013 18:37:35 +0000 (15:37 -0300)]
[media] em28xx-i2c: get rid of the dprintk2 macro

There is only a single place where the dprintk2 macro is used, so get rid of it.

[mchehab@redhat.com: fix checkpathc.pl complain:
 ERROR: space prohibited before that close parenthesis ')']
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: bump driver version to 0.2.0
Frank Schaefer [Mon, 11 Feb 2013 17:07:55 +0000 (14:07 -0300)]
[media] em28xx: bump driver version to 0.2.0

The em28xx driver has changed much, especially since kernel 3.8.
So it's time to bump the driver version.
Changes since kernel 3.8:
- converted the driver to videobuf2
- converted the driver to the v4l2-ctrl framework
- added USB bulk transfer support
- use USB bulk transfers by default for webcams (allows streaming from multiple devices at the same time)
- added image quality bridge controls: contrast, brightness, saturation, blue balance, red balance, sharpness
- removed dependency from module ir-kbd-i2c
- cleaned up the frame data processing code
- removed some unused/obsolete code
- made remote controls of devices with external (i2c) receiver/decoder work again
- fixed audio over USB for device "Terratec Cinergy 250"
- several v4l2 compliance fixes and improvements (including fixes for ioctls enabling/disabling)
- lots of further bug fixes and code improvements

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: fix spacing and some comments in em28xx.h
Frank Schaefer [Mon, 11 Feb 2013 17:01:20 +0000 (14:01 -0300)]
[media] em28xx: fix spacing and some comments in em28xx.h

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: remove some obsolete function declarations
Frank Schaefer [Mon, 11 Feb 2013 16:54:01 +0000 (13:54 -0300)]
[media] em28xx: remove some obsolete function declarations

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: add image quality bridge controls
Frank Schaefer [Fri, 15 Feb 2013 17:38:32 +0000 (14:38 -0300)]
[media] em28xx: add image quality bridge controls

Add the image quality bridge controls contrast, brightness, saturation,
blue balance, red balance and sharpness.
These controls are enabled only if no subdevice provides them.
Tested with the following devices:
"Terratec Cinergy 200 USB"
"Hauppauge HVR-900"
"SilverCrest 1.3MPix webcam"
"Hauppauge WinTV USB2"
"Speedlink VAD Laplace webcam"

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: introduce #defines for the image quality default settings
Frank Schaefer [Fri, 15 Feb 2013 17:38:31 +0000 (14:38 -0300)]
[media] em28xx: introduce #defines for the image quality default settings

The image quality default values will be used in at least two different places
and by using #defines we make sure that they are always consistent.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: remove unused ac97 v4l2_ctrl_handler
Frank Schaefer [Fri, 15 Feb 2013 17:38:30 +0000 (14:38 -0300)]
[media] em28xx: remove unused ac97 v4l2_ctrl_handler

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: remove unused image quality control functions
Frank Schaefer [Fri, 15 Feb 2013 17:38:29 +0000 (14:38 -0300)]
[media] em28xx: remove unused image quality control functions

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: VIDIOC_ENUM_FRAMESIZES: consider the scaler limits when calculating...
Frank Schaefer [Sun, 10 Feb 2013 19:05:14 +0000 (16:05 -0300)]
[media] em28xx: VIDIOC_ENUM_FRAMESIZES: consider the scaler limits when calculating the minimum frame size

Output resolutions <=20% of the input resolution exceed the capabilities of the
scaler.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: add function scale_to_size()
Frank Schaefer [Sun, 10 Feb 2013 19:05:13 +0000 (16:05 -0300)]
[media] em28xx: add function scale_to_size()

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: rename function get_scale() to size_to_scale()
Frank Schaefer [Sun, 10 Feb 2013 19:05:12 +0000 (16:05 -0300)]
[media] em28xx: rename function get_scale() to size_to_scale()

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: introduce #define for maximum supported scaling values (register...
Frank Schaefer [Sun, 10 Feb 2013 19:05:11 +0000 (16:05 -0300)]
[media] em28xx: introduce #define for maximum supported scaling values (register 0x30-0x33)

The maximum supported scaling value for registers 0x30+0x31 (horizontal scaling)
and 0x32+0x33 (vertical scaling) is 0x3fff, which corresponds to 20% of the
input frame size.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: do not claim VBI support if the device is a camera
Frank Schaefer [Thu, 7 Feb 2013 16:39:21 +0000 (13:39 -0300)]
[media] em28xx: do not claim VBI support if the device is a camera

Avoids registering a VBI device and streaming in VBI-mode if the device is a
camera.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: make ioctl VIDIOC_DBG_G_CHIP_IDENT available for radio devices
Frank Schaefer [Thu, 7 Feb 2013 16:39:20 +0000 (13:39 -0300)]
[media] em28xx: make ioctl VIDIOC_DBG_G_CHIP_IDENT available for radio devices

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: make ioctl VIDIOC_DBG_G_CHIP_IDENT available without CONFIG_VIDEO_ADV...
Frank Schaefer [Thu, 7 Feb 2013 16:39:19 +0000 (13:39 -0300)]
[media] em28xx: make ioctl VIDIOC_DBG_G_CHIP_IDENT available without CONFIG_VIDEO_ADV_DEBUG selected

VIDIOC_DBG_G_CHIP_IDENT is a "normal" and not an "advanced" debug functionality.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: remove obsolete device state checks from the ioctl functions
Frank Schaefer [Thu, 7 Feb 2013 16:39:18 +0000 (13:39 -0300)]
[media] em28xx: remove obsolete device state checks from the ioctl functions

v4l2_device_disconnect() is called when the device is disconnected, so that the
v4l2-core rejects all ioctl calls.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: VIDIOC_G_TUNER: remove unneeded setting of tuner type
Frank Schaefer [Thu, 7 Feb 2013 16:39:17 +0000 (13:39 -0300)]
[media] em28xx: VIDIOC_G_TUNER: remove unneeded setting of tuner type

The tuner type is set by the v4l2-core based on the device type.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: get rid of duplicate function vidioc_s_fmt_vbi_cap()
Frank Schaefer [Thu, 7 Feb 2013 16:39:16 +0000 (13:39 -0300)]
[media] em28xx: get rid of duplicate function vidioc_s_fmt_vbi_cap()

vidioc_s_fmt_vbi_cap() is a 100% duplicate of vidioc_g_fmt_vbi_cap() and
therefore can be removed.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: remove ioctl VIDIOC_CROPCAP
Frank Schaefer [Thu, 7 Feb 2013 16:39:15 +0000 (13:39 -0300)]
[media] em28xx: remove ioctl VIDIOC_CROPCAP

The em28xx driver doesn't support the VIDIOC_G_CROP and VIDIOC_S_CROP ioctls,
so VIDIOC_CROPCAP is useless and has the potential to confuse applications,
because it can be interpreted as indicator for cropping support.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: make ioctls VIDIOC_G/S_PARM working for VBI devices
Frank Schaefer [Thu, 7 Feb 2013 16:39:14 +0000 (13:39 -0300)]
[media] em28xx: make ioctls VIDIOC_G/S_PARM working for VBI devices

With the current code V4L2_BUF_TYPE_VIDEO_CAPTURE is accepted only, but for VBI
devices only buffer type V4L2_BUF_TYPE_VBI_CAPTURE is used/valid.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: disable ioctl VIDIOC_S_PARM for VBI devices
Frank Schaefer [Thu, 7 Feb 2013 16:39:13 +0000 (13:39 -0300)]
[media] em28xx: disable ioctl VIDIOC_S_PARM for VBI devices

VIDIOC_S_PARM doesn't make sense for VBI device nodes, because we don't support
selecting the number of read buffers to use.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: use v4l2_disable_ioctl() to disable ioctl VIDIOC_S_PARM
Frank Schaefer [Thu, 7 Feb 2013 16:39:12 +0000 (13:39 -0300)]
[media] em28xx: use v4l2_disable_ioctl() to disable ioctl VIDIOC_S_PARM

Instead of checking the device type and returning -ENOTTY inside the ioctl
function, use v4l2_disable_ioctl() to disable the ioctl VIDIOC_S_PARM if the
device is not a camera.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: use v4l2_disable_ioctl() to disable ioctls VIDIOC_G_AUDIO and VIDIOC_...
Frank Schaefer [Thu, 7 Feb 2013 16:39:11 +0000 (13:39 -0300)]
[media] em28xx: use v4l2_disable_ioctl() to disable ioctls VIDIOC_G_AUDIO and VIDIOC_S_AUDIO

Instead of checking the device type and returning -EINVAL inside the ioctl
functions, use v4l2_disable_ioctl() to disable the ioctls VIDIOC_G_AUDIO and
VIDIOC_S_AUDIO if the device doesn't support audio.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: disable tuner related ioctls for video and VBI devices without tuner
Frank Schaefer [Thu, 7 Feb 2013 16:39:10 +0000 (13:39 -0300)]
[media] em28xx: disable tuner related ioctls for video and VBI devices without tuner

Disable the ioctls VIDIOC_G_TUNER, VIDIOC_S_TUNER, VIDIOC_G_FREQUENCY and
VIDIOC_S_FREQUENCY for video and VBI devices without tuner.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
11 years ago[media] em28xx: use v4l2_disable_ioctl() to disable ioctls VIDIOC_QUERYSTD, VIDIOC_G...
Frank Schaefer [Thu, 7 Feb 2013 16:39:09 +0000 (13:39 -0300)]
[media] em28xx: use v4l2_disable_ioctl() to disable ioctls VIDIOC_QUERYSTD, VIDIOC_G/S_STD

Instead of checking the device type and returning -ENOTTY inside the ioctl
functions, use v4l2_disable_ioctl() to disable the ioctls VIDIOC_QUERYSTD,
VIDIOC_G_STD and VIDIOC_S_STD if the device is a camera.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>