History log of /drivers/media/usb/cx231xx/cx231xx-video.c
Revision Date Author Comments
d52e23813672c3c72f92e7b39c7408d4b9a40a96 27-May-2014 Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> [media] v4l: Support extending the v4l2_pix_format structure

The v4l2_pix_format structure has no reserved field. It is embedded in
the v4l2_framebuffer structure which has no reserved fields either, and
in the v4l2_format structure which has reserved fields that were not
previously required to be zeroed out by applications.

To allow extending v4l2_pix_format, inline it in the v4l2_framebuffer
structure, and use the priv field as a magic value to indicate that the
application has set all v4l2_pix_format extended fields and zeroed all
reserved fields following the v4l2_pix_format field in the v4l2_format
structure.

The availability of this API extension is reported to userspace through
the new V4L2_CAP_EXT_PIX_FORMAT capability flag. Just checking that the
priv field is still set to the magic value at [GS]_FMT return wouldn't
be enough, as older kernels don't zero the priv field on return.

To simplify the internal API towards drivers zero the extended fields
and set the priv field to the magic value for applications not aware of
the extensions.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
95cd5d5ee67c2108765ae87d34761d54fd6671ce 19-Jun-2014 Ramakrishnan Muthukrishnan <ramakrmu@cisco.com> [media] media: remove the setting of the flag V4L2_FL_USE_FH_PRIO

Since all the drivers that use `struct v4l2_fh' use the core
priority checking, the setting of the flag in the drivers can
be removed.

Signed-off-by: Ramakrishnan Muthukrishnan <ramakrmu@cisco.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
4df16f702c38221f611006bda45377278b2ec325 31-May-2014 Peter Senna Tschudin <peter.senna@gmail.com> [media] drivers/media: Remove useless return variables

This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
8774bed9ce832d8d9ccb79e92800b808aa2d2ad2 28-Apr-2014 Laurent Pinchart <laurent.pinchart@ideasonboard.com> [media] v4l: subdev: Move [gs]_std operation to video ops

The g_std and s_std operations are video-related, move them to the video
ops where they belong.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
04ae4cf2cb0c5963b0ea6554f573705c37172313 29-May-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] cx231xx: the reg->size field wasn't filled in

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
08fe9f7ddf31b8c42dd1a689b0a2c1501f10b58c 29-May-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] cx231xx: remove g_chip_ident

Remove g_chip_ident and replace it with g_chip_info.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
977ba3b1b73f24fae2d0c8bd59d7a4696f1e0ccc 24-Mar-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2: add const to argument of write-only s_register ioctl

This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
314527acbbb3f33f72c2ef19d8cfabcada9912a5 15-Mar-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2: pass std by value to the write-only s_std ioctl

This ioctl is defined as IOW, so pass the argument by value instead of by
reference. I could have chosen to add const instead, but this is 1) easier
to handle in drivers and 2) consistent with the s_std subdev operation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2f73c7c582a685b3198b974cd6d964d0338f8ab5 15-Mar-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2: add const to argument of write-only s_tuner ioctl

This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
b530a447bb588fdf43fdf4eb909e4ee1921d47ac 19-Mar-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2: add const to argument of write-only s_frequency ioctl

This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9bb05696af3f808c3ad684c9fcf4b870ddbff804 07-Mar-2013 Gianluca Gennari <gennarone@gmail.com> [media] cx231xx: fix undefined function cx231xx_g_chip_ident()

This patch:
http://git.linuxtv.org/media_tree.git/commit/b86d15440b683f8634c0cb26fc0861a5bc4913ac
is missing a chunk when compared to an older version:
https://patchwork.kernel.org/patch/2063281/
probably because of an unresolved merging conflict.
This causes the following error:
WARNING: "cx231xx_g_chip_ident" [/home/jena/media_build/v4l/cx231xx.ko] undefined!

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
720b3dfad42af96e3c937df8e167aac6c2901295 08-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] cx231xx: don't reset width/height on first open

The last set width/height must be preserved as per the spec.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
b86d15440b683f8634c0cb26fc0861a5bc4913ac 29-Jan-2013 Hans Verkuil <hans.verkuil@cisco.com> [media] cx231xx-417: share ioctls with cx231xx-video

Share tuner, frequency, debug and input ioctls with cx231xx-video.
These are all shared resources, so no need to implement them again.

[mchehab@redhat.com: Fix merge conflict and a checkpatch issue]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
bc08734c825b710ffab93f79ca1ca2d0265dd321 29-Jan-2013 Hans Verkuil <hans.verkuil@cisco.com> [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>
d61072a4975d0be5f0a858fba8d0304800b43fbf 29-Jan-2013 Hans Verkuil <hans.verkuil@cisco.com> [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>
71590765b81bdc22562fb54e1def0f78d9be8909 28-Jan-2013 Hans Verkuil <hans.verkuil@cisco.com> [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>
1265f080d8f04ffe074bdf948bbec4cb9c420ee0 17-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
a25a7012ba65ef41fba809c605c4f7d0dc609a23 17-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
1d08a4fa75ad165ed06c12b48477c39741ac68e4 17-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
d2370f8eee263a0a0260b9df9798f242d4cb13bf 17-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
6264722c1212e5455bfdb58cca4377161cf97d23 09-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com> [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>
0752d98e1a5619553d46a67590cdd94ee5827ff3 09-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com> [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>
8b735c130717cb0af7793e30bbb6e91709ef10f8 09-Feb-2013 Hans Verkuil <hans.verkuil@cisco.com> [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>
b251f95767e1b13b9b32b207b53f5be1c491899e 13-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
06c46003f7077cce7f87a75d327635e45c6d2b64 13-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
530e01e782c97076c58b6e474d31cc61caa4a9dd 29-Jan-2013 Hans Verkuil <hans.verkuil@cisco.com> [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>
fddd14c8f6ca2bb9bfdad1874c172002bc537527 13-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
4bc837d414c36676499220065143743d720bf40f 13-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [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>
f62436a96a0678a4e8bc54e7b987be72977af9ce 11-Jan-2013 Dan Carpenter <dan.carpenter@oracle.com> [media] cx231xx: add a missing break statement

My static checker complains about the fall through here. From the
context it looks like we should add a break statement.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
3724dde9c8c9f55c31ce8c7f8f2645733d6a59ac 23-Oct-2012 Ezequiel Garcia <elezegarcia@gmail.com> [media] cx231xx: Replace memcpy with struct assignment

This kind of memcpy() is error-prone. Its replacement with a struct
assignment is prefered because it's type-safe and much easier to read.
Found by coccinelle. Hand patched and reviewed.
Tested by compilation only.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier struct_name;
struct struct_name to;
struct struct_name from;
expression E;
@@
-memcpy(&(to), &(from), E);
+to = from;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
8e6057b510aad354e017c6dfca7f386a0eb91b63 15-Sep-2012 Sakari Ailus <sakari.ailus@iki.fi> [media] v4l: Convert drivers to use monotonic timestamps

Convert drivers using wall clock time (CLOCK_REALTIME) to timestamp from the
monotonic timer (CLOCK_MONOTONIC).

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
0e8025b9f6011a6bd69d01080d584bc95a89d02e 04-Sep-2012 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2: make vidioc_s_audio const

Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_s_audio.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
0c0d06cac63ee327ceaab4b5ffe2206574ab86bd 14-Aug-2012 Mauro Carvalho Chehab <mchehab@redhat.com> [media] rename most media/video usb drivers to media/usb

Rename all USB drivers with their own directory under
drivers/media/video into drivers/media/usb and update the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>