]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
8 years ago[media] lgs8gxx: don't export get_frontend() callback
Mauro Carvalho Chehab [Thu, 4 Feb 2016 12:37:37 +0000 (10:37 -0200)]
[media] lgs8gxx: don't export get_frontend() callback

This device doesn't really have a get_frontend(). All it does is
to blindly set everything to auto mode.

Remove the get_frontend(), as the code does that already,
and put the frontend changes at set_frontend, where it
belongs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] friio-fe: remove get_frontend() callback
Mauro Carvalho Chehab [Thu, 4 Feb 2016 12:01:05 +0000 (10:01 -0200)]
[media] friio-fe: remove get_frontend() callback

This driver doesn't support getting frontend information and
it only works in automatic mode.

So, let's remove get_frontend() and update the cache at
set_frontend().

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] siano: remove get_frontend stub
Mauro Carvalho Chehab [Thu, 4 Feb 2016 11:54:25 +0000 (09:54 -0200)]
[media] siano: remove get_frontend stub

There's nothing at siano's get_frontend() callback. So,
remove it, as the core will handle it.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dvb_frontend: add props argument to dtv_get_frontend()
Mauro Carvalho Chehab [Thu, 4 Feb 2016 11:45:14 +0000 (09:45 -0200)]
[media] dvb_frontend: add props argument to dtv_get_frontend()

Instead of implicitly using the DTV cache properties at
dtv_get_frontend(), pass it as an additional argument.

This patch prepares to use a separate cache for G_PROPERTY,
in order to avoid it to mangle with the DVB thread
zigzag logic.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] xc2028: unlock on error in xc2028_set_config()
Dan Carpenter [Wed, 3 Feb 2016 15:34:00 +0000 (13:34 -0200)]
[media] xc2028: unlock on error in xc2028_set_config()

We have to unlock before returning -ENOMEM.

Fixes: 8dfbcc4351a0 ('[media] xc2028: avoid use after free')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dvb_frontend: print DTV property dump also for SET_PROPERTY
Mauro Carvalho Chehab [Wed, 3 Feb 2016 19:29:41 +0000 (17:29 -0200)]
[media] dvb_frontend: print DTV property dump also for SET_PROPERTY

When debugging troubles with DTV properties get/set, it is
important to be able to see not only the properties from get, but
also the ones from set. So, improve the dumps to allow reporting
both.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] msp3400: use IS_ENABLED check instead of #if
Arnd Bergmann [Tue, 2 Feb 2016 15:47:58 +0000 (13:47 -0200)]
[media] msp3400: use IS_ENABLED check instead of #if

A recent patch broke the msp3400 driver when CONFIG_MEDIA_CONTROLLER
is not set:

drivers/media/i2c/msp3400-driver.h:107:5: error: "CONFIG_MEDIA_CONTROLLER" is not defined [-Werror=undef]

It was clearly a typo, and this patch changes the
"#if CONFIG_MEDIA_CONTROLLER" to a working IS_ENABLED() check.

Fixes: fb4932821731 ("[media] msp3400: initialize MC data")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] usbvision: fix locking error
Insu Yun [Mon, 1 Feb 2016 15:59:30 +0000 (13:59 -0200)]
[media] usbvision: fix locking error

When remove_pending is non-zero, v4l2_lock is never unlocked.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rc/nuvoton_cir: fix locking issue when calling nvt_disable_cir
Heiner Kallweit [Mon, 1 Feb 2016 20:50:55 +0000 (18:50 -0200)]
[media] rc/nuvoton_cir: fix locking issue when calling nvt_disable_cir

nvt_disable_cir calls nvt_disable_logical_dev (that may sleep) and is
called from contexts holding a spinlock.
Fix this and remove the unneeded clearing of CIR_IREN as this is done
in nvt_cir_disable already.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rc/nuvoton_cir: fix locking issue when calling nvt_enable_wake
Heiner Kallweit [Mon, 1 Feb 2016 20:50:26 +0000 (18:50 -0200)]
[media] rc/nuvoton_cir: fix locking issue when calling nvt_enable_wake

nvt_enable_wake calls nvt_select_logical_dev (that may sleep) and is called
from contexts holding a spinlock. Fix this.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] rc/nuvoton_cir: fix locking issue with nvt_enable_cir
Heiner Kallweit [Mon, 1 Feb 2016 20:49:32 +0000 (18:49 -0200)]
[media] rc/nuvoton_cir: fix locking issue with nvt_enable_cir

nvt_enable_cir calls nvt_enable_logical_dev (that may sleep)
while holding a spinlock.
This patch fixes this and moves the content of nvt_enable_cir
to nvt_open as this is the only caller.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dvb-frontend: Use boottime
Abhilash Jindal [Sun, 31 Jan 2016 05:47:31 +0000 (03:47 -0200)]
[media] dvb-frontend: Use boottime

Wall time obtained from ktime_get_real is susceptible to sudden jumps due to
user setting the time or due to NTP.  Boot time is constantly increasing time
better suited for comparing two timestamps.

[mchehab@osg.samsung.com: fix trivial merge conflicts]
Signed-off-by: Abhilash Jindal <klock.android@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Media Controller fix to not let stream_count go negative
Shuah Khan [Sat, 30 Jan 2016 20:10:52 +0000 (18:10 -0200)]
[media] media: Media Controller fix to not let stream_count go negative

Change media_entity_pipeline_stop() to not decrement
stream_count of an inactive media pipeline. Doing so,
results in preventing starting the pipeline.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: Fix media_open() to clear filp->private_data in error leg
Shuah Khan [Wed, 27 Jan 2016 23:49:33 +0000 (21:49 -0200)]
[media] media: Fix media_open() to clear filp->private_data in error leg

Fix media_open() to clear filp->private_data when file open
fails.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: remove MEDIA_TUNER dependency for VIDEO_TUNER
Arnd Bergmann [Tue, 26 Jan 2016 21:46:02 +0000 (19:46 -0200)]
[media] v4l: remove MEDIA_TUNER dependency for VIDEO_TUNER

em28xx selects VIDEO_TUNER, which has a dependency on MEDIA_TUNER,
so we get a Kconfig warning if that is disabled:

warning: (VIDEO_PVRUSB2 && VIDEO_USBVISION && VIDEO_GO7007 && VIDEO_AU0828_V4L2 && VIDEO_CX231XX && VIDEO_TM6000 && VIDEO_EM28XX && VIDEO_IVTV && VIDEO_MXB && VIDEO_CX18 && VIDEO_CX23885 && VIDEO_CX88 && VIDEO_BT848 && VIDEO_SAA7134 && VIDEO_SAA7164) selects VIDEO_TUNER which has unmet direct dependencies (MEDIA_SUPPORT && MEDIA_TUNER)

VIDEO_TUNER does not actually depend on MEDIA_TUNER, and the
dependency does nothing except cause the above warning, so let's
remove it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] b2c2: flexcop: avoid unused function warnings
Arnd Bergmann [Tue, 26 Jan 2016 14:09:58 +0000 (12:09 -0200)]
[media] b2c2: flexcop: avoid unused function warnings

The flexcop driver has two functions that are normally used, except
when multiple frontend drivers are disabled:

drivers/media/common/b2c2/flexcop-fe-tuner.c:42:12: warning: 'flexcop_set_voltage' defined but not used [-Wunused-function]
drivers/media/common/b2c2/flexcop-fe-tuner.c:71:12: warning: 'flexcop_sleep' defined but not used [-Wunused-function]

This avoids the build warning by updating the #ifdef for flexcop_set_voltage
to the exact condition under which it is used. For flexcop_sleep, the
condition is rather complex, so I resort to marking it as __maybe_unused,
so the compiler can silently drop it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] hdpvr: hide unused variable
Arnd Bergmann [Tue, 26 Jan 2016 14:09:56 +0000 (12:09 -0200)]
[media] hdpvr: hide unused variable

The i2c client pointer is only used when CONFIG_I2C is set, and
otherwise produces a compile-time warning:

drivers/media/usb/hdpvr/hdpvr-core.c: In function 'hdpvr_probe':
drivers/media/usb/hdpvr/hdpvr-core.c:276:21: error: unused variable 'client' [-Werror=unused-variable]

This uses the same #ifdef to hide the variable when the code using
it is hidden.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media: platform: exynos4-is: media-dev: Add missing of_node_put
Amitoj Kaur Chawla [Mon, 25 Jan 2016 15:21:37 +0000 (13:21 -0200)]
[media] media: platform: exynos4-is: media-dev: Add missing of_node_put

for_each_available_child_of_node and for_each_child_of_node perform an
of_node_get on each iteration, so to break out of the loop an of_node_put is
required.

Found using Coccinelle. The simplified version of the semantic patch
that is used for this is as follows:

// <smpl>
@@
local idexpression n;
expression e,r;
@@

 for_each_available_child_of_node(r,n) {
   ...
(
   of_node_put(n);
|
   e = n
|
+  of_node_put(n);
?  break;
)
   ...
 }
... when != n
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dvbdev: the space is required after ','
Xiubo Li [Fri, 15 Jan 2016 05:14:59 +0000 (03:14 -0200)]
[media] dvbdev: the space is required after ','

The space is missing after ',', and this will be introduce much
noise when checking new patch around them.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dvbdev: replace kcalloc with kzalloc
Xiubo Li [Fri, 15 Jan 2016 05:14:58 +0000 (03:14 -0200)]
[media] dvbdev: replace kcalloc with kzalloc

Since the number of elements equals to 1, so just use kzalloc to
simplify the code and make it more readable.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] dvbdev: remove useless parentheses after return
Xiubo Li [Fri, 15 Jan 2016 05:15:00 +0000 (03:15 -0200)]
[media] dvbdev: remove useless parentheses after return

The parentheses are not required after return, and just remove it.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] pwc: Add USB id for Philips Spc880nc webcam
Hans de Goede [Fri, 22 Jan 2016 10:53:55 +0000 (08:53 -0200)]
[media] pwc: Add USB id for Philips Spc880nc webcam

SPC 880NC PC camera discussions:
http://www.pclinuxos.com/forum/index.php/topic,135688.0.html

Cc: stable@vger.kernel.org
Reported-by: Kikim <klucznik0@op.pl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] s5c73m3: remove duplicate module device table
Arnd Bergmann [Wed, 13 Jan 2016 14:23:51 +0000 (12:23 -0200)]
[media] s5c73m3: remove duplicate module device table

Clang complains about an extraneous definition of the module
device table after the patch to add it was accidentally merged
twice:

../drivers/media/i2c/s5c73m3/s5c73m3-spi.c:40:1: error: redefinition of
      '__mod_of__s5c73m3_spi_ids_device_table'
MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids);
^
../include/linux/module.h:223:27: note: expanded from macro 'MODULE_DEVICE_TABLE'
extern const typeof(name) __mod_##type##__##name##_device_table         \
                          ^
<scratch space>:99:1: note: expanded from here
__mod_of__s5c73m3_spi_ids_device_table

This removes the second definition.

Fixes: f934a94bb566 ("[media] s5c73m3: Export OF module alias information")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] omap3isp: Check v4l2_of_parse_endpoint() return value
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:16 +0000 (14:47 -0200)]
[media] omap3isp: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] exynos4-is: Check v4l2_of_parse_endpoint() return value
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:15 +0000 (14:47 -0200)]
[media] exynos4-is: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] tvp7002: Check v4l2_of_parse_endpoint() return value
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:14 +0000 (14:47 -0200)]
[media] tvp7002: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] tvp514x: Check v4l2_of_parse_endpoint() return value
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:13 +0000 (14:47 -0200)]
[media] tvp514x: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] s5k5baf: Check v4l2_of_parse_endpoint() return value
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:12 +0000 (14:47 -0200)]
[media] s5k5baf: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] s5c73m3: Check v4l2_of_parse_endpoint() return value
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:11 +0000 (14:47 -0200)]
[media] s5c73m3: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] adv7604: Check v4l2_of_parse_endpoint() return value
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:10 +0000 (14:47 -0200)]
[media] adv7604: Check v4l2_of_parse_endpoint() return value

The v4l2_of_parse_endpoint() function can fail so check the return value.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: of: Correct v4l2_of_parse_endpoint() kernel-doc
Javier Martinez Canillas [Mon, 11 Jan 2016 16:47:09 +0000 (14:47 -0200)]
[media] v4l: of: Correct v4l2_of_parse_endpoint() kernel-doc

The v4l2_of_parse_endpoint function kernel-doc says that the return value
is always 0. But that is not true since the function can fail and a error
negative code is returned on failure. So correct the kernel-doc to match.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l: Merge the YUV and YVU 4:2:0 tri-planar non-contiguous formats docs
Laurent Pinchart [Mon, 11 Jan 2016 04:07:42 +0000 (02:07 -0200)]
[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>
8 years ago[media] rcar_jpu: Add R-Car Gen2 Fallback Compatibility String
Simon Horman [Mon, 11 Jan 2016 02:13:20 +0000 (00:13 -0200)]
[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>
8 years ago[media] netup_unidvb: Remove a useless memset
Christophe JAILLET [Sun, 10 Jan 2016 07:20:16 +0000 (05:20 -0200)]
[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>
8 years ago[media] ts2020: cancel_delayed_work_sync before device removal / kfree
Ernst Martin Witte [Sat, 9 Jan 2016 20:18:44 +0000 (18:18 -0200)]
[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>
8 years ago[media] rtl2830: cancel_delayed_work_sync before device removal / kfree
Ernst Martin Witte [Sat, 9 Jan 2016 20:18:47 +0000 (18:18 -0200)]
[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>
8 years ago[media] si2157: cancel_delayed_work_sync before device removal / kfree
Ernst Martin Witte [Sat, 9 Jan 2016 20:18:43 +0000 (18:18 -0200)]
[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>
8 years ago[media] af9033: cancel_delayed_work_sync before device removal / kfree
Ernst Martin Witte [Sat, 9 Jan 2016 20:18:46 +0000 (18:18 -0200)]
[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>
8 years ago[media] af9013: cancel_delayed_work_sync before device removal / kfree
Ernst Martin Witte [Sat, 9 Jan 2016 20:18:45 +0000 (18:18 -0200)]
[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>
8 years ago[media] rtl28xxu: retry failed i2c messages
Antti Palosaari [Thu, 7 Jan 2016 08:35:21 +0000 (06:35 -0200)]
[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>
8 years ago[media] dvb-usb-dvbsky: add new product id for TT CT2-4650 CI
Torbjörn Jansson [Wed, 6 Jan 2016 16:26:31 +0000 (14:26 -0200)]
[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>
8 years ago[media] af9035: add support for 2nd tuner of MSI DigiVox Diversity
Stefan Pöschel [Mon, 4 Jan 2016 21:16:55 +0000 (19:16 -0200)]
[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>
8 years ago[media] dw2102: Add support for Terratec Cinergy S2 USB BOX
Philipp Zabel [Mon, 4 Jan 2016 19:32:51 +0000 (17:32 -0200)]
[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>
8 years ago[media] si2157.c: fix frequency range
Andrei Koshkosh [Mon, 4 Jan 2016 01:31:26 +0000 (23:31 -0200)]
[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>
8 years ago[media] media: rc: nuvoton-cir: improve locking in both interrupt handlers
Heiner Kallweit [Wed, 30 Dec 2015 16:46:29 +0000 (14:46 -0200)]
[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>
8 years ago[media] media: rc: nuvoton-cir: fix interrupt handling
Heiner Kallweit [Wed, 30 Dec 2015 16:45:51 +0000 (14:45 -0200)]
[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>
8 years ago[media] media: rc: nuvoton-cir: fix wakeup interrupt bits
Heiner Kallweit [Wed, 30 Dec 2015 16:45:00 +0000 (14:45 -0200)]
[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>
8 years ago[media] media: rc: nuvoton-cir: add locking to calls of nvt_enable_wake
Heiner Kallweit [Wed, 30 Dec 2015 16:44:36 +0000 (14:44 -0200)]
[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>
8 years ago[media] media: rc: nuvoton-cir: improve nvt_hw_detect
Heiner Kallweit [Wed, 30 Dec 2015 16:43:29 +0000 (14:43 -0200)]
[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>
8 years ago[media] media: v4l: Dual license v4l2-common.h under GPL v2 and BSD licenses
Sakari Ailus [Mon, 11 Jan 2016 13:21:15 +0000 (11:21 -0200)]
[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>
8 years ago[media] media: ti-vpe: Add CAL v4l2 camera capture driver
Benoit Parrot [Wed, 6 Jan 2016 23:37:26 +0000 (21:37 -0200)]
[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>
8 years ago[media] MAINTAINERS: Add ti-vpe maintainer entry
Benoit Parrot [Wed, 6 Jan 2016 23:37:25 +0000 (21:37 -0200)]
[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>
8 years ago[media] media: ti-vpe: Document CAL driver
Benoit Parrot [Wed, 6 Jan 2016 23:37:24 +0000 (21:37 -0200)]
[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>
8 years ago[media] vivid: fix broken Bayer text rendering
Hans Verkuil [Fri, 22 Jan 2016 15:13:25 +0000 (13:13 -0200)]
[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>
8 years ago[media] media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32
Tiffany Lin [Tue, 19 Jan 2016 07:56:50 +0000 (05:56 -0200)]
[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>
8 years ago[media] DocBook media: make explicit that standard/timings never change automatically
Hans Verkuil [Thu, 24 Dec 2015 13:18:10 +0000 (11:18 -0200)]
[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>
8 years ago[media] media: adv7604: implement get_selection
Ulrich Hecht [Tue, 22 Dec 2015 14:22:01 +0000 (12:22 -0200)]
[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>
8 years ago[media] tc358743: Use local array with fixed size in i2c write
Mats Randgaard [Thu, 10 Dec 2015 13:38:07 +0000 (11:38 -0200)]
[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>
8 years ago[media] v4l2-dv-timings: skip standards check for V4L2_DV_BT_CAP_CUSTOM
Hans Verkuil [Wed, 13 Jan 2016 13:44:41 +0000 (11:44 -0200)]
[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>
8 years ago[media] radio-si476x: add return value check to avoid dead code
Fugang Duan [Mon, 11 Jan 2016 07:13:35 +0000 (05:13 -0200)]
[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>
8 years ago[media] cx231xx: Fix memory leak
Jean-Baptiste Theou [Fri, 8 Jan 2016 22:02:03 +0000 (20:02 -0200)]
[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>
8 years ago[media] wl128x: fix typo in MODULE_PARM_DESC
Dan Carpenter [Fri, 8 Jan 2016 11:02:56 +0000 (09:02 -0200)]
[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>
8 years ago[media] staging: media: lirc: fix MODULE_PARM_DESC typo
Dan Carpenter [Fri, 8 Jan 2016 10:57:58 +0000 (08:57 -0200)]
[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>
8 years ago[media] vpx3220: signedness bug in vpx3220_fp_read()
Dan Carpenter [Wed, 6 Jan 2016 10:05:52 +0000 (08:05 -0200)]
[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>
8 years ago[media] coda: fix first encoded frame payload
Philipp Zabel [Mon, 4 Jan 2016 19:30:09 +0000 (17:30 -0200)]
[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: 2d7007153f0c ("[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>
8 years ago[media] media: bt8xx: constify sp887x_config structure
Julia Lawall [Sun, 3 Jan 2016 12:27:53 +0000 (10:27 -0200)]
[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>
8 years ago[media] media: bt8xx: constify or51211_config structure
Julia Lawall [Sun, 3 Jan 2016 12:19:52 +0000 (10:19 -0200)]
[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>
8 years ago[media] drivers/media/usb/dvb-usb-v2: constify mxl111sf_tuner_config structure
Julia Lawall [Sun, 3 Jan 2016 12:11:06 +0000 (10:11 -0200)]
[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>
8 years ago[media] av7110: constify sp8870_config structure
Julia Lawall [Sun, 3 Jan 2016 11:58:14 +0000 (09:58 -0200)]
[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>
8 years ago[media] usbtv: correctly handling failed allocation
Insu Yun [Tue, 29 Dec 2015 21:48:29 +0000 (19:48 -0200)]
[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>
8 years ago[media] cx231xx: correctly handling failed allocation
Insu Yun [Tue, 29 Dec 2015 18:53:35 +0000 (16:53 -0200)]
[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>
8 years ago[media] hdpvr: Refactoring for hdpvr_read()
Markus Elfring [Tue, 29 Dec 2015 10:02:43 +0000 (08:02 -0200)]
[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>
8 years ago[media] au0828: Refactoring for start_urb_transfer()
Markus Elfring [Mon, 28 Dec 2015 21:52:48 +0000 (19:52 -0200)]
[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>
8 years ago[media] bttv: Returning only value constants in two functions
Markus Elfring [Sun, 27 Dec 2015 21:02:21 +0000 (19:02 -0200)]
[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>
8 years ago[media] vim2m: return error if driver registration fails
Niklas Söderlund [Fri, 25 Dec 2015 17:25:16 +0000 (15:25 -0200)]
[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>
8 years ago[media] stk1160: Remove redundant vb2_buf payload set
Ezequiel Garcia [Thu, 24 Dec 2015 20:06:45 +0000 (18:06 -0200)]
[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>
8 years ago[media] bttv-driver, usbvision-video: use to_video_device()
Geliang Tang [Tue, 22 Dec 2015 15:38:04 +0000 (13:38 -0200)]
[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>
8 years ago[media] usbtv: discard redundant video fields
Nikola Forró [Sun, 20 Dec 2015 11:57:17 +0000 (09:57 -0200)]
[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>
8 years ago[media] saa7134: add DMABUF support
Hans Verkuil [Mon, 14 Dec 2015 10:17:00 +0000 (08:17 -0200)]
[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>
8 years ago[media] go7007: constify go7007_hpi_ops structures
Julia Lawall [Fri, 11 Dec 2015 16:16:48 +0000 (14:16 -0200)]
[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>
8 years ago[media] tc358743: Print timings only when debug level is set
Mats Randgaard [Thu, 10 Dec 2015 14:00:31 +0000 (12:00 -0200)]
[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>
8 years ago[media] media: videobuf2-core: Fix one __qbuf_dmabuf() error path
Wu, Xia [Wed, 9 Dec 2015 07:26:26 +0000 (05:26 -0200)]
[media] media: videobuf2-core: Fix one __qbuf_dmabuf() error path

Add dma_buf_put() to decrease refcount of the dmabuf in error path if DMABUF size is smaller than the requirement.

Signed-off-by: wu xia <xia.wu@intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] drivers/media/usb/as102: constify as102_priv_ops_t structure
Julia Lawall [Sun, 6 Dec 2015 15:51:38 +0000 (13:51 -0200)]
[media] drivers/media/usb/as102: constify as102_priv_ops_t structure

The as102_priv_ops_t 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>
8 years ago[media] constify stv6110x_devctl structure
Julia Lawall [Sun, 6 Dec 2015 15:34:26 +0000 (13:34 -0200)]
[media] constify stv6110x_devctl structure

The stv6110x_devctl 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>
8 years ago[media] em28xx: add media controller support
Mauro Carvalho Chehab [Wed, 27 Jan 2016 09:07:24 +0000 (07:07 -0200)]
[media] em28xx: add media controller support

Add the needed bits to make em28xx to create a media
controller graph.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] mt9v011: add media controller support
Mauro Carvalho Chehab [Fri, 29 Jan 2016 16:33:12 +0000 (14:33 -0200)]
[media] mt9v011: add media controller support

Create a source pad and set the media controller type to the sensor.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: avoid divide by zero error
Mauro Carvalho Chehab [Fri, 29 Jan 2016 16:05:11 +0000 (14:05 -0200)]
[media] em28xx: avoid divide by zero error

[ 1841.243670] divide error: 0000 [#1] SMP KASAN
[ 1841.243994] Modules linked in: em28xx_rc rc_core tda18271 drxk em28xx_dvb dvb_core em28xx_alsa mt9v011 em28xx_v4l videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core em28xx tveeprom v4l2_common videodev media cpufreq_powersave cpufreq_conservative cpufreq_userspace cpufreq_stats parport_pc ppdev lp parport snd_hda_codec_hdmi intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm iTCO_wdt iTCO_vendor_support irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel sha256_ssse3 sha256_generic hmac drbg i915 snd_hda_codec_realtek snd_hda_codec_generic aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd btusb i2c_algo_bit snd_hda_intel btrtl drm_kms_helper btbcm evdev snd_hda_codec btintel psmouse bluetooth pcspkr snd_hwdep sg drm serio_raw
[ 1841.244845]  snd_hda_core snd_pcm mei_me rfkill snd_timer mei snd lpc_ich soundcore shpchp i2c_i801 mfd_core battery dw_dmac i2c_designware_platform i2c_designware_core dw_dmac_core video acpi_pad button tpm_tis tpm ext4 crc16 mbcache jbd2 dm_mod hid_generic usbhid sd_mod ahci libahci libata ehci_pci e1000e xhci_pci ptp scsi_mod ehci_hcd xhci_hcd pps_core fan thermal sdhci_acpi sdhci mmc_core i2c_hid hid [last unloaded: tveeprom]
[ 1841.245342] CPU: 2 PID: 38 Comm: kworker/2:1 Tainted: G        W       4.5.0-rc1+ #43
[ 1841.245413] Hardware name:                  /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
[ 1841.245503] Workqueue: events request_module_async [em28xx]
[ 1841.245557] task: ffff88009df10000 ti: ffff88009df18000 task.ti: ffff88009df18000
[ 1841.245626] RIP: 0010:[<ffffffffa135a0ad>]  [<ffffffffa135a0ad>] size_to_scale+0xed/0x2c0 [em28xx_v4l]
[ 1841.245714] RSP: 0018:ffff88009df1faa8  EFLAGS: 00010246
[ 1841.245756] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8803bb933b38
[ 1841.245815] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8803bb933b00
[ 1841.245879] RBP: ffff88009df1fad8 R08: ffff8803bb933b3c R09: 1ffff10077726760
[ 1841.245944] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[ 1841.246006] R13: 0000000000000000 R14: dffffc0000000000 R15: ffff8803b391a130
[ 1841.246071] FS:  0000000000000000(0000) GS:ffff8803c6900000(0000) knlGS:0000000000000000
[ 1841.246141] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1841.246194] CR2: 0000000001d97008 CR3: 00000003bdd85000 CR4: 00000000003406e0
[ 1841.246256] Stack:
[ 1841.246278]  0000000000000246 ffff8803bb9321f0 ffff8803bb932270 ffffffffa136f7a0
[ 1841.246359]  0000000000000000 ffff8803bb932130 ffff88009df1fb20 ffffffffa13646a0
[ 1841.246439]  ffffffffa127f206 ffff8803bb932130 ffff8803bb932130 ffff8803b391a130
[ 1841.246517] Call Trace:
[ 1841.246548]  [<ffffffffa13646a0>] em28xx_set_video_format+0x140/0x1e0 [em28xx_v4l]

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: make sure that the device has video
Mauro Carvalho Chehab [Fri, 29 Jan 2016 14:53:56 +0000 (12:53 -0200)]
[media] em28xx: make sure that the device has video

There are some devices, like Terratec Cinergy HTC, where
while the device supports analog TV, the driver is not
capable yet of handling it, because the analog TV driver
was not written.

So, don't bind the em28xx-v4l drivers on such devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: fix tuner detection for Pixelview Prolink PlayTV USB 2.0
Mauro Carvalho Chehab [Fri, 29 Jan 2016 12:11:57 +0000 (10:11 -0200)]
[media] em28xx: fix tuner detection for Pixelview Prolink PlayTV USB 2.0

The tuner is at address 0x60. This address is not probed by
default by tuner anymore, so we need to explicitly add it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] em28xx: unregister devices in case of failure
Mauro Carvalho Chehab [Fri, 29 Jan 2016 15:08:19 +0000 (13:08 -0200)]
[media] em28xx: unregister devices in case of failure

If something bad happens during device registration, unregister
the already registered devices.

Without that, it will have lots of KASAN errors when udev
would try to open the devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] saa7115: initialize demod type and add the needed pads
Mauro Carvalho Chehab [Fri, 29 Jan 2016 10:44:28 +0000 (08:44 -0200)]
[media] saa7115: initialize demod type and add the needed pads

The saa7115 driver is used on several em28xx-based devices.
Now that we're about to add MC support to em28xx, we need to
be sure that the saa711x demod will be properly mapped at MC.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] tvp5150: identify it as a MEDIA_ENT_F_ATV_DECODER
Mauro Carvalho Chehab [Wed, 27 Jan 2016 17:09:15 +0000 (15:09 -0200)]
[media] tvp5150: identify it as a MEDIA_ENT_F_ATV_DECODER

The tvp5150 is an analog TV decoder. Identify as such at
the media graph, or otherwise devices using it would fail.

That avoids the following warning:
[ 1546.669139] usb 2-3.3: Entity type for entity tvp5150 5-005c was not initialized!

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] msp3400: initialize MC data
Mauro Carvalho Chehab [Thu, 28 Jan 2016 10:51:01 +0000 (08:51 -0200)]
[media] msp3400: initialize MC data

Add pads and set the device type when used with the media
controller.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] tvp5150: create the expected number of pads
Mauro Carvalho Chehab [Wed, 27 Jan 2016 14:08:13 +0000 (12:08 -0200)]
[media] tvp5150: create the expected number of pads

The tvp5150 doesn't have just one pad. It has 3 ones:
- IF input
- Video output
- VBI output

Fix it and use the macros for the pad indexes.

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc: add analog TV demodulator pad index macros
Mauro Carvalho Chehab [Fri, 29 Jan 2016 09:00:57 +0000 (07:00 -0200)]
[media] v4l2-mc: add analog TV demodulator pad index macros

We also need to standardize the PAD index macros for demods,
as they all should look the same in a media graph.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc.h Add pads for audio and video IF-PLL decoders
Mauro Carvalho Chehab [Fri, 29 Jan 2016 09:00:37 +0000 (07:00 -0200)]
[media] v4l2-mc.h Add pads for audio and video IF-PLL decoders

The audio and video IF-PLL decoders have one sink and one source
PAD. Add macro names for those pads and describe what kind of
signals are represented at such pads.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] media.h: add support for IF-PLL video/sound decoder
Mauro Carvalho Chehab [Thu, 28 Jan 2016 09:28:08 +0000 (07:28 -0200)]
[media] media.h: add support for IF-PLL video/sound decoder

Very old hardware may have an analog stage tuner. Those hardware
consists of a PLL that converts a RF signal into IF signals.

Depending on the hardware, those video IF signal can be
decoded directly by the bridge chipset. Most Conexant
chips (bt8x8, cx2388x, etc) have internally the decoders
for that. Yet, even on such hardware, the tuner may have
internally its own TV multi-standard decoder like tda9887.

The same happens with the audio IF signal, where some bridges
are capable of receiving it, while others require an external
IF-PLL sound decoder, like msp3400.

Those external IF-PLL audio and video decoders have their own
I2C address, and use different drivers to handle them. So, they're
mapped as different subdevices on Linux.

Thankfully, all modern hardware comes with an IC chip that
has both the RF and the IF stages on it, being capable of
decoding audio and video IF signals internally.

Yet, as we need to support drivers that can work with either
analog or silicon tuners, we need to add two entity types
for those old hardware.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc.h: Split audio from baseband output
Mauro Carvalho Chehab [Fri, 29 Jan 2016 09:00:08 +0000 (07:00 -0200)]
[media] v4l2-mc.h: Split audio from baseband output

Analog TV tuners have a separate output pad for the audio
IF or audio sampled data. This pad is connected to a different
chipset.

Add an extra pad for it and improve the documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] v4l2-mc.h: move tuner PAD definitions to this new header
Mauro Carvalho Chehab [Fri, 29 Jan 2016 08:11:30 +0000 (06:11 -0200)]
[media] v4l2-mc.h: move tuner PAD definitions to this new header

The customer PC hardware can be shipped with lots of different
configurations, as vendors use to replace some of the chips on
their hardware along the time. All drivers that support such
devices are prepared to handle the hardware differences, using
their own auto-probing logic.

They do it in a way that number of inputs and outputs for a given
hardware type doesn't change.

Now that we're adding media controller capabilities to those drivers,
we need to standardize the number of inputs and outputs for each
hardware type, as we want to have a generic function at the V4L2
core that would create the links for the entities that are expected
on such hardware.

Such standard is already there for tuners, but tuner.h is not the
best place to store such data, as we'll need to add definitions also
for analog TV demodulators.

Also, we'll need a place to put a set of MC handling functions. So,
let's create a v4l2-mc.h to store such kind of definitions.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
8 years ago[media] tuner.h: rename TUNER_PAD_IF_OUTPUT to TUNER_PAD_OUTPUT
Mauro Carvalho Chehab [Wed, 27 Jan 2016 10:39:33 +0000 (08:39 -0200)]
[media] tuner.h: rename TUNER_PAD_IF_OUTPUT to TUNER_PAD_OUTPUT

The output of a tuner is not only IF frequencies. They may also
output audio on some of its pins, and may even be a zero-IF tuner,
with outputs a baseband. So, rename the PAD name to make it
clearer and add a proper documentation about that at tuner.h.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>