22 Sep, 2016

2 commits

  • Currently we do not know what variant (bit length) of the nec protocol
    is used, other than from guessing from the length of the scancode. Now
    nec will be handled the same way as the sony protocol or the rc6 protocol;
    one variant per bit length.

    In the future we might want to expose the rc protocol type to userspace
    and we don't want to be introducing this world of pain into userspace
    too.

    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     
  • The hardware does not decode the 16, 20 or 24 bit variety.

    Signed-off-by: Sean Young
    Signed-off-by: Mauro Carvalho Chehab

    Sean Young
     

20 Sep, 2016

2 commits

  • Check for vb2_ops structures that are only stored in the ops field of a
    vb2_queue structure. That field is declared const, so vb2_ops structures
    that have this property can be declared as const also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct vb2_ops i@p = { ... };

    @ok@
    identifier r.i;
    struct vb2_queue e;
    position p;
    @@
    e.ops = &i@p;

    @bad@
    position p != {r.p,ok.p};
    identifier r.i;
    struct vb2_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct vb2_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Acked-by: Andrey Utkin
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall
     
  • Check for snd_pcm_ops structures that are only stored in the ops field of a
    snd_soc_platform_driver structure or passed as the third argument to
    snd_pcm_set_ops. The corresponding field or parameter is declared const,
    so snd_pcm_ops structures that have this property can be declared as const
    also.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable optional_qualifier@
    identifier i;
    position p;
    @@
    static struct snd_pcm_ops i@p = { ... };

    @ok1@
    identifier r.i;
    struct snd_soc_platform_driver e;
    position p;
    @@
    e.ops = &i@p;

    @ok2@
    identifier r.i;
    expression e1, e2;
    position p;
    @@
    snd_pcm_set_ops(e1, e2, &i@p)

    @bad@
    position p != {r.p,ok1.p,ok2.p};
    identifier r.i;
    struct snd_pcm_ops e;
    @@
    e@i@p

    @depends on !bad disable optional_qualifier@
    identifier r.i;
    @@
    static
    +const
    struct snd_pcm_ops i = { ... };
    //

    Signed-off-by: Julia Lawall
    Acked-by: Andrey Utkin
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Julia Lawall
     

12 Jul, 2016

1 commit


09 Jul, 2016

2 commits


10 Feb, 2016

1 commit


18 Dec, 2015

2 commits

  • Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer
    for common use, and change its type to u64 in order to handling
    y2038 problem. This patch also includes all device drivers' changes related to
    this restructuring.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • The queue_setup callback has a void pointer that is just for V4L2
    and is the pointer to the v4l2_format struct that was passed to
    VIDIOC_CREATE_BUFS. The idea was that drivers would use the information
    from that struct to buffers suitable for the requested format.

    After the vb2 split series this pointer is now a void pointer,
    which is ugly, and the reality is that all existing drivers will
    effectively just look at the sizeimage field of v4l2_format.

    To make this more generic the queue_setup callback is changed:
    the void pointer is dropped, instead if the *num_planes argument
    is 0, then use the current format size, if it is non-zero, then
    it contains the number of requested planes and the sizes array
    contains the requested sizes. If either is unsupported, then return
    -EINVAL, otherwise use the requested size(s).

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

    Hans Verkuil
     

24 Nov, 2015

1 commit

  • Linux 4.4-rc2

    Several PCI media drivers got broken on Kernel 4.4-rc1, due to
    pci_set_dma_mask() regressions. So, we need to add those fixes back
    for the media drivers to work again.

    * tag 'v4.4-rc2': (335 commits)
    Linux 4.4-rc2
    slab/slub: adjust kmem_cache_alloc_bulk API
    slub: add missing kmem cgroup support to kmem_cache_free_bulk
    slub: fix kmem cgroup bug in kmem_cache_alloc_bulk
    slub: optimize bulk slowpath free by detached freelist
    slub: support for bulk free with SLUB freelists
    parisc: Map kernel text and data on huge pages
    parisc: Add Huge Page and HUGETLBFS support
    parisc: Use long branch to do_syscall_trace_exit
    parisc: Increase initial kernel mapping to 32MB on 64bit kernel
    parisc: Initialize the fault vector earlier in the boot process.
    parisc: Add defines for Huge page support
    parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h
    serial: export fsl8250_handle_irq
    serial: 8250_mid: Add missing dependency
    tty: audit: Fix audit source
    serial: etraxfs-uart: Fix crash
    serial: fsl_lpuart: Fix earlycon support
    bcm63xx_uart: Use the device name when registering an interrupt
    tty: Fix direct use of tty buffer work
    ...

    Mauro Carvalho Chehab
     

21 Nov, 2015

1 commit

  • pci_set_dma_mask returns a negative errno value, not a bool like
    pci_dma_supported. This of course was just a giant test for attention :)

    Signed-off-by: Christoph Hellwig
    Reported-by: Jongman Heo
    Tested-by: Jongman Heo [pcnet32]
    Acked-by: Mauro Carvalho Chehab
    Cc: Hans Verkuil
    Cc: Antti Palosaari
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Nov, 2015

2 commits

  • Let's not mix headers used by the core with those headers that
    are needed by some driver-specific interface header.

    The headers used on drivers were manually moved using:
    mkdir include/media/drv-intf/
    git mv include/media/cx2341x.h include/media/cx25840.h \
    include/media/exynos-fimc.h include/media/msp3400.h \
    include/media/s3c_camif.h include/media/saa7146.h \
    include/media/saa7146_vv.h include/media/sh_mobile_ceu.h \
    include/media/sh_mobile_csi2.h include/media/sh_vou.h \
    include/media/si476x.h include/media/soc_mediabus.h \
    include/media/tea575x.h include/media/drv-intf/

    And the references for those headers were corrected using:

    MAIN_DIR="media/"
    PREV_DIR="media/"
    DIRS="drv-intf/"

    echo "Checking affected files" >&2
    for i in $DIRS; do
    for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
    n=`basename $j`
    git grep -l $n
    done
    done|sort|uniq >files && (
    echo "Handling files..." >&2;
    echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
    (
    cd include/$MAIN_DIR;
    for j in $DIRS; do
    for i in $(ls $j); do
    echo "perl -ne 's,(include [\\\"\\&2;
    echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
    (
    cd include/$MAIN_DIR;
    for j in $DIRS; do
    for i in $(ls $j); do
    echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
    done;
    done;
    echo "cat > a && mv a \$i; done"
    );
    ) >script && . ./script

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Arnd Bergmann

    Mauro Carvalho Chehab
     
  • Currently, include/media is messy, as it contains both the V4L2 core
    headers and some driver-specific headers on the same place. That makes
    harder to identify what core headers should be documented and what
    headers belong to I2C drivers that are included only by bridge/main
    drivers that would require the functions provided by them.

    Let's move those i2c specific files to its own subdirectory.

    The files to move were produced via the following script:
    mkdir include/media/i2c
    (cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
    (cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/*/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
    for i in include/media/*.h; do n=`basename $i`; (for j in $(git grep -l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep i2c list`" != "" ]; then git mv $i include/media/i2c; fi; fi; done

    And the references corrected via this script:
    MAIN_DIR="media/"
    PREV_DIR="media/"
    DIRS="i2c/"

    echo "Checking affected files" >&2
    for i in $DIRS; do
    for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do
    n=`basename $j`
    git grep -l $n
    done
    done|sort|uniq >files && (
    echo "Handling files..." >&2;
    echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\";
    (
    cd include/$MAIN_DIR;
    for j in $DIRS; do
    for i in $(ls $j); do
    echo "perl -ne 's,(include [\\\"\\&2;
    echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\";
    (
    cd include/$MAIN_DIR;
    for j in $DIRS; do
    for i in $(ls $j); do
    echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\";
    done;
    done;
    echo "cat > a && mv a \$i; done"
    );
    ) >script && . ./script

    Merged Sakari Ailus patch that moves smiapp.h to include/media/i2c.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Arnd Bergmann

    Mauro Carvalho Chehab
     

11 Nov, 2015

1 commit


21 Oct, 2015

1 commit

  • Replace struct v4l2_format * with void * to make queue_setup()
    for common use.
    And then, modify all device drivers related with this change.

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    [hans.verkuil@cisco.com: fix missing const in fimc-lite.c]

    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     

01 Oct, 2015

2 commits

  • Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer.

    Add new member variables - bytesused, length, offset, userptr, fd,
    data_offset - to struct vb2_plane in order to cover all information
    of v4l2_plane.
    struct vb2_plane {

    unsigned int bytesused;
    unsigned int length;
    union {
    unsigned int offset;
    unsigned long userptr;
    int fd;
    } m;
    unsigned int data_offset;
    }

    Replace v4l2_buf with new member variables - index, type, memory - which
    are common fields for buffer management.
    struct vb2_buffer {

    unsigned int index;
    unsigned int type;
    unsigned int memory;
    unsigned int num_planes;
    struct vb2_plane planes[VIDEO_MAX_PLANES];

    };

    v4l2 specific fields - flags, field, timestamp, timecode,
    sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c
    struct vb2_v4l2_buffer {
    struct vb2_buffer vb2_buf;

    __u32 flags;
    __u32 field;
    struct timeval timestamp;
    struct v4l2_timecode timecode;
    __u32 sequence;
    };

    Signed-off-by: Junghak Sung
    Signed-off-by: Geunyoung Kim
    Acked-by: Seung-Woo Kim
    Acked-by: Inki Dae
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Junghak Sung
     
  • Instead of manually initializing the bool array enable, use the
    SNDRV_DEFAULT_ENABLE_PNP macro. As most drivers do.

    Signed-off-by: Luis de Bethencourt
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Luis de Bethencourt
     

11 Jun, 2015

1 commit


10 Jun, 2015

1 commit

  • The DVB API was originally defined using typedefs. This is against
    Kernel CodingStyle, and there's no good usage here. While we can't
    remove its usage on userspace, we can avoid its usage in Kernelspace.

    So, let's do it.

    This patch was generated by this shell script:

    for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," a && mv a $i; done; done

    While here, make CodingStyle fixes on the affected lines.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Stefan Richter # for drivers/media/firewire/*

    Mauro Carvalho Chehab
     

01 May, 2015

1 commit

  • Fix three v4l2-compliance failures:

    - the colorspace wasn't set in vidioc_try_fmt_vid_cap().
    - the field wasn't set in v4l2_buffer when vb2_buffer_done() was called.
    - the sequence wasn't set in v4l2_buffer when vb2_buffer_done() was called.
    This fix also removes the unused buf->count field and starts the count
    at 0 instead of 1.

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

    Hans Verkuil
     

08 Apr, 2015

1 commit


03 Mar, 2015

1 commit

  • In case allocation vb2_dma_sg_init_ctx() fails during cx8802_probe(), the
    already allocated cx8802 device structure memory is not freed in the used
    exit path. Thus adapt the cleanup handling accordingly. Detected by Coverity
    CID 1260065.

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

    Christian Engelmayer
     

04 Feb, 2015

1 commit


23 Dec, 2014

2 commits


17 Dec, 2014

2 commits

  • The start_streaming op is responsible for starting the video dma,
    so it shouldn't be called anymore from the buf_queue op.

    Unfortunately, this call to start_video_dma() was added to the
    start_streaming op, but was forgotten to be removed from the
    buf_queue op, which is where it used to be before the vb2 conversion.

    Calling this function twice causes very hard to find errors: sometimes
    it works, sometimes it doesn't. It took me a whole friggin' day
    to track this down, and in the end it was just luck that my eye suddenly
    triggered on that line.

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

    Hans Verkuil
     
  • The cx88 vb2 conversion and the vb2 dma_sg improvements were developed separately and
    were merged separately. Unfortunately, the patch updating drivers to the dma_sg
    improvements didn't take the updated cx88 driver into account. Basically two ships
    passing in the night, unaware of one another even though both ships have the same
    owner, i.e. me :-)

    Signed-off-by: Hans Verkuil
    Reported-by: Chris Lee
    Signed-off-by: Mauro Carvalho Chehab

    Hans Verkuil
     

25 Nov, 2014

1 commit

  • Never use sg++, always use sg = sg_next(sg). Scatterlist entries can
    be combined if the memory is contiguous but sg++ won't know about that.

    As far as I can tell cx88 and ivtv are really broken because of this,
    and bttv and cx25821 are OK because vb1 doesn't combine scatterlist
    entries.

    But regardless, sg++ should never be used, only sg_next is safe.

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

    Hans Verkuil
     

15 Nov, 2014

1 commit


03 Nov, 2014

10 commits