20 Aug, 2017

1 commit


07 Jun, 2017

1 commit


28 Feb, 2017

1 commit


22 Sep, 2016

1 commit

  • As warned by linuxdoc[1] tool, using:

    $ for i in $(git grep kernel-doc Documentation/media/kapi/|cut -d: -f4); do kernel-lintdoc --sloppy $i; done

    include/media/v4l2-dev.h:118 :WARN: function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-mc.h:56 [kernel-doc WARN] : enum name from comment differs: if_vid_dec_index if_vid_dec_pad_index
    include/media/v4l2-mc.h:71 [kernel-doc WARN] : enum name from comment differs: if_aud_dec_index if_aud_dec_pad_index
    include/media/v4l2-mem2mem.h:396 [kernel-doc WARN] : function name from comment differs: v4l2_m2m_num_src_bufs_ready v4l2_m2m_num_dst_bufs_ready
    drivers/media/dvb-core/dvb_math.h:28 [kernel-doc WARN] : function name from comment differs: cintlog2 intlog2
    include/media/v4l2-subdev.h:215 [kernel-doc WARN] : struct name from comment differs: s_radio v4l2_subdev_tuner_ops
    include/media/v4l2-subdev.h:890 [kernel-doc WARN] : function name from comment differs: v4l2_set_subdevdata v4l2_set_subdev_hostdata
    include/media/v4l2-subdev.h:901 [kernel-doc WARN] : function name from comment differs: v4l2_get_subdevdata v4l2_get_subdev_hostdata
    drivers/media/dvb-core/dvb_ringbuffer.h:196 [kernel-doc WARN] : function name from comment differs: dvb_ringbuffer_writeuser dvb_ringbuffer_write_user
    include/media/videobuf2-core.h:399 [kernel-doc WARN] : struct name from comment differs: vb2_ops vb2_buf_ops
    include/media/media-entity.h:132 [kernel-doc ERROR] : duplicate parameter definition 'source'
    include/media/media-entity.h:477 [kernel-doc WARN] : function name from comment differs: media_entity_enum_test media_entity_enum_test_and_set
    include/media/media-entity.h:535 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_pad
    include/media/media-entity.h:544 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_link
    include/media/media-entity.h:553 [kernel-doc WARN] : function name from comment differs: gobj_to_entity gobj_to_intf
    include/media/media-entity.h:562 [kernel-doc WARN] : function name from comment differs: gobj_to_entity intf_to_devnode
    include/media/rc-core.h:234 [kernel-doc WARN] : function name from comment differs: rc_open rc_close
    include/media/v4l2-ctrls.h:397 [kernel-doc WARN] : missing initial short description of 'v4l2_ctrl_handler_init'
    include/media/v4l2-dev.h:118 [kernel-doc WARN] : function name from comment differs: v4l2_prio_close v4l2_prio_check
    include/media/v4l2-event.h:225 [kernel-doc WARN] : missing initial short description of 'v4l2_src_change_event_subscribe'

    [1] https://return42.github.io/linuxdoc/linux.html

    The above are real issues at the documentation. On several cases,
    caused by cut-and-paste.

    Fix them.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

09 Sep, 2016

3 commits


23 Jul, 2016

2 commits


12 Jul, 2016

1 commit


28 Jun, 2016

1 commit

  • The comments for the unlocked v4l2_ctrl_s_ctrl* functions were wrong (copy
    and pasted from the locked variants). Fix this, since it is confusing.

    Acked-by: Sakari Ailus
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

10 Feb, 2016

1 commit

  • v4l2_ctrl_add_ctrl() interface has no users since its introduction in
    commit 0996517cf8ea ("V4L/DVB: v4l2: Add new control handling framework")
    and its functionality is covered by v4l2_ctrl_new() and derivative
    interfaces, so it is safe to remove the interface from the kernel.

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

    Vladimir Zapolskiy
     

22 Aug, 2015

3 commits

  • Warning(.//include/media/v4l2-ctrls.h:217): No description found for parameter 'p_new'
    Warning(.//include/media/v4l2-ctrls.h:217): No description found for parameter 'p_cur'
    Warning(.//include/media/v4l2-ctrls.h:217): Excess struct/union/enum/typedef member 'val64' description in 'v4l2_ctrl'
    Warning(.//include/media/v4l2-ctrls.h:314): No description found for parameter 'qmenu_int'

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Jonathan Corbet

    Mauro Carvalho Chehab
     
  • This is an obsolete function that has several missing
    arguments:
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'id'
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'name'
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'type'
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'min'
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'max'
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'step'
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'def'
    Warning(.//include/media/v4l2-ctrls.h:340): No description found for parameter 'flags'

    However, this is an obsolete function that should be
    removed soon. And are not meant to be used anymore. So,
    instead of documenting those stuff, let's just make
    DocBook to not handle it, by replacing "/**" by "/*".

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Jonathan Corbet

    Mauro Carvalho Chehab
     
  • The comments there are using a wrong format. Due to that,
    DocBook were unable to parse it.

    Fix the tags format, and add it to device-drivers.xml.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Jonathan Corbet

    Mauro Carvalho Chehab
     

25 Nov, 2014

1 commit


26 Jul, 2014

2 commits

  • The si4713 supports several RDS features not yet implemented in the driver.

    This patch adds the missing RDS functionality to the list of RDS controls.

    The ALT_FREQS control is a compound control containing an array of up
    to 25 (the maximum according to the RDS standard) frequencies. To support
    that the V4L2_CTRL_TYPE_U32 was added.

    Signed-off-by: Hans Verkuil
    Cc: Eduardo Valentin
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Rather than always having to use a v4l2_ext_control struct to set
    a control value from within a driver, switch to just setting the
    new value. This is faster and it makes it possible to set more
    complex types such as a string control as is added by this
    patch.

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

    Hans Verkuil
     

22 Jul, 2014

3 commits


17 Jul, 2014

8 commits

  • These are needed by the upcoming patches for the motion detection
    matrices.

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

    Hans Verkuil
     
  • Add core support for N-dimensional arrays.

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

    Hans Verkuil
     
  • Add dims, nr_of_dims and elems fields to the core control structures in preparation
    for N-dimensional array support.

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

    Hans Verkuil
     
  • Rather than having two unions for all types just keep 'val' and
    'cur.val' and use the p_cur and p_new unions to access all others.

    The only reason for keeping 'val' and 'cur.val' is that it is used
    all over, so converting this as well would be a huge job.

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

    Hans Verkuil
     
  • When setting a control the control's new value is compared to the current
    value twice: once by new_to_cur(), once by cluster_changed(). Not a big
    deal when dealing with simple values, but it can be a problem when dealing
    with compound types or arrays. So fix this: cluster_changed() sets the
    has_changed flag, which is used by new_to_cur() instead of having to do
    another compare.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • Since compound controls can have non-standard types we need to be able to do
    type-specific checks etc. In order to make that easy type operations are added.
    There are four operations:

    - equal: check if two values are equal
    - init: initialize a value
    - log: log the value
    - validate: validate a new value

    The v4l2_ctrl struct adds p_new and p_cur unions at the end of the struct.
    This union provides a standard way of accessing control types through a pointer,
    which greatly simplifies internal control processing.

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

    Hans Verkuil
     
  • This patch implements initial support for compound types.

    The changes are fairly obvious: basic support for is_ptr types, the
    type_is_int function is replaced by a is_int bitfield, and
    v4l2_query_ext_ctrl is added.

    Note that this patch does not yet add support for N-dimensional
    arrays, that comes later. So v4l2_query_ext_ctrl just sets elems to
    1 and nr_of_dims and dims[] are all zero.

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

    Hans Verkuil
     
  • While VIDIOC_QUERYCTRL is limited to 32 bit min/max/step/def values
    for controls, the upcoming VIDIOC_QUERY_EXT_CTRL isn't. So increase
    the internal representation to 64 bits in preparation.

    Because of these changes the msi3101 driver has been modified slightly
    to fix a formatting issue (%d becomes %lld), vivi had to be modified
    as well to cope with the new 64-bit min/max values and the PIXEL_RATE
    control in a few sensor drivers required proper min/max/def values.

    Signed-off-by: Hans Verkuil
    Reviewed-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

17 Oct, 2013

1 commit


03 Sep, 2013

1 commit

  • This patch fixes following error:
    include/media/v4l2-ctrls.h:193:15: error: field ‘_lock’ has incomplete type
    include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_lock’:
    include/media/v4l2-ctrls.h:570:2: error: implicit declaration of
    function ‘mutex_lock’ [-Werror=implicit-function-declaration]
    include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_unlock’:
    include/media/v4l2-ctrls.h:579:2: error: implicit declaration of
    function ‘mutex_unlock’ [-Werror=implicit-function-declaration]

    Signed-off-by: Andrzej Hajda
    Signed-off-by: Kyungmin Park
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Cc: stable@vger.kernel.org

    Andrzej Hajda
     

24 Mar, 2013

1 commit

  • When calling v4l2_ctrl_add_handler(), lockdep would detect a potential
    recursive locking problem on a situation that is by design intended and
    not a recursive lock. This happened because all struct
    v4l2_ctrl_handler.lock mutexes were created as members of the same lock
    class in v4l2_ctrl_handler_init(), and v4l2_ctrl_add_handler() takes the
    hdl->lock on two different v4l2_ctrl_handler instances.
    This change breaks the large lockdep lock class for struct
    v4l2_ctrl_handler.lock and breaks it into v4l2_ctrl_handler
    instantiation specific lock classes with meaningful class names.
    This will validly eliminate lockdep alarms for v4l2_ctrl_handler locking
    validation, as long as the relationships between drivers adding v4l2
    controls to their own handler from other v4l2 drivers' control handlers
    remains straightforward.
    struct v4l2_ctrl_handler.lock lock classes are created with names such
    that the output of cat /proc/lockdep indicates where in the v4l2 driver
    code v4l2_ctrl_handle_init() is being called on instantiations:
    ffffffffa045f490 FD: 10 BD: 8 +.+...: cx2341x:1534:(hdl)->lock
    ffffffffa0497d20 FD: 12 BD: 2 +.+.+.: saa7115:1581:(hdl)->lock
    ffffffffa04ac660 FD: 14 BD: 2 +.+.+.: msp3400_driver:756:(hdl)->lock
    ffffffffa0484b90 FD: 12 BD: 1 +.+.+.: ivtv_gpio:366:(&itv->hdl_gpio)->lock
    ffffffffa04eb530 FD: 11 BD: 2 +.+.+.: cx25840_core:1982:(&state->hdl)->lock
    ffffffffa04fbc80 FD: 11 BD: 3 +.+.+.: wm8775:246:(&state->hdl)->lock
    Some lock chains, that were previously causing the recursion alarms, are
    now visible in the output of cat /proc/lockdep_chains:
    irq_context: 0
    [ffffffffa0497d20] saa7115:1581:(hdl)->lock
    [ffffffffa045f490] cx2341x:1534:(hdl)->lock
    irq_context: 0
    [ffffffffa04ac660] msp3400_driver:756:(hdl)->lock
    [ffffffffa045f490] cx2341x:1534:(hdl)->lock
    irq_context: 0
    [ffffffffa0484b90] ivtv_gpio:366:(&itv->hdl_gpio)->lock
    [ffffffffa045f490] cx2341x:1534:(hdl)->lock
    irq_context: 0
    [ffffffffa04eb530] cx25840_core:1982:(&state->hdl)->lock
    [ffffffffa045f490] cx2341x:1534:(hdl)->lock
    irq_context: 0
    [ffffffffa04fbc80] wm8775:246:(&state->hdl)->lock
    [ffffffffa045f490] cx2341x:1534:(hdl)->lock

    Signed-off-by: Andy Walls
    [hans.verkuil@cisco.com: keep mutex_init in v4l2_ctrl_handler_init_class]
    Signed-off-by: Hans Verkuil

    Signed-off-by: Mauro Carvalho Chehab

    Andy Walls
     

06 Feb, 2013

3 commits

  • This patch adds a v4l2 core helper function that can be used as
    the log_status handler for subdevs that only need to log state
    of the v4l2 controls owned by the subdev's control handler.

    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Sylwester Nawrocki
     
  • Add a v4l2 core helper function that can be used as the subdev
    .subscribe_event handler. This allows to eliminate some boilerplate
    from drivers that are only handling the control events.

    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Sylwester Nawrocki
     
  • This patch adds a helper function that allows to modify range,
    i.e. minimum, maximum, step and default value of a v4l2 control,
    after the control has been created and initialized. This is helpful
    in situations when range of a control depends on user configurable
    parameters, e.g. camera sensor absolute exposure time depending on
    an output image resolution and frame rate.
    v4l2_ctrl_modify_range() function allows to modify range of an
    INTEGER, BOOL, MENU, INTEGER_MENU and BITMASK type controls.
    Based on a patch from Hans Verkuil http://patchwork.linuxtv.org/patch/8654.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Sylwester Nawrocki
     

05 Jan, 2013

1 commit

  • Sometimes platform/bridge drivers need to be notified when a control from
    a sub-device changes value. In order to support this a notify callback was
    added.
    [dheitmueller@kernellabs.com: fix merge conflict in v4l2-ctrls.c]

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

    Hans Verkuil
     

06 Oct, 2012

1 commit


02 Oct, 2012

1 commit


26 Sep, 2012

1 commit


14 Sep, 2012

1 commit

  • These helper functions get and set a 64-bit control's value from within
    a driver. They are similar to v4l2_ctrl_[gs]_ctrl() but operate on
    64-bit integer controls instead of 32-bit controls.

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

    Laurent Pinchart