Commit graph

573535 commits

Author SHA1 Message Date
Laurent Pinchart 8aeec38f9c [media] v4l: Merge the YUV and YVU 4:2:0 tri-planar non-contiguous formats docs
The two formats are very similar, having two separate pages to describe
them is overkill.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:49:35 -02:00
Simon Horman 417b552331 [media] rcar_jpu: Add R-Car Gen2 Fallback Compatibility String
Add fallback compatibility string.
This is in keeping with the fallback scheme being adopted wherever
appropriate for drivers for Renesas SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:48:19 -02:00
Christophe JAILLET df47512d59 [media] netup_unidvb: Remove a useless memset
This memory is allocated using kzalloc so there is no need to call
memset(..., 0, ...)

[mchehab@osg.samsung.com: as suggested by Joe Perches,
 It's unusual to not see the alloc above the if, removed a
 blank line between kzalloc/if and added a blank line after if]
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:45:31 -02:00
Ernst Martin Witte 41ff9142df [media] ts2020: cancel_delayed_work_sync before device removal / kfree
ts2020_remove  was  calling  kfree(dev)  with  possibly  still  active
schedule_delayed_work(dev->stat_work).  A similar bug in si2157 caused
kernel panics in call_timer_fn e.g. after rmmod cx23885.

Signed-off-by: Ernst Martin Witte <emw-linux-kernel@nocabal.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:42:30 -02:00
Ernst Martin Witte 4fd57ed615 [media] rtl2830: cancel_delayed_work_sync before device removal / kfree
rtl2830_remove  was  calling  kfree(dev) with  possibly  still  active
schedule_delayed_work(&dev->stat_work).   A  similar   bug  in  si2157
caused kernel panics in call_timer_fn e.g. after rmmod cx23885.

Signed-off-by: Ernst Martin Witte <emw-linux-kernel@nocabal.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:42:03 -02:00
Ernst Martin Witte 01d1d714e2 [media] si2157: cancel_delayed_work_sync before device removal / kfree
si2157_remove  was  calling  kfree(dev)  with  possibly  still  active
schedule_delayed_work(dev->stat_work).  This  caused kernel  panics in
call_timer_fn e.g. after rmmod cx23885.

Signed-off-by: Ernst Martin Witte <emw-linux-kernel@nocabal.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:41:38 -02:00
Ernst Martin Witte 4bdcaa054e [media] af9033: cancel_delayed_work_sync before device removal / kfree
af9033_remove  was  calling  kfree(dev)  with  possibly  still  active
schedule_delayed_work(&dev->stat_work).   A  similar   bug  in  si2157
caused kernel panics in call_timer_fn e.g. after rmmod cx23885.

Signed-off-by: Ernst Martin Witte <emw-linux-kernel@nocabal.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:40:56 -02:00
Ernst Martin Witte 631c694f7d [media] af9013: cancel_delayed_work_sync before device removal / kfree
af9013_remove  was calling  kfree(state)  with  possibly still  active
schedule_delayed_work(&state->statistics_work).   A   similar  bug  in
si2157 caused kernel panics in call_timer_fn e.g. after rmmod cx23885.

Signed-off-by: Ernst Martin Witte <emw-linux-kernel@nocabal.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:40:18 -02:00
Antti Palosaari 4c7cad4bbf [media] rtl28xxu: retry failed i2c messages
Sometimes i2c transfer fails. That happens especially when large
amount of data is written sequentially eg. firmware download.
Problem arises with both integrated rtl2832 demod and external
mn88472 demod, which is clear indicator it is busy i2c bus issue.
Use i2c core retry logic in order fix the issue by repeating failed
message. Another solution which also works is to add ~100us delay
between i2c messages - but repeating sounds more elegant and does
not cause any extra delay for success cases.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:20:24 -02:00
Torbjörn Jansson d309c8bb70 [media] dvb-usb-dvbsky: add new product id for TT CT2-4650 CI
Add a new product id to dvb-usb-dvbsky for new version of TechnoTrend CT2-4650 CI

Signed-off-by: Torbjörn Jansson <torbjorn.jansson@mbox200.swipnet.se>
Reviewed-by: Olli Salonen <olli.salonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:06:10 -02:00
Stefan Pöschel b8278f8b96 [media] af9035: add support for 2nd tuner of MSI DigiVox Diversity
PIP tested with VLC. Diversity tested with the Windows driver.

Signed-off-by: Stefan Pöschel <basic.master@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:04:06 -02:00
Philipp Zabel 93b66420a4 [media] dw2102: Add support for Terratec Cinergy S2 USB BOX
The Terratec Cinergy S2 USB BOX uses a Montage M88TS2022 tuner
and a M88DS3103 demodulator, same as Technotrend TT-connect S2-4600.
This patch adds the missing USB Product ID to make it work.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:01:34 -02:00
Andrei Koshkosh 9398ddfe4e [media] si2157.c: fix frequency range
According with:
	https://www.silabs.com/Support%20Documents/TechnicalDocs/Si2157-short.pdf

The RF input frequency range of this demod is from 42MHz to 870 MHz.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 09:00:21 -02:00
Heiner Kallweit e60c1e87c7 [media] media: rc: nuvoton-cir: improve locking in both interrupt handlers
Extend the locking to protect more critical actions like register accesses
in the interrupt handlers.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:53:51 -02:00
Heiner Kallweit d42fd29769 [media] media: rc: nuvoton-cir: fix interrupt handling
Only handle an interrupt if at least one combination of event bit
and related interrupt bit is set.
Previously it was just checked that at least one event bit and
at least one interrupt bit are set.

This fixes issues like the following which was caused by
interrupt sharing:
An interrupt intended for nvt_cir_isr was handled by nvt_cir_wake_isr
first and because status bit CIR_WAKE_IRSTS_IR_PENDING was set
the wake fifo was accidently cleared.

This patch also fixes the bug that nvt_cir_wake_isr returned IRQ_HANDLED
even if it detected that the (shared) interrupt was meant for another
handler.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:51:33 -02:00
Heiner Kallweit 88205f01fe [media] media: rc: nuvoton-cir: fix wakeup interrupt bits
Most likely a copy & paste error.
The wakeup interrupt supports less triggering events.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:50:47 -02:00
Heiner Kallweit fb2b006575 [media] media: rc: nuvoton-cir: add locking to calls of nvt_enable_wake
Add locking to nvt_enable_wake calls.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:49:55 -02:00
Heiner Kallweit 3f1321cbaa [media] media: rc: nuvoton-cir: improve nvt_hw_detect
Check for the case that no Nuvoton chip is found on either EFM port.
Also move the position of nvt_efm_disable to reduce the time the
EFM ports are locked.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:49:09 -02:00
Sakari Ailus 80100fd9eb [media] media: v4l: Dual license v4l2-common.h under GPL v2 and BSD licenses
The v4l2-common.h user space header was split off from videodev2.h, but
the dual licensing of the videodev2.h (as well as other V4L2 headers) was
missed. Change the license of the v4l2-common.h from GNU GPL v2 to both
GNU GPL v2 and BSD.

Sakari Ailus <sakari.ailus@iki.fi>:
> Would you approve a license change of the patches to
> include/uapi/linux/v4l2-common.h (formerly include/linux/v4l2-common.h) you
> or your company have contributed from GNU GPL v2 to dual GNU GPL v2 and BSD
> licenses, changing the copyright notice in the file as below (from
> videodev2.h):
>
> -------------8<------------
>   *  This program is free software; you can redistribute it and/or modify
>   *  it under the terms of the GNU General Public License as published by
>   *  the Free Software Foundation; either version 2 of the License, or
>   *  (at your option) any later version.
>   *
>   *  This program is distributed in the hope that it will be useful,
>   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
>   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>   *  GNU General Public License for more details.
>   *
>   *  Alternatively you can redistribute this file under the terms of the
>   *  BSD license as stated below:
>   *
>   *  Redistribution and use in source and binary forms, with or without
>   *  modification, are permitted provided that the following conditions
>   *  are met:
>   *  1. Redistributions of source code must retain the above copyright
>   *     notice, this list of conditions and the following disclaimer.
>   *  2. Redistributions in binary form must reproduce the above copyright
>   *     notice, this list of conditions and the following disclaimer in
>   *     the documentation and/or other materials provided with the
>   *     distribution.
>   *  3. The names of its contributors may not be used to endorse or promote
>   *     products derived from this software without specific prior written
>   *     permission.
>   *
>   *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>   *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>   *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
>   *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
>   *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
>   *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
>   *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
>   *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
>   *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
>   *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
>   *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> -------------8<------------

Mauro Carvalho Chehab <mchehab@osg.samsung.com>:
> No problem from my side.

Hans Verkuil <hans.verkuil@cisco.com>:
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Aaro Koskinen <aaro.koskinen@nokia.com>:
> This fine also for us.
>
> Acked-by: Aaro Koskinen <aaro.koskinen@nokia.com>

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Acked-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:47:05 -02:00
Benoit Parrot 343e89a792 [media] media: ti-vpe: Add CAL v4l2 camera capture driver
The Camera Adaptation Layer (CAL) is a block which consists of a dual
port CSI2/MIPI camera capture engine.
Port #0 can handle CSI2 camera connected to up to 4 data lanes.
Port #1 can handle CSI2 camera connected to up to 2 data lanes.
The driver implements the required API/ioctls to be V4L2 compliant.
Driver supports the following:
    - V4L2 API using DMABUF/MMAP buffer access based on videobuf2 api
    - Asynchronous sensor sub device registration
    - DT support

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:45:26 -02:00
Benoit Parrot ccf963d327 [media] MAINTAINERS: Add ti-vpe maintainer entry
Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:17:56 -02:00
Benoit Parrot 9f14bab72c [media] media: ti-vpe: Document CAL driver
Device Tree bindings for the Camera Adaptation Layer (CAL) driver

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:17:36 -02:00
Hans Verkuil 3541e349e1 [media] vivid: fix broken Bayer text rendering
Sometimes when a Bayer pixelformat is selected the rendering of the OSD text
by vivid was all wrong: every other line of the text was shifted by half the width
or more.

It turned out that to render Bayer formats the interleaved boolean is set to true
in the tpg. This mode indicates a semi-biplanar mode where two interleaved planes
are used to render the frame. From outside the tpg it looks like a single plane,
but internally it is two planes.

However, in the tpg_s_bytesperline() function the interleaved bool wasn't checked
and only the bytesperline value for plane 0 was updated. But for the interleaved
mode the same value has to be copied to bytesperline[1] as well.

The effect was that whatever old value was left in bytesperline[1] was used, which
caused all sorts of weird and seemingly unpredictable shifts.

Reported-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:16:28 -02:00
Tiffany Lin 7df5ab8774 [media] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32
In v4l2-compliance utility, test QUERYBUF required correct length
value to go through each planar to check planar's length in
multi-planar buffer type

Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org>      # for v3.7 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:15:21 -02:00
Hans Verkuil 49fe73400d [media] DocBook media: make explicit that standard/timings never change automatically
A driver might detect a new standard or DV timings, but it will never change to
those new timings automatically. Instead it will send an event and let the application
take care of it.

Make this explicit in the documentation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:14:54 -02:00
Ulrich Hecht b7d4d2f8d8 [media] media: adv7604: implement get_selection
The rcar_vin driver relies on this.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:03:32 -02:00
Mats Randgaard fcae73fac1 [media] tc358743: Use local array with fixed size in i2c write
i2c_wr() is called from ops and the interrupt service routine, while
state->wr_data is shared and unprotected, and could be overwritten.

This shared buffer is therefore replaced with a local array with fixed
size. The array has the size of one EDID block (128 bytes) + 2 bytes
i2c address, and the EDID is written block by block (up to 8 blocks).

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:02:53 -02:00
Hans Verkuil 8e20b80344 [media] v4l2-dv-timings: skip standards check for V4L2_DV_BT_CAP_CUSTOM
Skip validating the standards field in v4l2_valid_dv_timings() if the
V4L2_DV_BT_CAP_CUSTOM capability is set, since that implies that
non-standard timings are allowed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:01:42 -02:00
Fugang Duan 949cf70636 [media] radio-si476x: add return value check to avoid dead code
Dead code found on below code:
    si476x_radio_add_new_custom(radio, SI476X_IDX_DIVERSITY_MODE);
    if (rval < 0)
            goto exit;

    si476x_radio_add_new_custom(radio, SI476X_IDX_INTERCHIP_LINK);
    if (rval < 0)  ====> Dead code !!!
            goto exit;

The piece of code miss return value check after calling .si476x_radio_add_new_custom(),
the patch fix it.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:01:15 -02:00
Jean-Baptiste Theou 9dd73448c6 [media] cx231xx: Fix memory leak
dma_area needs to be freed when the device is closed.

Based on em23xx-audio.c

Signed-off-by: Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:00:47 -02:00
Dan Carpenter aeae69daa3 [media] wl128x: fix typo in MODULE_PARM_DESC
The module_param() is "default_rds_buf" and the MODULE_PARM_DESC()
should match.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:00:27 -02:00
Dan Carpenter 199964b1d0 [media] staging: media: lirc: fix MODULE_PARM_DESC typo
It "tx_mask" was intended instead of "tx_maxk".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 08:00:08 -02:00
Dan Carpenter 39de7d95f8 [media] vpx3220: signedness bug in vpx3220_fp_read()
The intent was to return -1 on error and that's what the callers expect
but the current code returns USHRT_MAX instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:59:43 -02:00
Philipp Zabel 74dc385cb4 [media] coda: fix first encoded frame payload
During the recent vb2_buffer restructuring, the calculation of the
buffer payload reported to userspace was accidentally broken for the
first encoded frame, counting only the length of the headers.
This patch re-adds the length of the actual frame data.

Fixes: 2d7007153f ("[media] media: videobuf2: Restructure vb2_buffer")

Reported-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Jan Luebbe <jlu@pengutronix.de>
Cc: <stable@vger.kernel.org>      # for v4.4 and up
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:59:23 -02:00
Julia Lawall 64e423d4fb [media] media: bt8xx: constify sp887x_config structure
This sp887x_config structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:58:47 -02:00
Julia Lawall 4a40c73e5b [media] media: bt8xx: constify or51211_config structure
The or51211_config structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:58:26 -02:00
Julia Lawall 40205163ff [media] drivers/media/usb/dvb-usb-v2: constify mxl111sf_tuner_config structure
This mxl111sf_tuner_config structure is never modified, so declare it as
const.

There are some indentation changes to remain within 80 columns.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Michael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:58:08 -02:00
Julia Lawall 3defe84a76 [media] av7110: constify sp8870_config structure
This sp8870_config structure is never modified, so declare it as
const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:54:37 -02:00
Insu Yun e22a3b34a1 [media] usbtv: correctly handling failed allocation
Since kzalloc can be failed,
if not properly handled, NULL dereference could be happened.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:42:00 -02:00
Insu Yun f8433226d1 [media] cx231xx: correctly handling failed allocation
Since kmalloc can be failed in memory pressure,
if not properly handled, NULL dereference can be happend

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:41:37 -02:00
Markus Elfring b68554cd76 [media] hdpvr: Refactoring for hdpvr_read()
Let us return directly if the element "status" of the variable "buf"
indicates "BUFSTAT_READY".
A check repetition can be excluded for the variable "ret" at the end then.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:41:14 -02:00
Markus Elfring 80c1bce9aa [media] au0828: Refactoring for start_urb_transfer()
This issue was detected by using the Coccinelle software.

1. Let us return directly if a buffer allocation failed.

2. Delete the jump label "err" then.

3. Drop the explicit initialisation for the variable "ret"
   at the beginning.

4. Return zero as a constant at the end.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:39:25 -02:00
Markus Elfring 490ba9c29d [media] bttv: Returning only value constants in two functions
Return constant integer values without storing them in the local
variable "err" or "rc".

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:38:18 -02:00
Niklas Söderlund b20b51f090 [media] vim2m: return error if driver registration fails
Don't hide the error code.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:37:46 -02:00
Ezequiel Garcia faccb05ca8 [media] stk1160: Remove redundant vb2_buf payload set
Calling vb2_set_plane_payload is enough, there's no need to
set the planes[] bytesused field. Remove it.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:37:20 -02:00
Geliang Tang 03c6bdfc65 [media] bttv-driver, usbvision-video: use to_video_device()
Use to_video_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:36:48 -02:00
Nikola Forró 80fa4f07fd [media] usbtv: discard redundant video fields
There are many dropped fields with some sources, leading to many
redundant fields without counterparts. When this redundant field
is odd, a new frame is pushed containing this odd field interleaved
with whatever was left in the buffer, causing video artifacts.

Do not push a new frame after processing every odd field, but do it
only after those which come after an even field.

Signed-off-by: Nikola Forró <nikola.forro@gmail.com>
Acked-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:35:59 -02:00
Hans Verkuil 9f1830206d [media] saa7134: add DMABUF support
Since saa7134 is now using vb2, there is no reason why we can't support
dmabuf for this driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:34:38 -02:00
Julia Lawall ff880348e7 [media] go7007: constify go7007_hpi_ops structures
The go7007_hpi_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:34:07 -02:00
Mats Randgaard 2874bf3ec4 [media] tc358743: Print timings only when debug level is set
Prevent unnecessary kernel log spamming.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01 07:33:10 -02:00