platform/kernel/linux-3.10.git
9 years agoupstream: [media] bfin_capture: fix compiler warning
Hans Verkuil [Thu, 20 Jun 2013 19:28:15 +0000 (16:28 -0300)]
upstream: [media] bfin_capture: fix compiler warning

media-git/drivers/media/platform/blackfin/bfin_capture.c: In function ‘bcap_probe’:
media-git/drivers/media/platform/blackfin/bfin_capture.c:1007:16: warning: ignoring return value of ‘vb2_queue_init’, declared with attribute warn_unused_result [-Wunused-result]
  vb2_queue_init(q);
                  ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] ml86v7667: fix compiler warning
Hans Verkuil [Thu, 20 Jun 2013 19:28:14 +0000 (16:28 -0300)]
upstream: [media] ml86v7667: fix compiler warning

build/media_build/v4l/ml86v7667.c: In function 'ml86v7667_s_ctrl':
build/media_build/v4l/ml86v7667.c:120:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret = 0;
        ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Vladimir Barinov <source@cogentembedded.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] V4L2: soc-camera: remove several CEU references in the generic...
Guennadi Liakhovetski [Tue, 25 Jun 2013 08:59:23 +0000 (05:59 -0300)]
upstream: [media] V4L2: soc-camera: remove several CEU references in the generic scaler

The scaling / cropping library, that has been extracted from the CEU
driver still contained a couple of references to the original hardware.
Clean them up.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] V4L2: soc-camera: move generic functions into a separate file
Guennadi Liakhovetski [Thu, 25 Apr 2013 11:18:45 +0000 (08:18 -0300)]
upstream: [media] V4L2: soc-camera: move generic functions into a separate file

The sh_mobile_ceu_camera driver implements a generic algorithm for setting
up an optimal client and host scaling and cropping configuration. This
patch makes those functions available for all drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] V4L2: sh_mobile_ceu_camera: remove CEU specific data from generic...
Guennadi Liakhovetski [Wed, 24 Apr 2013 14:15:30 +0000 (11:15 -0300)]
upstream: [media] V4L2: sh_mobile_ceu_camera: remove CEU specific data from generic functions

Several functions in the sh_mobile_ceu_camera driver implement generic
algorithms and can be re-used by other V4L2 camera host drivers too. These
functions attempt to optimise scaling and cropping functions of the
subdevice, e.g. a camera sensor. This patch makes those functions generic
for future re-use by other camera host drivers.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] V4L2: sh_vou: add I2C build dependency
Guennadi Liakhovetski [Mon, 24 Jun 2013 08:08:05 +0000 (05:08 -0300)]
upstream: [media] V4L2: sh_vou: add I2C build dependency

The sh_vou driver needs CONFIG_I2C or CONFIG_I2C_MODULE to build, add the
respective dependency.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: treewide: relase -> release
Geert Uytterhoeven [Fri, 28 Jun 2013 09:27:31 +0000 (11:27 +0200)]
upstream: treewide: relase -> release

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
9 years agoupstream: [media] sh-mobile-ceu-driver: support max width and height in DT
Guennadi Liakhovetski [Mon, 17 Sep 2012 10:48:33 +0000 (07:48 -0300)]
upstream: [media] sh-mobile-ceu-driver: support max width and height in DT

Some CEU implementations have non-standard (larger) maximum supported
width and height values. Add two OF properties to specify them.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] sh-mobile-ceu-camera: add primitive OF support
Guennadi Liakhovetski [Mon, 17 Sep 2012 10:42:55 +0000 (07:42 -0300)]
upstream: [media] sh-mobile-ceu-camera: add primitive OF support

Add an OF hook to sh_mobile_ceu_camera.c, no properties so far. Booting
with DT also requires platform data to be optional.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc-camera: don't attach the client to the host during probing
Guennadi Liakhovetski [Thu, 4 Apr 2013 17:21:54 +0000 (14:21 -0300)]
upstream: [media] soc-camera: don't attach the client to the host during probing

During client probing we only have to turn on the host's clock, no need to
actually attach the client to the host.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc-camera: make .clock_{start,stop} compulsory, .add / .remove...
Guennadi Liakhovetski [Thu, 4 Apr 2013 16:19:58 +0000 (13:19 -0300)]
upstream: [media] soc-camera: make .clock_{start,stop} compulsory, .add / .remove optional

All existing soc-camera host drivers use .clock_start() and .clock_stop()
callbacks to activate and deactivate their camera interfaces, whereas
.add() and .remove() callbacks are usually dummy. Make the former two
compulsory and the latter two optional.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] sh-mobile-ceu-camera: move interface activation and deactivation...
Guennadi Liakhovetski [Thu, 4 Apr 2013 15:54:20 +0000 (12:54 -0300)]
upstream: [media] sh-mobile-ceu-camera: move interface activation and deactivation to clock callbacks

When adding and removing a client, the sh-mobile-ceu-camera driver activates
and, respectively, deactivates its camera interface and, if necessary, the
CSI2 controller. Only handling of the CSI2 interface is client-specific and
is only needed, when a data-exchange with the client is taking place. Move
the rest to .clock_start() and .clock_stop() callbacks.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] mx1-camera: move interface activation and deactivation to clock...
Guennadi Liakhovetski [Thu, 4 Apr 2013 15:06:32 +0000 (12:06 -0300)]
upstream: [media] mx1-camera: move interface activation and deactivation to clock callbacks

When adding and removing a client, the mx1-camera driver only activates
and deactivates its camera interface respectively, which doesn't include
any client-specific actions. Move this functionality into .clock_start()
and .clock_stop() callbacks.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] mx2-camera: move interface activation and deactivation to clock...
Guennadi Liakhovetski [Thu, 4 Apr 2013 14:49:13 +0000 (11:49 -0300)]
upstream: [media] mx2-camera: move interface activation and deactivation to clock callbacks

When adding and removing a client, the mx2-camera driver only activates
and deactivates its camera interface respectively, which doesn't include
any client-specific actions. Move this functionality into .clock_start()
and .clock_stop() callbacks.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] mx3-camera: move interface activation and deactivation to clock...
Guennadi Liakhovetski [Thu, 4 Apr 2013 14:24:43 +0000 (11:24 -0300)]
upstream: [media] mx3-camera: move interface activation and deactivation to clock callbacks

When adding and removing a client, the mx3-camera driver only activates
and deactivates its camera interface respectively, which doesn't include
any client-specific actions. Move this functionality into .clock_start()
and .clock_stop() callbacks.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] atmel-isi: move interface activation and deactivation to clock...
Guennadi Liakhovetski [Thu, 4 Apr 2013 12:56:09 +0000 (09:56 -0300)]
upstream: [media] atmel-isi: move interface activation and deactivation to clock callbacks

When adding and removing a client, the atmel-isi camera host driver only
activates and deactivates its camera interface respectively, which doesn't
include any client-specific actions. Move this functionality into
.clock_start() and .clock_stop() callbacks.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] omap1-camera: move interface activation and deactivation to clock...
Guennadi Liakhovetski [Thu, 4 Apr 2013 12:38:00 +0000 (09:38 -0300)]
upstream: [media] omap1-camera: move interface activation and deactivation to clock callbacks

When adding and removing a client, the omap1-camera driver only activates
and deactivates its camera interface respectively, which doesn't include
any client-specific actions. Move this functionality into .clock_start()
and .clock_stop() callbacks.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] pxa-camera: move interface activation and deactivation to clock...
Guennadi Liakhovetski [Thu, 4 Apr 2013 11:56:00 +0000 (08:56 -0300)]
upstream: [media] pxa-camera: move interface activation and deactivation to clock callbacks

When adding and removing a client, the pxa-camera driver only activates
and deactivates its camera interface respectively, which doesn't include
any client-specific actions. Move this functionality into .clock_start()
and .clock_stop() callbacks.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc-camera: add host clock callbacks to start and stop the master...
Guennadi Liakhovetski [Thu, 4 Apr 2013 11:51:36 +0000 (08:51 -0300)]
upstream: [media] soc-camera: add host clock callbacks to start and stop the master clock

Currently soc-camera uses a single camera host callback to activate the
interface master clock and to configure the interface for a specific
client. However, during probing we might not have the information about
a client, we just need to activate the clock. Add new camera host driver
callbacks to only start and stop the clock without and client-specific
configuration.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc-camera: move common code to soc_camera.c
Guennadi Liakhovetski [Thu, 4 Apr 2013 11:21:12 +0000 (08:21 -0300)]
upstream: [media] soc-camera: move common code to soc_camera.c

All soc-camera host drivers include a pointer to an soc-camera device in
their host private struct to check, that only one client is connected.
Move this common code to soc_camera.c.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] ttusb-budget: fix memory leak in ttusb_probe()
Alexey Khoroshilov [Mon, 10 Jun 2013 19:00:54 +0000 (16:00 -0300)]
upstream: [media] ttusb-budget: fix memory leak in ttusb_probe()

If something goes wrong starting from i2c_add_adapter(),
ttusb->iso_urb[] and ttusb itself are not deallocated.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] V4L2: soc-camera: remove unneeded include path
Guennadi Liakhovetski [Thu, 25 Apr 2013 11:05:15 +0000 (08:05 -0300)]
upstream: [media] V4L2: soc-camera: remove unneeded include path

soc-camera isn't sufficiently broken to include any files from the
drivers/media/i2c/soc_camera directory in its core or host driver files:-)

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: Cocci spatch "ptr_ret.spatch"
Thomas Meyer [Sat, 1 Jun 2013 09:56:26 +0000 (06:56 -0300)]
upstream: [media] media: Cocci spatch "ptr_ret.spatch"

Use the PTR_RET() macro to simplify error processing.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc_camera: tw9910: Remove empty function
Sachin Kamat [Fri, 24 May 2013 11:25:07 +0000 (08:25 -0300)]
upstream: [media] soc_camera: tw9910: Remove empty function

After the switch to devm_* functions, the 'remove' function does
not do anything. Delete it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc_camera: mt9t112: Remove empty function
Sachin Kamat [Fri, 24 May 2013 11:25:06 +0000 (08:25 -0300)]
upstream: [media] soc_camera: mt9t112: Remove empty function

After the switch to devm_* functions, the 'remove' function does
not do anything. Delete it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc_camera_platform: Remove redundant platform_set_drvdata()
Sachin Kamat [Mon, 13 May 2013 09:19:21 +0000 (06:19 -0300)]
upstream: [media] soc_camera_platform: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
[g.liakhovetski@gmx.de: further simplified return statement]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc_camera/sh_mobile_csi2: Remove redundant platform_set_drvdata()
Sachin Kamat [Mon, 13 May 2013 09:19:20 +0000 (06:19 -0300)]
upstream: [media] soc_camera/sh_mobile_csi2: Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc_camera: Fix checkpatch warning in ov9640.c
Sachin Kamat [Tue, 30 Apr 2013 09:29:09 +0000 (06:29 -0300)]
upstream: [media] soc_camera: Fix checkpatch warning in ov9640.c

Silences the following warning:
WARNING: please, no space before tabs

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc_camera: Constify dev_pm_ops in mt9t031.c
Sachin Kamat [Tue, 30 Apr 2013 09:29:08 +0000 (06:29 -0300)]
upstream: [media] soc_camera: Constify dev_pm_ops in mt9t031.c

Silences the following warning:
WARNING: struct dev_pm_ops should normally be const

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc-camera: remove two unused configs
Paul Bolle [Tue, 9 Apr 2013 09:15:58 +0000 (06:15 -0300)]
upstream: [media] soc-camera: remove two unused configs

The last users of Kconfig symbols MX3_VIDEO and VIDEO_MX2_HOSTSUPPORT
were removed in v3.2. Their Kconfig entries can be removed now.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] go7007: fix return 0 for unsupported devices in go7007_usb_probe()
Alexey Khoroshilov [Wed, 19 Jun 2013 19:57:40 +0000 (16:57 -0300)]
upstream: [media] go7007: fix return 0 for unsupported devices in go7007_usb_probe()

probe() should not return 0 for unsupported devices, but go7007_usb_probe() does.
The patch fixes it to return -ENODEV.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] usbtv: Add driver for Fushicai USBTV007 video frame grabber
Lubomir Rintel [Mon, 17 Jun 2013 13:29:06 +0000 (10:29 -0300)]
upstream: [media] usbtv: Add driver for Fushicai USBTV007 video frame grabber

Reverse-engineered driver for cheapo video digitizer, made from observations of
Windows XP driver. The protocol is not yet completely understood, so far we
don't provide any controls, only support a single format out of three and don't
support the audio device.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: i2c: ths7303: remove unused member driver_data
Lad, Prabhakar [Sat, 15 Jun 2013 15:34:10 +0000 (12:34 -0300)]
upstream: [media] media: i2c: ths7303: remove unused member driver_data

This patch removes the driver_data member from ths7303_state structure.
The driver_data member was intended to differentiate between ths7303 and
ths7353 chip and get the g_chip_ident, But as of now g_chip_ident is
obsolete, so there is no need of driver_data.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] radio-sf16fmi: Set frequency during init
Ondrej Zary [Fri, 14 Jun 2013 20:01:39 +0000 (17:01 -0300)]
upstream: [media] radio-sf16fmi: Set frequency during init

Set freqency during initialization to fix v4l2-compliance error.
This also fixes VIDIOC_G_FREQUENCY always returning zero (broken by me during LM7000 conversion).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] radio-sf16fmi: Add module name to bus_info
Ondrej Zary [Fri, 14 Jun 2013 20:01:38 +0000 (17:01 -0300)]
upstream: [media] radio-sf16fmi: Add module name to bus_info

Fix v4l2-compliance in VIDIOC_QUERYCAP by changing "ISA" to "ISA:radio-sf16fmi".

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] usbvision-video: fix memory leak of alt_max_pkt_size
Alexey Khoroshilov [Mon, 10 Jun 2013 20:32:29 +0000 (17:32 -0300)]
upstream: [media] usbvision-video: fix memory leak of alt_max_pkt_size

1. usbvision->alt_max_pkt_size is not deallocated anywhere.
2. if allocation of usbvision->alt_max_pkt_size fails,
there is no proper deallocation of already acquired resources.
The patch adds kfree(usbvision->alt_max_pkt_size) to
usbvision_release() as soon as other deallocations happen there.
It calls usbvision_release() if allocation of
usbvision->alt_max_pkt_size fails as soon as usbvision_release()
is safe to work with incompletely initialized usbvision structure.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: i2c: tvp514x: add OF support
Lad, Prabhakar [Tue, 4 Jun 2013 15:26:23 +0000 (12:26 -0300)]
upstream: [media] media: i2c: tvp514x: add OF support

add OF support for the tvp514x driver.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Rob Landley <rob@landley.net>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: davinci-linux-open-source@linux.davincidsp.com
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_display: remove unnecessary loop for IRQ resource
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:51 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_display: remove unnecessary loop for IRQ resource

For vpif display driver each IRQ resource contains a single IRQ
so drop the second loop.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_display: Convert to devm_* api
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:50 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_display: Convert to devm_* api

use devm_request_irq() instead of request_irq(). This ensures
more consistent error values and simplifies error paths.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_display: use module_platform_driver()
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:49 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_display: use module_platform_driver()

This patch uses module_platform_driver() to simplify the code.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_display: move the freeing of irq and global...
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:48 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_display: move the freeing of irq and global variables to remove()

Ideally the freeing of irq's and the global variables needs to be
done in the remove() rather than module_exit(), this patch moves
the freeing up of irq's and freeing the memory allocated to channel
objects to remove() callback of struct platform_driver.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_capture: remove unnecessary loop for IRQ resource
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:47 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_capture: remove unnecessary loop for IRQ resource

For vpif capture driver each IRQ resource contains a single IRQ
so drop the second loop.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_capture: Convert to devm_* api
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:46 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_capture: Convert to devm_* api

use devm_request_irq() instead of request_irq(). This ensures
more consistent error values and simplifies error paths.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_capture: use module_platform_driver()
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:45 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_capture: use module_platform_driver()

This patch uses module_platform_driver() to simplify the code.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif_capture: move the freeing of irq and global...
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:44 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif_capture: move the freeing of irq and global variables to remove()

Ideally the freeing of irq's and the global variables needs to be
done in the remove() rather than module_exit(), this patch moves
the freeing up of irq's and freeing the memory allocated to channel
objects to remove() callback of struct platform_driver.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif: remove unnecessary braces around defines
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:43 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif: remove unnecessary braces around defines

This patch removes unnecessary braces around defines.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif: Convert to devm_* api
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:42 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif: Convert to devm_* api

Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] media: davinci: vpif: remove unwanted header mach/hardware.h and...
Lad, Prabhakar [Mon, 17 Jun 2013 14:20:41 +0000 (11:20 -0300)]
upstream: [media] media: davinci: vpif: remove unwanted header mach/hardware.h and sort the includes alphabetically

This patch removes unwanted header include of mach/hardware.h
and along side sorts the header inclusion alphabetically.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@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@redhat.com>
9 years agoupstream: [media] pvrusb2: Remove unused variable
Mauro Carvalho Chehab [Fri, 21 Jun 2013 14:19:10 +0000 (11:19 -0300)]
upstream: [media] pvrusb2: Remove unused variable

drivers/media/usb/pvrusb2/pvrusb2-v4l2.c: In function 'pvr2_v4l2_dev_init':
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c:1268:21: warning: variable 'usbdev' set but not used [-Wunused-but-set-variable]

This warning is due to changeset a28fbd04facb, with removed the
usage of usbdev inside pvr2_v4l2_dev_init().

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mike Isely <isely@pobox.com>
9 years agoupstream: [media] cx88: set dev_parent to the correct parent PCI bus
Hans Verkuil [Wed, 12 Jun 2013 14:23:44 +0000 (11:23 -0300)]
upstream: [media] cx88: set dev_parent to the correct parent PCI bus

The cx88 driver has one v4l2_device, but the video nodes are owned by two
different PCI busses. So the dev_parent pointer should be set to the correct
parent bus, otherwise sysfs won't show the correct device hierarchy.
This broke starting in 3.6 after a driver change, so this patch resurrects
the correct behavior.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l2: always require v4l2_dev, rename parent to dev_parent
Hans Verkuil [Wed, 12 Jun 2013 14:15:12 +0000 (11:15 -0300)]
upstream: [media] v4l2: always require v4l2_dev, rename parent to dev_parent

The last set of drivers still using the parent field of video_device instead
of the v4l2_dev field have been converted, so v4l2_dev is now always set.
A proper pointer to v4l2_dev is necessary these days otherwise the advanced
debugging ioctls will not work when addressing sub-devices. It also ensures
that the core can always go from a video_device struct to the top-level
v4l2_device struct.
There is still one single use case for the parent pointer: if there are
multiple busses, each being the parent of one or more video nodes, and if
they all share the same v4l2_device struct. In that case one still needs a
parent pointer since the v4l2_device struct can only refer to a single
parent device. The cx88 driver is one such case. Unfortunately, the cx88
failed to set the parent pointer since 3.6. The next patch will correct this.
In order to support this use-case the parent pointer is only renamed to
dev_parent, not removed altogether. It has been renamed to ensure that the
compiler will catch any (possibly out-of-tree) drivers that were missed during
the conversion.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7134: use v4l2_dev instead of the deprecated parent field
Hans Verkuil [Thu, 20 Jun 2013 13:57:10 +0000 (10:57 -0300)]
upstream: [media] saa7134: use v4l2_dev instead of the deprecated parent field

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] omap24xxcam: add v4l2_device and replace parent with v4l2_dev
Hans Verkuil [Wed, 12 Jun 2013 09:03:27 +0000 (06:03 -0300)]
upstream: [media] omap24xxcam: add v4l2_device and replace parent with v4l2_dev

This driver did not yet support struct v4l2_device, so add it. This
make it possible to replace the deprecated parent field with the
v4l2_dev field, allowing the eventual removal of the parent field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] pvrusb2: use v4l2_dev instead of the deprecated parent field
Hans Verkuil [Mon, 10 Jun 2013 12:16:25 +0000 (09:16 -0300)]
upstream: [media] pvrusb2: use v4l2_dev instead of the deprecated parent field

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7164: add v4l2_device and replace parent with v4l2_dev
Hans Verkuil [Wed, 12 Jun 2013 08:49:50 +0000 (05:49 -0300)]
upstream: [media] saa7164: add v4l2_device and replace parent with v4l2_dev

This driver did not yet support struct v4l2_device, so add it. This
make it possible to replace the deprecated parent field with the
v4l2_dev field, allowing the eventual removal of the parent field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] sn9c102_core: add v4l2_device and replace parent with v4l2_dev
Hans Verkuil [Wed, 12 Jun 2013 08:46:30 +0000 (05:46 -0300)]
upstream: [media] sn9c102_core: add v4l2_device and replace parent with v4l2_dev

This driver did not yet support struct v4l2_device, so add it. This
make it possible to replace the deprecated parent field with the
v4l2_dev field, allowing the eventual removal of the parent field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] zoran: use v4l2_dev instead of the deprecated parent field
Hans Verkuil [Mon, 10 Jun 2013 10:30:08 +0000 (07:30 -0300)]
upstream: [media] zoran: use v4l2_dev instead of the deprecated parent field

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] cx23885-417: use v4l2_dev instead of the deprecated parent field
Hans Verkuil [Mon, 10 Jun 2013 10:27:37 +0000 (07:27 -0300)]
upstream: [media] cx23885-417: use v4l2_dev instead of the deprecated parent field

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] soc_camera: replace vdev->parent by vdev->v4l2_dev
Hans Verkuil [Mon, 10 Jun 2013 12:27:41 +0000 (09:27 -0300)]
upstream: [media] soc_camera: replace vdev->parent by vdev->v4l2_dev

The parent field will eventually disappear to be replaced by v4l2_dev.
soc_camera does provide a v4l2_device struct but did not point to it in
struct video_device. This is now fixed.
Now the video nodes can be found under the correct platform bus, and
the advanced debug ioctls work correctly as well (the core implementation
of those ioctls requires that v4l2_dev is set correctly).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] DocBook: remove obsolete note from the dbg_g_register doc
Hans Verkuil [Sun, 26 May 2013 13:31:01 +0000 (10:31 -0300)]
upstream: [media] DocBook: remove obsolete note from the dbg_g_register doc

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l2-int-device: remove unused chip_ident reference
Hans Verkuil [Sun, 26 May 2013 12:33:00 +0000 (09:33 -0300)]
upstream: [media] v4l2-int-device: remove unused chip_ident reference

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] em28xx: remove GPIO register caching
Frank Schaefer [Mon, 3 Jun 2013 17:12:05 +0000 (14:12 -0300)]
upstream: [media] em28xx: remove GPIO register caching

The GPIO register caching is the result of wrong assumptions and incomplete
knowledge about the GPIO registers and their functionality.
Today, we know that it is not needed.
It is also limited to a single register and therefore incomplete (newer chips
are using multiple registers).
Instead of extending the caching, get rid of it, because it has no real
benefits and just bloats/complicates the code.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] em28xx: move snapshot button bit definition for reg 0x0C from em28x...
Frank Schaefer [Mon, 3 Jun 2013 17:12:04 +0000 (14:12 -0300)]
upstream: [media] em28xx: move snapshot button bit definition for reg 0x0C from em28xx-input.c to em28xx.h

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] em28xx: improve em2820-em2873/83 GPIO port register definitions...
Frank Schaefer [Mon, 3 Jun 2013 17:12:03 +0000 (14:12 -0300)]
upstream: [media] em28xx: improve em2820-em2873/83 GPIO port register definitions and descriptions

- add definition for GPIO register 0x09 (reading/input)
- extend the information the chip variants that support GPIO registers 0x08/0x09
- rename EM28XX_R08_GPIO to EM2820_R08_GPIO_CTRL

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] em28xx: extend GPIO register definitions for the em25xx, em276x...
Frank Schaefer [Mon, 3 Jun 2013 17:12:02 +0000 (14:12 -0300)]
upstream: [media] em28xx: extend GPIO register definitions for the em25xx, em276x/7x/8x, em2874/174/84

The em25xx/em276x/7x/8x provides 4 GPIO register sets,
each of them consisting of separate read and a write registers.
The same registers are also used by the em2874/174/84.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] mxl111sf: don't redefine pr_err/info/debug
Hans Verkuil [Mon, 17 Jun 2013 23:56:40 +0000 (20:56 -0300)]
upstream: [media] mxl111sf: don't redefine pr_err/info/debug

Remove the silly redefines of pr_err/info/debug.
This improves readability and it also gets rid of a bunch of warnings when
compiling this driver for older kernels using the compatibility media_build
system.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] r820t: fix imr calibration
Gianluca Gennari [Mon, 17 Jun 2013 23:32:45 +0000 (20:32 -0300)]
upstream: [media] r820t: fix imr calibration

The r820t_imr() calibration function of the Rafael Micro R820T tuner
generates this error at every tune attempt:
r820t 0-001a: No valid PLL values for 2252021 kHz!
The function was inspired by the original Realtek driver for rtl2832 devices
with the r820t tuner; anyway, in the original code the XTAL frequency of
the tuner was expressed in KHz, while in the kernel driver it is expressed
in Hz; so the calibration failed because of an out-of-range initial value.
The final result of the computation is then passed to the r820t_set_mux()
and r820t_set_pll() functions, but the conversion from KHz to Hz is already
correctly implemented.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] r820t: avoid potential memcpy buffer overflow in shadow_store()
Gianluca Gennari [Sun, 2 Jun 2013 17:31:19 +0000 (14:31 -0300)]
upstream: [media] r820t: avoid potential memcpy buffer overflow in shadow_store()

The memcpy in shadow_store() could exceed buffer limits when r > 0.

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] r820t: remove redundant initializations in r820t_attach()
Gianluca Gennari [Sun, 2 Jun 2013 17:30:09 +0000 (14:30 -0300)]
upstream: [media] r820t: remove redundant initializations in r820t_attach()

fe->tuner_priv and fe->ops.tuner_ops are initialized twice in r820t_attach().
Remove the redundant initializations and also move fe->ops.tuner_ops
initialization outside of the mutex lock (as in the xc4000 tuner code for example).

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] smiapp: Clean up media entity after unregistering subdev
Sakari Ailus [Tue, 11 Jun 2013 09:50:48 +0000 (06:50 -0300)]
upstream: [media] smiapp: Clean up media entity after unregistering subdev

media_entity_cleanup() frees the links array which will be accessed by
media_entity_remove_links() called by v4l2_device_unregister_subdev().

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] davinci_vpfe: Clean up media entity after unregistering subdev
Sakari Ailus [Tue, 11 Jun 2013 09:50:49 +0000 (06:50 -0300)]
upstream: [media] davinci_vpfe: Clean up media entity after unregistering subdev

media_entity_cleanup() frees the links array which will be accessed by
media_entity_remove_links() called by v4l2_device_unregister_subdev().

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: platform: Check for ARCH_EXYNOS separately
Tomasz Figa [Tue, 18 Jun 2013 16:25:44 +0000 (01:25 +0900)]
upstream: platform: Check for ARCH_EXYNOS separately

ARCH_EXYNOS is going to be excluded from PLAT_S5P, so it must be checked
separately in Exynos-related Kconfig entries.

Cc: linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Kamil Debski <k.debski@samsung.com>
Cc: Tomasz Stanislawski <t.stanislaws@samsung.com>
Cc: Jeongtae Park <jtp.park@samsung.com>
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
9 years agoupstream: [media] staging/media: lirc_imon: fix leaks in imon_probe()
Alexey Khoroshilov [Mon, 3 Jun 2013 01:58:49 +0000 (22:58 -0300)]
upstream: [media] staging/media: lirc_imon: fix leaks in imon_probe()

Error handling of usb_submit_urb() is not as all others in imon_probe().
It just unlocks mutexes and returns nonzero leaving all already
allocated resources unfreed.
The patch makes sure all the resources are deallocated.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] pvrusb2: Cocci spatch "memdup.spatch"
Thomas Meyer [Sat, 1 Jun 2013 08:38:30 +0000 (05:38 -0300)]
upstream: [media] pvrusb2: Cocci spatch "memdup.spatch"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drivers/media/pci/mantis/mantis_cards: Convert to module_pci_driver
Libo Chen [Mon, 27 May 2013 01:31:39 +0000 (22:31 -0300)]
upstream: [media] drivers/media/pci/mantis/mantis_cards: Convert to module_pci_driver

use module_pci_driver instead of init/exit, make code clean

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drivers/media/pci/pluto2/pluto2: Convert to module_pci_driver
Libo Chen [Mon, 27 May 2013 01:31:53 +0000 (22:31 -0300)]
upstream: [media] drivers/media/pci/pluto2/pluto2: Convert to module_pci_driver

use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drivers/media/pci/dm1105/dm1105: Convert to module_pci_driver
Libo Chen [Mon, 27 May 2013 01:31:49 +0000 (22:31 -0300)]
upstream: [media] drivers/media/pci/dm1105/dm1105: Convert to module_pci_driver

use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drivers/media/pci/mantis/hopper_cards: Convert to module_pci_driver
Libo Chen [Mon, 27 May 2013 01:31:46 +0000 (22:31 -0300)]
upstream: [media] drivers/media/pci/mantis/hopper_cards: Convert to module_pci_driver

use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] drivers/media/pci/dm1105/dm1105: Convert to module_pci_driver
Libo Chen [Mon, 27 May 2013 01:31:43 +0000 (22:31 -0300)]
upstream: [media] drivers/media/pci/dm1105/dm1105: Convert to module_pci_driver

use module_pci_driver instead of init/exit, make code clean.

Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] mt9p031: Use bulk regulator API
Laurent Pinchart [Sat, 8 Jun 2013 07:50:42 +0000 (04:50 -0300)]
upstream: [media] mt9p031: Use bulk regulator API

The sensor is powered by three supplies. Use the bulk regulator API to
enable and disable them instead of performing the operations manually.
This fixes a warning caused by ignoring the return value of
regulator_enable().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: i2c: mt9p031: add OF support
Lad, Prabhakar [Sun, 26 May 2013 13:08:54 +0000 (10:08 -0300)]
upstream: [media] media: i2c: mt9p031: add OF support

Add OF support for the mt9p031 sensor driver.
Alongside this patch sorts the header inclusion alphabetically.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] ths8200: fix two compiler warnings
Hans Verkuil [Mon, 10 Jun 2013 09:57:19 +0000 (06:57 -0300)]
upstream: [media] ths8200: fix two compiler warnings

drivers/media/i2c/ths8200.c: In function ‘ths8200_g_register’:
drivers/media/i2c/ths8200.c:121:21: warning: unused variable ‘client’ [-Wunused-variable]
drivers/media/i2c/ths8200.c: In function ‘ths8200_s_register’:
drivers/media/i2c/ths8200.c:132:21: warning: unused variable ‘client’ [-Wunused-variable]

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7134: fix empress format compliance bugs
Hans Verkuil [Sat, 1 Jun 2013 13:02:38 +0000 (10:02 -0300)]
upstream: [media] saa7134: fix empress format compliance bugs

Fix uninitialized fields and a missing TRY_FMT implementation in saa6752hs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7134: fix format-related compliance issues
Hans Verkuil [Fri, 31 May 2013 14:48:50 +0000 (11:48 -0300)]
upstream: [media] saa7134: fix format-related compliance issues

- map overlay format values to the supported ranges
- set colorspace
- zero priv field
- fix cliplist handling
- fix field handling
- initialize ovbuf values

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7134: move qos_request from saa7134_fh to saa7134_dev
Hans Verkuil [Fri, 31 May 2013 11:44:58 +0000 (08:44 -0300)]
upstream: [media] saa7134: move qos_request from saa7134_fh to saa7134_dev

This is a global field, not a per-filehandle field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7134: move fmt/width/height from saa7134_fh to saa7134_dev
Hans Verkuil [Fri, 31 May 2013 11:30:49 +0000 (08:30 -0300)]
upstream: [media] saa7134: move fmt/width/height from saa7134_fh to saa7134_dev

These fields are global, not per-filehandle.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7134: move the overlay fields from saa7134_fh to saa7134_dev
Hans Verkuil [Fri, 31 May 2013 11:22:24 +0000 (08:22 -0300)]
upstream: [media] saa7134: move the overlay fields from saa7134_fh to saa7134_dev

This is global data, not per-filehandle data.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7134: remove radio/type field from saa7134_fh
Hans Verkuil [Fri, 31 May 2013 10:57:10 +0000 (07:57 -0300)]
upstream: [media] saa7134: remove radio/type field from saa7134_fh

This information is already available in vfl_type in video_device.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] solo6x10: reimplement SAA712x setup routine
Ismael Luceno [Thu, 6 Jun 2013 03:12:17 +0000 (00:12 -0300)]
upstream: [media] solo6x10: reimplement SAA712x setup routine

This cleans up the saa712x setup code and there are no functional changes.

Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
[hans.verkuil@cisco.com: add clarification that this is cleanup only]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] media: i2c: ths8200: driver for TI video encoder
Hans Verkuil [Mon, 3 Jun 2013 16:26:17 +0000 (13:26 -0300)]
upstream: [media] media: i2c: ths8200: driver for TI video encoder

The full datasheets are available from TI website:-
http://www.ti.com/product/ths8200
Note: This patch adds support only for progressive format
as of now.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Martin Bugge <martin.bugge@cisco.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] tvp5150: fix s_std support
Hans Verkuil [Wed, 29 May 2013 13:19:06 +0000 (10:19 -0300)]
upstream: [media] tvp5150: fix s_std support

- do exact matching for special formats like PAL-M
- drop autodetect support: it's non-standard, and it is bogus as well since there
  is no way to get back the detected standard since neither g_std nor querystd are
  implemented.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] DocBook/media/v4l: clarify the QUERYSTD documentation
Hans Verkuil [Wed, 29 May 2013 13:19:05 +0000 (10:19 -0300)]
upstream: [media] DocBook/media/v4l: clarify the QUERYSTD documentation

Explicitly mention that this ioctl should return V4L2_STD_UNKNOWN if
not signal was detected.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] v4l2-ioctl: clarify querystd comment
Hans Verkuil [Wed, 29 May 2013 13:19:04 +0000 (10:19 -0300)]
upstream: [media] v4l2-ioctl: clarify querystd comment

Improve the querystd comment.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] zoran: remove bogus autodetect mode in set_norm
Hans Verkuil [Wed, 29 May 2013 13:19:03 +0000 (10:19 -0300)]
upstream: [media] zoran: remove bogus autodetect mode in set_norm

Currently, if the norm set is V4L2_STD_ALL, then autodetect the current
standard and use that. This is non-standard behavior, and in fact it hasn't
worked for a very long time: before s_std is called in this driver, the
v4l2 core will mask it with the tvnorms field. So even if the application
passes V4L2_STD_ALL, the zoran driver will always see a subset of that.
Since nobody ever complained about this we just remove this non-standard
functionality.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] bttv: fix querystd
Hans Verkuil [Wed, 29 May 2013 13:19:02 +0000 (10:19 -0300)]
upstream: [media] bttv: fix querystd

AND the standard mask with the detected standards.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] vpx3220: fix querystd
Hans Verkuil [Wed, 29 May 2013 13:19:01 +0000 (10:19 -0300)]
upstream: [media] vpx3220: fix querystd

Return V4L2_STD_UNKNOWN if no signal is detected.
Otherwise AND the standard mask with the detected standards.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] tvp514x: fix querystd
Hans Verkuil [Wed, 29 May 2013 13:19:00 +0000 (10:19 -0300)]
upstream: [media] tvp514x: fix querystd

Return V4L2_STD_UNKNOWN if no signal is detected.
Otherwise AND the standard mask with the detected standards.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7191: fix querystd
Hans Verkuil [Wed, 29 May 2013 13:18:59 +0000 (10:18 -0300)]
upstream: [media] saa7191: fix querystd

Return V4L2_STD_UNKNOWN if no signal is detected.
Otherwise AND the standard mask with the detected standards.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7115: fix querystd
Hans Verkuil [Wed, 29 May 2013 13:18:58 +0000 (10:18 -0300)]
upstream: [media] saa7115: fix querystd

Return V4L2_STD_UNKNOWN if no signal is detected.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
9 years agoupstream: [media] saa7110: fix querystd
Hans Verkuil [Wed, 29 May 2013 13:18:57 +0000 (10:18 -0300)]
upstream: [media] saa7110: fix querystd

Return V4L2_STD_UNKNOWN if no signal is detected.
Otherwise AND the standard mask with the detected standards.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>