26 May, 2014

3 commits


25 May, 2014

7 commits


24 May, 2014

2 commits

  • This event indicates that the video device has encountered
    a source parameter change during runtime. This can typically be a
    resolution change detected by a video decoder OR a format change
    detected by an input connector.

    This needs to be nofified to the userspace and the application may
    be expected to reallocate buffers before proceeding. The application
    can subscribe to events on a specific pad or input port which
    it is interested in.

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

    Arun Kumar K
     
  • All platforms supported by this driver are going to get device tree
    support in this kernel release so remove code that would have been
    actually not used any more.

    Signed-off-by: Sylwester Nawrocki
    Acked-by: Kyungmin Park
    Signed-off-by: Mauro Carvalho Chehab

    Sylwester Nawrocki
     

14 May, 2014

4 commits

  • While there was already a g_tvnorms_output video op, it's counterpart for
    video capture was missing. Add it.

    This is necessary for generic bridge drivers like soc-camera to set the
    video_device tvnorms field correctly. Otherwise ENUMSTD cannot work.

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

    Hans Verkuil
     
  • V4L2_MBUS_FRAME_DESC_FL_BLOB intends to say the receiver must use 1D DMA to
    receive the image, as the format does not have line offsets. This typically
    includes all compressed formats.

    Signed-off-by: Sakari Ailus
    Cc: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab

    Sakari Ailus
     
  • When the sub-device is registered, increment the use count of the sub-device
    owner only if it's different from the owner of the driver for the media
    device. This avoids increasing the use count by the module itself and thus
    making it possible to unload it when it's not in use.

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

    Sakari Ailus
     
  • mdev->fops->owner is actually the owner of the very same module which
    implements media_device_register(), so it can't be unloaded anyway. Instead,
    use THIS_MODULE through a macro as does video_register_device().

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

    Sakari Ailus
     

23 Apr, 2014

1 commit

  • The vb2 core ignores any return code from the stop_streaming op.
    And there really isn't anything it can do anyway in case of an error.
    So change the return type to void and update any drivers that implement it.

    The int return gave drivers the idea that this operation could actually
    fail, but that's really not the case.

    The pwc amd sdr-msi3101 drivers both had this construction:

    if (mutex_lock_interruptible(&s->v4l2_lock))
    return -ERESTARTSYS;

    This has been updated to just call mutex_lock(). The stop_streaming op
    expects this to really stop streaming and I very much doubt this will
    work reliably if stop_streaming just returns without really stopping the
    DMA.

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

    Hans Verkuil
     

17 Apr, 2014

6 commits

  • With the new vb2_thread_start/stop core code it is very easy to implement
    videobuf2-dvb. This should simplify converting existing videobuf drivers to
    vb2.

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

    Hans Verkuil
     
  • In order to implement vb2 DVB support you need to be able to start
    a kernel thread that queues and dequeues buffers, calling a callback
    function for every buffer. This patch adds support for that.

    It's based on drivers/media/v4l2-core/videobuf-dvb.c, but with all the DVB
    specific stuff stripped out, thus making it much more generic.

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

    Hans Verkuil
     
  • Added a vb2_fileio_is_active inline function that returns true if fileio
    is in progress. Check for this too in mmap() (you don't want apps mmap()ing
    buffers used by fileio) and expbuf() (same reason).

    In addition drivers should be able to check for this in queue_setup() to
    return an error if an attempt is made to read() or write() with
    V4L2_FIELD_ALTERNATE being configured. This is illegal (there is no way
    to pass the TOP/BOTTOM information around using file I/O).

    However, in order to be able to check for this the init_fileio function
    needs to set q->fileio early on, before the buffers are allocated. So switch
    to using internal functions (__reqbufs, vb2_internal_qbuf and
    vb2_internal_streamon) to skip the fileio check. Well, that's why the internal
    functions were created...

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

    Hans Verkuil
     
  • This patch migrates the vpfe driver to use v4l2_fh for
    priority handling.

    Signed-off-by: Lad, Prabhakar
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Lad, Prabhakar
     
  • This patch migrates the vpbe driver to use v4l2_fh for
    priority handling. This also fixes v4l2-compliance test.

    Signed-off-by: Lad, Prabhakar
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Lad, Prabhakar
     
  • 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
     

06 Apr, 2014

2 commits

  • The generic scancode filtering has questionable value and makes it
    impossible to determine from userspace if there is an actual
    scancode hw filter present or not.

    So revert the generic parts.

    Based on a patch from James Hogan , but this
    version also makes sure that only the valid sysfs files are created
    in the first place.

    Signed-off-by: David Härdeman
    Acked-by: James Hogan
    Signed-off-by: Mauro Carvalho Chehab

    David Härdeman
     
  • Overloading dev->s_filter to do two different functions (set wakeup filters
    and generic hardware filters) makes it impossible to tell what the
    hardware actually supports, so create a separate dev->s_wakeup_filter and
    make the distinction explicit.

    Signed-off-by: David Härdeman
    Acked-by: James Hogan
    Signed-off-by: Mauro Carvalho Chehab

    David Härdeman
     

05 Apr, 2014

1 commit

  • Pull media updates from Mauro Carvalho Chehab:
    "The main set of series of patches for media subsystem, including:
    - document RC sysfs class
    - added an API to setup scancode to allow waking up systems using the
    Remote Controller
    - add API for SDR devices. Drivers are still on staging
    - some API improvements for getting EDID data from media
    inputs/outputs
    - new DVB frontend driver for drx-j (ATSC)
    - one driver (it913x/it9137) got removed, in favor of an improvement
    on another driver (af9035)
    - added a skeleton V4L2 PCI driver at documentation
    - added a dual flash driver (lm3646)
    - added a new IR driver (img-ir)
    - added an IR scancode decoder for the Sharp protocol
    - some improvements at the usbtv driver, to allow its core to be
    reused.
    - added a new SDR driver (rtl2832u_sdr)
    - added a new tuner driver (msi001)
    - several improvements at em28xx driver to fix PM support, device
    removal and to split the V4L2 specific bits into a separate
    sub-driver
    - one driver got converted to videobuf2 (s2255drv)
    - the e4000 tuner driver now follows an improved binding model
    - some fixes at V4L2 compat32 code
    - several fixes and enhancements at videobuf2 code
    - some cleanups at V4L2 API documentation
    - usual driver enhancements, new board additions and misc fixups"

    [ NOTE! This merge effective drops commit 4329b93b283c ("of: Reduce
    indentation in of_graph_get_next_endpoint").

    The of_graph_get_next_endpoint() function was moved and renamed by
    commit fd9fdb78a9bf ("[media] of: move graph helpers from
    drivers/media/v4l2-core to drivers/of"). It was originally called
    v4l2_of_get_next_endpoint() and lived in the file
    drivers/media/v4l2-core/v4l2-of.c.

    In that original location, it was then fixed to support empty port
    nodes by commit b9db140c1e46 ("[media] v4l: of: Support empty port
    nodes"), and that commit clashes badly with the dropped "Reduce
    intendation" commit. I had to choose one or the other, and decided
    that the "Support empty port nodes" commit was more important ]

    * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (426 commits)
    [media] em28xx-dvb: fix PCTV 461e tuner I2C binding
    Revert "[media] em28xx-dvb: fix PCTV 461e tuner I2C binding"
    [media] em28xx: fix PCTV 290e LNA oops
    [media] em28xx-dvb: fix PCTV 461e tuner I2C binding
    [media] m88ds3103: fix bug on .set_tone()
    [media] saa7134: fix WARN_ON during resume
    [media] v4l2-dv-timings: add module name, description, license
    [media] videodev2.h: add parenthesis around macro arguments
    [media] saa6752hs: depends on CRC32
    [media] si4713: fix Kconfig dependencies
    [media] Sensoray 2255 uses videobuf2
    [media] adv7180: free an interrupt on failure paths in init_device()
    [media] e4000: make VIDEO_V4L2 dependency optional
    [media] af9033: Don't export functions for the hardware filter
    [media] af9035: use af9033 PID filters
    [media] af9033: implement PID filter
    [media] rtl2832_sdr: do not use dynamic stack allocation
    [media] e4000: fix 32-bit build error
    [media] em28xx-audio: make sure audio is unmuted on open()
    [media] DocBook media: v4l2_format_sdr was renamed to v4l2_sdr_format
    ...

    Linus Torvalds
     

13 Mar, 2014

1 commit


12 Mar, 2014

3 commits

  • Add a wakeup_protocols sysfs file which controls the new
    rc_dev::enabled_protocols[RC_FILTER_WAKEUP], which is the mask of
    protocols that are used for the wakeup filter.

    A new RC driver callback change_wakeup_protocol() is called to change
    the wakeup protocol mask.

    Signed-off-by: James Hogan
    Reviewed-by: Antti Seppälä
    Signed-off-by: Mauro Carvalho Chehab

    James Hogan
     
  • Only a single allowed and enabled protocol mask currently exists in
    struct rc_dev, however to support a separate wakeup filter protocol two
    of each are needed, ideally as an array.

    Therefore make both rc_dev::allowed_protos and rc_dev::enabled_protocols
    arrays, update all users to reference the first element
    (RC_FILTER_NORMAL), and add a couple more helper functions for drivers
    to use for setting the allowed and enabled wakeup protocols.

    We also rename allowed_protos to allowed_protocols while we're at it,
    which is more consistent with enabled_protocols.

    Signed-off-by: James Hogan
    Reviewed-by: Antti Seppälä
    Signed-off-by: Mauro Carvalho Chehab

    James Hogan
     
  • The allowed and enabled protocol masks need to be expanded to be per
    filter type in order to support wakeup filter protocol selection. To
    ease that process abstract access to the rc_dev::allowed_protos and
    rc_dev::enabled_protocols members with inline functions.

    Signed-off-by: James Hogan
    Reviewed-by: Antti Seppälä
    Signed-off-by: Mauro Carvalho Chehab

    James Hogan
     

11 Mar, 2014

8 commits

  • Support this ioctl as part of the v4l2 core. Use the new ioctl
    name and struct v4l2_edid type in the existing core code.

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

    Hans Verkuil
     
  • This patch adds the driver for the LM3646, dual LED Flash driver.
    The LM3646 has two 1.5A sync. boost converter with dual white current source.
    It is controlled via an I2C compatible interface.
    Each flash brightness, torch brightness and enable/disable can be controlled.
    Under voltage, input voltage monitor and thermal threshhold Faults are added.
    Please refer the datasheet http://www.ti.com/lit/ds/snvs962/snvs962.pdf

    Signed-off-by: Daniel Jeong
    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Daniel Jeong
     
  • In commit 02f142ecd24aaf891324ffba8527284c1731b561 support was added to
    start_streaming to return -ENOBUFS if insufficient buffers were queued
    for the DMA engine to start. The vb2 core would attempt calling
    start_streaming again if another buffer would be queued up.

    Later analysis uncovered problems with the queue management if start_streaming
    would return an error: the buffers are enqueued to the driver before the
    start_streaming op is called, so after an error they are never returned to
    the vb2 core. The solution for this is to let the driver return them to
    the vb2 core in case of an error while starting the DMA engine. However,
    in the case of -ENOBUFS that would be weird: it is not a real error, it
    just says that more buffers are needed. Requiring start_streaming to give
    them back only to have them requeued again the next time the application
    calls QBUF is inefficient.

    This patch changes this mechanism: it adds a 'min_buffers_needed' field
    to vb2_queue that drivers can set with the minimum number of buffers
    required to start the DMA engine. The start_streaming op is only called
    if enough buffers are queued. The -ENOBUFS handling has been dropped in
    favor of this new method.

    Drivers are expected to return buffers back to vb2 core with state QUEUED
    if start_streaming would return an error. The vb2 core checks for this
    and produces a warning if that didn't happen and it will forcefully
    reclaim such buffers to ensure that the internal vb2 core state remains
    consistent and all buffer-related resources have been correctly freed
    and all op calls have been balanced.

    __reqbufs() has been updated to check that at least min_buffers_needed
    buffers could be allocated. If fewer buffers were allocated then __reqbufs
    will free what was allocated and return -ENOMEM. Based on a suggestion from
    Pawel Osciak.

    __create_bufs() doesn't do that check, since the use of __create_bufs
    assumes some advance scenario where the user might want more control.
    Instead streamon will check if enough buffers were allocated to prevent
    streaming with fewer than the minimum required number of buffers.

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

    Hans Verkuil
     
  • 'queued_count' is a bit vague since it is not clear to which queue it
    refers to: the vb2 internal list of buffers or the driver-owned list
    of buffers.

    Rename to make it explicit.

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

    Hans Verkuil
     
  • Sometimes sentences in comments ended with a period, and sometimes they
    didn't. Add periods. No other changes.

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

    Hans Verkuil
     
  • If a queue was canceled, then the buf_finish op was never called for the
    pending buffers. So add this call to queue_cancel. Before calling buf_finish
    set the buffer state to PREPARED, which is the correct state. That way the
    states DONE and ERROR will only be seen in buf_finish if streaming is in
    progress.

    Since buf_finish can now be called from non-streaming state we need to
    adapt the handful of drivers that actually need to know this.

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

    Hans Verkuil
     
  • The buf_finish op should always work, so change the return type to void.
    Update the few drivers that use it.

    Signed-off-by: Hans Verkuil
    Acked-by: Pawel Osciak
    Reviewed-by: Pawel Osciak
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     
  • When a vb2_queue is freed check if all the mem_ops and queue ops were balanced.
    So the number of calls to e.g. buf_finish has to match the number of calls to
    buf_prepare, etc.

    This code is only enabled if CONFIG_VIDEO_ADV_DEBUG is set.

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

    Hans Verkuil
     

07 Mar, 2014

2 commits

  • This patch adds a new struct of_endpoint which is then embedded in struct
    v4l2_of_endpoint and contains the endpoint properties that are not V4L2
    (or even media) specific: the port number, endpoint id, local device tree
    node and remote endpoint phandle. of_graph_parse_endpoint parses those
    properties and is used by v4l2_of_parse_endpoint, which just adds the
    V4L2 MBUS information to the containing v4l2_of_endpoint structure.

    Signed-off-by: Philipp Zabel
    Acked-by: Tomi Valkeinen
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Sylwester Nawrocki

    Philipp Zabel
     
  • This patch moves the parsing helpers used to parse connected graphs
    in the device tree, like the video interface bindings documented in
    Documentation/devicetree/bindings/media/video-interfaces.txt, from
    drivers/media/v4l2-core/v4l2-of.c into drivers/of/base.c.

    This allows to reuse the same parser code from outside the V4L2
    framework, most importantly from display drivers.
    The functions v4l2_of_get_next_endpoint, v4l2_of_get_remote_port,
    and v4l2_of_get_remote_port_parent are moved. They are renamed to
    of_graph_get_next_endpoint, of_graph_get_remote_port, and
    of_graph_get_remote_port_parent, respectively.
    Since there are not that many current users yet, switch all of
    them to the new functions right away.

    Signed-off-by: Philipp Zabel
    Acked-by: Tomi Valkeinen
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Sylwester Nawrocki

    Philipp Zabel