23 Feb, 2017

1 commit


09 Sep, 2016

1 commit


23 Jul, 2016

1 commit


21 Apr, 2016

1 commit

  • The v4l2_device_call_* defines filter subdevs based on the grp_id value.
    But some drivers use a bitmask, so instead of filtering by grp_id == value,
    you want to filter by grp_id & value.

    Make variants of these defines to do this.

    The 'has_op' define has been extended to have a grp_id argument as well, and
    a mask variant has been added.

    This extra argument required a change to go7007.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

03 Mar, 2015

1 commit


17 Apr, 2014

1 commit

  • The notify function is a void function, yet the v4l2_subdev_notify
    define uses it in a ? : construction, which causes sparse warnings.

    Replace the define by a static inline function and move it to
    v4l2-device.h, which is where it belongs since it needs to know the
    v4l2_device struct. This wasn't a problem when it was a define, but
    as a static inline function this no longer compiles in v4l2-subdev.h.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

24 Mar, 2013

1 commit

  • This patch adds a v4l2_subdev_has_op() macro and a v4l2_device_has_op macro to
    quickly check if a specific subdev or any subdev supports a particular subdev
    operation.
    This makes it easy for drivers to disable certain ioctls if none of the subdevs
    supports the necessary functionality.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

13 Apr, 2011

1 commit


23 Mar, 2011

2 commits

  • The video_device struct has proper ref counting and its release function
    will be called when the last user releases it. But no such support was
    available for struct v4l2_device. This made it hard to determine when a
    USB driver can release the device if it has multiple device nodes.

    With one device node it is easy of course, since when the device node is
    released, the whole device can be released.

    This patch adds refcounting to v4l2_device. When registering device nodes
    the v4l2_device refcount will be increased, when releasing device nodes
    it will be decreased. The (optional) release function will be called when
    the last device node was released.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Integrate the v4l2_prio_state into the core, ready for use.

    One struct v4l2_prio_state is added to v4l2_device and a pointer
    to a prio state is added to video_device.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

22 Mar, 2011

2 commits

  • The pointer will later be used to register/unregister media entities
    when registering/unregistering a v4l2_subdev or a video_device.

    With the introduction of media devices, device drivers need to store a
    pointer to a driver-specific structure in the device's drvdata.
    v4l2_device can't claim ownership of the drvdata anymore.

    To maintain compatibility with drivers that rely on v4l2_device storing
    a pointer to itself in the device's drvdata, v4l2_device_register() will
    keep doing so if the drvdata is NULL.

    Signed-off-by: Laurent Pinchart
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     
  • Create a device node named subdevX for every registered subdev.

    As the device node is registered before the subdev core::s_config
    function is called, return -EGAIN on open until initialization
    completes.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Vimarsh Zutshi
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Laurent Pinchart
     

02 Dec, 2010

1 commit

  • The BKL replacement mutex had some serious performance side-effects on
    V4L drivers. It is replaced by a better heuristic that works around the
    worst of the side-effects.

    Read the v4l2-dev.c comments for the whole sorry story. This is a
    temporary measure only until we can convert all v4l drivers to use
    unlocked_ioctl.

    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

21 Oct, 2010

1 commit


09 Aug, 2010

1 commit

  • Add a new framework to handle controls which makes life for driver
    developers much easier.

    Note that this patch moves some of the control support that used to be in
    v4l2-common.c to v4l2-ctrls.c. The tables were copied unchanged. The body
    of v4l2_ctrl_query_fill() was copied to a new v4l2_ctrl_fill() function
    in v4l2-ctrls.c. This new function doesn't use the v4l2_queryctrl
    struct anymore, which makes it more general.

    The remainder of v4l2-ctrls.c is all new. Highlights include:

    - No need to implement VIDIOC_QUERYCTRL, QUERYMENU, S_CTRL, G_CTRL,
    S_EXT_CTRLS, G_EXT_CTRLS or TRY_EXT_CTRLS in either bridge drivers
    or subdevs. New wrapper functions are provided that can just be plugged in.
    Once everything has been converted these wrapper functions can be removed as well.

    - When subdevices are added their controls can be automatically merged
    with the bridge driver's controls.

    - Most drivers just need to implement s_ctrl to set the controls.
    The framework handles the locking and tries to be as 'atomic' as possible.

    - Ready for the subdev device nodes: the same mechanism applies to subdevs
    and their device nodes as well. Sub-device drivers can make controls
    local, preventing them from being merged with bridge drivers.

    - Takes care of backwards compatibility handling of VIDIOC_S_CTRL and
    VIDIOC_G_CTRL. Handling of V4L2_CID_PRIVATE_BASE is fully transparent.
    CTRL_CLASS controls are automatically added.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

17 Jun, 2009

2 commits


30 Mar, 2009

3 commits


29 Jan, 2009

1 commit


03 Jan, 2009

1 commit


30 Dec, 2008

1 commit