OSDN Git Service

uclinux-h8/linux.git
6 years agomedia: v4l: async: Fix notifier complete callback error handling
Sakari Ailus [Mon, 2 Oct 2017 10:24:54 +0000 (06:24 -0400)]
media: v4l: async: Fix notifier complete callback error handling

The notifier complete callback may return an error. This error code was
simply returned to the caller but never handled properly.

Move calling the complete callback function to the caller from
v4l2_async_test_notify and undo the work that was done either in async
sub-device or async notifier registration.

Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l: async: fix unbind error in v4l2_async_notifier_unregister()
Niklas Söderlund [Mon, 2 Oct 2017 20:16:52 +0000 (16:16 -0400)]
media: v4l: async: fix unbind error in v4l2_async_notifier_unregister()

The call to v4l2_async_cleanup() will set sd->asd to NULL so passing it to
notifier->unbind() has no effect and leaves the notifier confused. Call
the unbind() callback prior to cleaning up the subdevice to avoid this.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l: async: Don't set sd->dev NULL in v4l2_async_cleanup
Sakari Ailus [Tue, 3 Oct 2017 11:10:41 +0000 (07:10 -0400)]
media: v4l: async: Don't set sd->dev NULL in v4l2_async_cleanup

v4l2_async_cleanup() is called when the async sub-device is unbound from
the media device. As the pointer is set by the driver registering the
async sub-device, leave the pointer as set by the driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l: async: Remove re-probing support
Sakari Ailus [Tue, 5 Sep 2017 12:11:59 +0000 (08:11 -0400)]
media: v4l: async: Remove re-probing support

Remove V4L2 async re-probing support. The re-probing support has been
there to support cases where the sub-devices require resources provided by
the main driver's hardware to function, such as clocks.

Reprobing has allowed unbinding and again binding the main driver without
explicitly unbinding the sub-device drivers. This is certainly not a
common need, and the responsibility will be the user's going forward.

An alternative could have been to introduce notifier specific locks.
Considering the complexity of the re-probing and that it isn't really a
solution to a problem but a workaround, remove re-probing instead.

If there is a need to support the clock provider unregister/register cycle
while keeping the clock references in the consumers in the future, this
should be implemented in the clock framework instead, not in V4L2.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov9650: remove unnecessary terminated entry in menu items array
Akinobu Mita [Mon, 23 Oct 2017 17:30:26 +0000 (13:30 -0400)]
media: ov9650: remove unnecessary terminated entry in menu items array

The test_pattern_menu[] array has two valid items and a null terminated
item.  So the control's maximum value which is passed to
v4l2_ctrl_new_std_menu_items() should be one.  However,
'ARRAY_SIZE(test_pattern_menu) - 1' is actually passed and it's not
correct.

Fix it by removing unnecessary terminated entry and let the correct
control's maximum value be passed to v4l2_ctrl_new_std_menu_items().

Cc: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov5640: don't clear V4L2_SUBDEV_FL_IS_I2C
Akinobu Mita [Thu, 19 Oct 2017 16:31:23 +0000 (12:31 -0400)]
media: ov5640: don't clear V4L2_SUBDEV_FL_IS_I2C

The v4l2_i2c_subdev_init() sets V4L2_SUBDEV_FL_IS_I2C flag in the
subdev->flags.  But this driver overwrites subdev->flags immediately after
calling v4l2_i2c_subdev_init().  So V4L2_SUBDEV_FL_IS_I2C is not set after
all.

This stops breaking subdev->flags and preserves V4L2_SUBDEV_FL_IS_I2C.

Side note: According to the comment in v4l2_device_unregister(), this is
problematic only if the device is platform bus device.  Device tree or
ACPI based devices are not affected.

Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: ov2640: don't clear V4L2_SUBDEV_FL_IS_I2C
Akinobu Mita [Thu, 19 Oct 2017 16:31:22 +0000 (12:31 -0400)]
media: ov2640: don't clear V4L2_SUBDEV_FL_IS_I2C

The v4l2_i2c_subdev_init() sets V4L2_SUBDEV_FL_IS_I2C flag in the
subdev->flags.  But this driver overwrites subdev->flags immediately after
calling v4l2_i2c_subdev_init().  So V4L2_SUBDEV_FL_IS_I2C is not set after
all.

This stops breaking subdev->flags and preserves V4L2_SUBDEV_FL_IS_I2C.

Side note: According to the comment in v4l2_device_unregister(), this is
problematic only if the device is platform bus device.  Device tree or
ACPI based devices are not affected.

Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: max2175: don't clear V4L2_SUBDEV_FL_IS_I2C
Akinobu Mita [Thu, 19 Oct 2017 16:31:21 +0000 (12:31 -0400)]
media: max2175: don't clear V4L2_SUBDEV_FL_IS_I2C

The v4l2_i2c_subdev_init() sets V4L2_SUBDEV_FL_IS_I2C flag in the
subdev->flags.  But this driver overwrites subdev->flags immediately after
calling v4l2_i2c_subdev_init().  So V4L2_SUBDEV_FL_IS_I2C is not set after
all.

This stops breaking subdev->flags and preserves V4L2_SUBDEV_FL_IS_I2C.

Side note: According to the comment in v4l2_device_unregister(), this is
problematic only if the device is platform bus device.  Device tree or
ACPI based devices are not affected.

Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: adv7180: don't clear V4L2_SUBDEV_FL_IS_I2C
Akinobu Mita [Thu, 19 Oct 2017 16:31:20 +0000 (12:31 -0400)]
media: adv7180: don't clear V4L2_SUBDEV_FL_IS_I2C

The v4l2_i2c_subdev_init() sets V4L2_SUBDEV_FL_IS_I2C flag in the
subdev->flags.  But this driver overwrites subdev->flags immediately after
calling v4l2_i2c_subdev_init().  So V4L2_SUBDEV_FL_IS_I2C is not set after
all.

This stops breaking subdev->flags and preserves V4L2_SUBDEV_FL_IS_I2C.

Side note: According to the comment in v4l2_device_unregister(), this is
problematic only if the device is platform bus device.  Device tree or
ACPI based devices are not affected.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: st-hva: hva-h264: use swap macro in hva_h264_encode
Gustavo A. R. Silva [Mon, 30 Oct 2017 04:18:47 +0000 (00:18 -0400)]
media: st-hva: hva-h264: use swap macro in hva_h264_encode

Make use of the swap macro and remove unnecessary variable tmp_frame.
This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: atmel-isc: Fix clock ID for clk_prepare/unprepare
Wenyou Yang [Mon, 30 Oct 2017 00:46:50 +0000 (20:46 -0400)]
media: atmel-isc: Fix clock ID for clk_prepare/unprepare

Fix the clock ID to do the runtime pm should be ISC_ISPCK,
instead of ISC_MCK in clk_prepare(), clk_unprepare() and
isc_clk_is_enabled().

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: bdisp: remove redundant assignment to pix
Colin Ian King [Sun, 29 Oct 2017 13:43:39 +0000 (09:43 -0400)]
media: bdisp: remove redundant assignment to pix

Pointer pix is being initialized to a value and a little later
being assigned the same value again. Remove the initial assignment to
avoid a duplicate assignment. Cleans up the clang warning:

drivers/media/platform/sti/bdisp/bdisp-v4l2.c:726:26: warning: Value
stored to 'pix' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: gspca: remove redundant assignment to variable j
Colin Ian King [Sun, 29 Oct 2017 13:06:07 +0000 (09:06 -0400)]
media: gspca: remove redundant assignment to variable j

Variable j is being set to zero before a loop and also
immediately inside the loop and is not used after the loop.
Hence the first assignment is redundant and can be removed.
Cleans up clang warning:

drivers/media/usb/gspca/gspca.c:1078:2: warning: Value stored
to 'j' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: mxl111sf: remove redundant assignment to index
Colin Ian King [Sun, 29 Oct 2017 12:50:58 +0000 (08:50 -0400)]
media: mxl111sf: remove redundant assignment to index

Variable index is set to zero and then set to zero again
a few lines later in a for loop initialization. Remove the
redundant setting of index to zero. Cleans up the clang
warning:

drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c:519:3: warning: Value
stored to 'index' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: camss-video.c: drop unused header
Hans Verkuil [Sat, 28 Oct 2017 09:19:50 +0000 (05:19 -0400)]
media: camss-video.c: drop unused header

Drop unused vb1 header.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: radio-raremono: remove redundant initialization of freq
Colin Ian King [Fri, 27 Oct 2017 16:20:08 +0000 (12:20 -0400)]
media: radio-raremono: remove redundant initialization of freq

Variable freq is initialized to f->frequency however this value
is never read and freq is later updated; hence the initialization
is redundant and can be removed.

Cleans up clang warning:
drivers/media/radio/radio-raremono.c:257:6: warning: Value stored
to 'freq' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: usbtv: fix brightness and contrast controls
Adam Sampson [Tue, 24 Oct 2017 20:14:46 +0000 (16:14 -0400)]
media: usbtv: fix brightness and contrast controls

Because the brightness and contrast controls share a register,
usbtv_s_ctrl needs to read the existing values for both controls before
inserting the new value. However, the code accidentally wrote to the
registers (from an uninitialised stack array), rather than reading them.

The user-visible effect of this was that adjusting the brightness would
also set the contrast to a random value, and vice versa -- so it wasn't
possible to correctly adjust the brightness of usbtv's video output.

Tested with an "EasyDAY" UTV007 device.

Fixes: c53a846c48f2 ("usbtv: add video controls")

Signed-off-by: Adam Sampson <ats@offog.org>
Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: s2255: Convert timers to use timer_setup()
Kees Cook [Tue, 24 Oct 2017 15:23:21 +0000 (11:23 -0400)]
media: s2255: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Cc: Mike Isely <isely@pobox.com>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: radio: Convert timers to use timer_setup()
Kees Cook [Tue, 24 Oct 2017 15:23:03 +0000 (11:23 -0400)]
media: radio: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: pci: Convert timers to use timer_setup()
Kees Cook [Tue, 24 Oct 2017 15:22:42 +0000 (11:22 -0400)]
media: pci: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Sergey Kozlov <serjk@netup.ru>
Cc: Abylay Ospan <aospan@netup.ru>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Geliang Tang <geliangtang@gmail.com>
Cc: Sean Young <sean@mess.org>
Cc: "Pali Rohár" <pali.rohar@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
[hans.verkuil@cisco.com: dropped pci/ttpci/av7110_ir.c patch chunk]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: tegra-cec: fix messy probe() cleanup
Hans Verkuil [Sat, 21 Oct 2017 08:37:49 +0000 (04:37 -0400)]
media: tegra-cec: fix messy probe() cleanup

The probe() cleanup code ('goto foo_error') was very messy. It appears
that this code wasn't updated when I switched to the devm_ functions
in an earlier version.

Update the code to use 'return error' where it can and do proper cleanup
where it needs to.

Note that the original code wasn't buggy, it was just messy.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: usb: usbtv: remove duplicate & operation
Jaejoong Kim [Fri, 20 Oct 2017 07:25:28 +0000 (03:25 -0400)]
media: usb: usbtv: remove duplicate & operation

usb_endpoint_maxp() has an inline keyword and searches for bits[10:0]
by & operation with 0x7ff. So, we can remove the duplicate & operation
with 0x7ff.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rockchip/rga: annotate PM functions as __maybe_unused
Arnd Bergmann [Thu, 19 Oct 2017 09:30:34 +0000 (05:30 -0400)]
media: rockchip/rga: annotate PM functions as __maybe_unused

The newly added driver has incorrect #ifdef annotations on its
PM functions, leading to a harmless compile-time warning when
CONFIG_PM is disabled:

drivers/media/platform/rockchip/rga/rga.c:760:13: error: 'rga_disable_clocks' defined but not used [-Werror=unused-function]
 static void rga_disable_clocks(struct rockchip_rga *rga)
             ^~~~~~~~~~~~~~~~~~
drivers/media/platform/rockchip/rga/rga.c:728:12: error: 'rga_enable_clocks' defined but not used [-Werror=unused-function]

This removes the #ifdef and marks the functions as __maybe_unused,
so gcc can silently drop all the unused code.

Fixes: f7e7b48e6d79 ("[media] rockchip/rga: v4l2 m2m support")

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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@s-opensource.com>
6 years agomedia: cec-pin: use IS_ERR instead of PTR_ERR_OR_ZERO
Hans Verkuil [Wed, 18 Oct 2017 08:11:46 +0000 (04:11 -0400)]
media: cec-pin: use IS_ERR instead of PTR_ERR_OR_ZERO

cec_allocate_adapter never returns NULL, so just use IS_ERR instead of
PTR_ERR_OR_ZERO.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: v4l2-ctrl: Fix flags field on Control events
Ricardo Ribalda [Tue, 17 Oct 2017 15:48:50 +0000 (11:48 -0400)]
media: v4l2-ctrl: Fix flags field on Control events

VIDIOC_DQEVENT and VIDIOC_QUERY_EXT_CTRL should give the same output for
the control flags field.

This patch creates a new function user_flags(), that calculates the user
exported flags value (which is different than the kernel internal flags
structure). This function is then used by all the code that exports the
internal flags to userspace.

Reported-by: Dimitrios Katsaros <patcherwork@gmail.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v3.17 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: davinci: make ccdc_hw_device structures const
Bhumika Goyal [Tue, 17 Oct 2017 12:27:25 +0000 (08:27 -0400)]
media: davinci: make ccdc_hw_device structures const

Make these structures const as they are only getting passed to the
functions vpfe_{register/unregister}_ccdc_device having the argument as
const.

Structures found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: davinci: make function arguments const
Bhumika Goyal [Tue, 17 Oct 2017 12:27:24 +0000 (08:27 -0400)]
media: davinci: make function arguments const

Make the function arguments of functions vpfe_{register/unregister}_ccdc_device
const as the pointer dev does not modify the fields of the structure
it points to. Also, declare the variable ccdc_dev const as it points to the
same structure as dev but it does not modify the fields as well.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: saa7134: Convert timers to use timer_setup()
Kees Cook [Mon, 16 Oct 2017 23:11:30 +0000 (19:11 -0400)]
media: saa7134: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: tvaudio: Convert timers to use timer_setup()
Kees Cook [Mon, 16 Oct 2017 23:10:53 +0000 (19:10 -0400)]
media: tvaudio: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: dvb-core: Convert timers to use timer_setup()
Kees Cook [Mon, 16 Oct 2017 23:10:47 +0000 (19:10 -0400)]
media: dvb-core: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: devendra sharma <devendra.sharma9091@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: saa7146: Convert timers to use timer_setup()
Kees Cook [Mon, 16 Oct 2017 23:10:42 +0000 (19:10 -0400)]
media: saa7146: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: tc358743: Convert timers to use timer_setup()
Kees Cook [Mon, 16 Oct 2017 23:10:27 +0000 (19:10 -0400)]
media: tc358743: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: media/saa7146: Convert timers to use timer_setup()
Kees Cook [Mon, 16 Oct 2017 23:10:12 +0000 (19:10 -0400)]
media: media/saa7146: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. This requires adding a pointer to
hold the timer's target file, as there won't be a way to pass this in the
future.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: radio-si470x: make si470x_viddev_template const
Bhumika Goyal [Wed, 27 Sep 2017 08:38:29 +0000 (04:38 -0400)]
media: radio-si470x: make si470x_viddev_template const

Make this const as it is only used in a copy operation in the files
referencing it. Add const to declaration in the header too.

Structure found using Coccienlle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx231xx: make cx231xx_vbi_qops const
Bhumika Goyal [Wed, 27 Sep 2017 08:05:43 +0000 (04:05 -0400)]
media: cx231xx: make cx231xx_vbi_qops const

Make this const as it is only passed to the const argument of the
function videobuf_queue_vmalloc_init in the file referencing it.
Also, make the declaration in the header const.

Structure found using Coccienlle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: omap_vout: Fix a possible null pointer dereference in omap_vout_open()
Markus Elfring [Sun, 24 Sep 2017 09:00:57 +0000 (05:00 -0400)]
media: omap_vout: Fix a possible null pointer dereference in omap_vout_open()

Move a debug message so that a null pointer access can not happen
for the variable "vout" in this function.

Fixes: 5c7ab6348e7b3fcca2b8ee548306c774472971e2 ("V4L/DVB: V4L2: Add support for OMAP2/3 V4L2 display driver on top of DSS2")

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@s-opensource.com>
6 years agomedia: cx231xx: Fix NTSC/PAL on Astrometa T2hybrid
Oleh Kravchenko [Sat, 28 Oct 2017 13:38:20 +0000 (09:38 -0400)]
media: cx231xx: Fix NTSC/PAL on Astrometa T2hybrid

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: cx231xx: Fix NTSC/PAL on Evromedia USB Full Hybrid Full HD
Oleh Kravchenko [Sat, 28 Oct 2017 13:38:19 +0000 (09:38 -0400)]
media: cx231xx: Fix NTSC/PAL on Evromedia USB Full Hybrid Full HD

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: mceusb: add support for 15f4:0135
Oleh Kravchenko [Sat, 28 Oct 2017 13:38:18 +0000 (09:38 -0400)]
media: rc: mceusb: add support for 15f4:0135

Astrometa T2hybrid (15f4:0135) has IR on Interface 0.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: Add Astrometa T2hybrid keymap module
Oleh Kravchenko [Sat, 28 Oct 2017 13:38:17 +0000 (09:38 -0400)]
media: rc: Add Astrometa T2hybrid keymap module

Add the keymap module for Astrometa T2hybrid remote control commands.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: mceusb: add support for 1b80:d3b2
Oleh Kravchenko [Sat, 28 Oct 2017 13:38:16 +0000 (09:38 -0400)]
media: rc: mceusb: add support for 1b80:d3b2

Evromedia USB Full Hybrid Full HD (1b80:d3b2) has IR on Interface 0.
Remote controller supplied with this tuner fully compatible
with RC_MAP_MSI_DIGIVOX_III.

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc: Convert timers to use timer_setup()
Kees Cook [Tue, 24 Oct 2017 15:23:14 +0000 (11:23 -0400)]
media: rc: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: "Antti Seppälä" <a.seppala@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David Härdeman" <david@hardeman.nu>
Cc: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Add videobuf2 switch to TODO
Sakari Ailus [Fri, 27 Oct 2017 10:35:11 +0000 (06:35 -0400)]
media: staging: atomisp: Add videobuf2 switch to TODO

The atomisp driver uses the videobuf1 framework for buffer management. The
framework is being removed; switch to videobuf2 needs to be made. There
are only a handful of remaining non-staging drivers using videobuf1.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: i2c: Convert timers to use timer_setup()
Kees Cook [Tue, 24 Oct 2017 08:22:11 +0000 (04:22 -0400)]
media: staging: atomisp: i2c: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove FSF snail address
Andy Shevchenko [Wed, 27 Sep 2017 18:25:08 +0000 (14:25 -0400)]
media: staging: atomisp: Remove FSF snail address

Snail address is subject to change, remove it completely from the code.

This has been done using the following script:

sed -i '/You should/,/02110-1301/d' \
$(git grep -n -w Franklin -- drivers/staging/media/atomisp/ | cut -f1 -d:)

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove Gmin dead code #2
Andy Shevchenko [Wed, 27 Sep 2017 18:25:06 +0000 (14:25 -0400)]
media: staging: atomisp: Remove Gmin dead code #2

media/lm3642.h is not used anywhere. Moreover, there is a driver under
LEDs framework for very same IP which would be used anyway.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove Gmin dead code #1
Andy Shevchenko [Wed, 27 Sep 2017 18:25:05 +0000 (14:25 -0400)]
media: staging: atomisp: Remove Gmin dead code #1

struct camera_af_platform_data and bound functions are not used anywhere.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove unused members of camera_sensor_platform_data
Andy Shevchenko [Wed, 27 Sep 2017 18:25:04 +0000 (14:25 -0400)]
media: staging: atomisp: Remove unused members of camera_sensor_platform_data

Remove unused members along with dead code.

Mostly done with help of coccinelle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove duplicate declaration in header
Andy Shevchenko [Wed, 27 Sep 2017 18:25:07 +0000 (14:25 -0400)]
media: staging: atomisp: Remove duplicate declaration in header

There are 3 declarations that are present in atomisp_platform.h and
atomisp_gmin_platform.h. Remove duplications from the latter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove ->power_ctrl() callback
Andy Shevchenko [Wed, 27 Sep 2017 18:25:03 +0000 (14:25 -0400)]
media: staging: atomisp: Remove ->power_ctrl() callback

There is redundant callback which does nothing in upstreamed version of
the driver.

Remove it along with user call places.

Mostly done with help of coccinelle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove ->gpio_ctrl() callback
Andy Shevchenko [Wed, 27 Sep 2017 18:25:02 +0000 (14:25 -0400)]
media: staging: atomisp: Remove ->gpio_ctrl() callback

There is redundant callback which does nothing in upstreamed version of
the driver.

Remove it along with user call places.

Mostly done with help of coccinelle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove unneeded gpio.h inclusion
Andy Shevchenko [Wed, 27 Sep 2017 18:25:01 +0000 (14:25 -0400)]
media: staging: atomisp: Remove unneeded gpio.h inclusion

GPIO handling is done only in two modules, the rest do not need to
include linux/gpio.h header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Do not set GPIO twice
Andy Shevchenko [Wed, 27 Sep 2017 18:25:00 +0000 (14:25 -0400)]
media: staging: atomisp: Do not set GPIO twice

gpiod_get() configures GPIO line at the time of successful request.
Thus, no need to do this explicitly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Switch i2c drivers to use ->probe_new()
Andy Shevchenko [Wed, 27 Sep 2017 18:24:59 +0000 (14:24 -0400)]
media: staging: atomisp: Switch i2c drivers to use ->probe_new()

Since most of the drivers are being used on ACPI enabled platforms
there is no need to keep legacy API support for them. Thus, switch
to ->probe_new() callback and remove orphaned code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Use module_i2c_driver() macro
Andy Shevchenko [Wed, 27 Sep 2017 18:24:58 +0000 (14:24 -0400)]
media: staging: atomisp: Use module_i2c_driver() macro

This is done using coccinelle semantic patch:

//<smpl>
@a@
identifier f, x;
@@
-static f(...) { return i2c_add_driver(&x); }

@b depends on a@
identifier e, a.x;
@@
-static e(...) { i2c_del_driver(&x); }

@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);

@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_i2c_driver;
@@
-module_exit(e);
+module_i2c_driver(x);
//</smpl>

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove AP1302 sensor support
Andy Shevchenko [Wed, 27 Sep 2017 18:24:57 +0000 (14:24 -0400)]
media: staging: atomisp: Remove AP1302 sensor support

This sensor is not used by any known ACPI-enabled platform
(and no kernel users for it so far).

Just remove it for good until we get a platform which actually uses it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Remove IMX sensor support
Andy Shevchenko [Wed, 27 Sep 2017 18:24:56 +0000 (14:24 -0400)]
media: staging: atomisp: Remove IMX sensor support

This sensor is not used by any known ACPI-enabled platform
(and no kernel users for it so far).

Just remove it for good until we get a platform which actually uses it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: Convert timers to use timer_setup()
Kees Cook [Thu, 5 Oct 2017 00:47:38 +0000 (20:47 -0400)]
media: staging: atomisp: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Daeseok Youn <daeseok.youn@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: devel@driverdev.osuosl.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: staging: atomisp: cleanup out of memory messages
Aishwarya Pant [Tue, 17 Oct 2017 13:14:47 +0000 (09:14 -0400)]
media: staging: atomisp: cleanup out of memory messages

Logging of explicit out of memory messages is redundant since memory allocation
failures produce a backtrace.

Done with the help of the following cocci script:

@@
expression ex, ret;
statement s;
constant char[] c;
constant err;
identifier f, l;
@@

ex =
\(kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...)
... when != ex

if (
(
!ex
|
unlikely(!ex)
)
)
- {
- f(..., c, ...);
(
return ex;
|
return;
|
return err;
|
goto l;
)
- }
else s

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: Staging: media: atomisp: pci: Eliminate use of typedefs for struct
Srishti Sharma [Sat, 7 Oct 2017 13:52:02 +0000 (09:52 -0400)]
media: Staging: media: atomisp: pci: Eliminate use of typedefs for struct

The use of typedefs for struct is discouraged, and hence can be
eliminated. Done using the following semantic patch by coccinelle.

@r1@
type T;
@@

typedef struct {...} T;

@script: python p@
T << r1.T;
T1;
@@

if T[-2:] == "_t" or T[-2:] == "_T":
        coccinelle.T1 = T[:-2]
else:
        coccinelle.T1 = T

print T, T1
@r2@
type r1.T;
identifier p.T1;
@@

- typedef
struct
+ T1
{
...
}
- T

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: atmel-isc: get rid of an unused var
Mauro Carvalho Chehab [Tue, 31 Oct 2017 09:32:02 +0000 (05:32 -0400)]
media: atmel-isc: get rid of an unused var

drivers/media/platform/atmel/atmel-isc.c: In function 'isc_async_complete':
drivers/media/platform/atmel/atmel-isc.c:1900:28: warning: variable 'sd_entity' set but not used [-Wunused-but-set-variable]
  struct isc_subdev_entity *sd_entity;
                            ^~~~~~~~~

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
6 years agomedia: rc/keymaps: add support for RC of hisilicon poplar board
Younian Wang [Thu, 19 Oct 2017 19:43:30 +0000 (21:43 +0200)]
media: rc/keymaps: add support for RC of hisilicon poplar board

This is a NEC protocol type remote controller distributed with
96boards poplar@tocoding board.

Signed-off-by: Younian Wang <wangyounian@hisilicon.com>
Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: rc/keymaps: add support for RC of hisilicon TV demo boards
Younian Wang [Thu, 19 Oct 2017 19:43:29 +0000 (21:43 +0200)]
media: rc/keymaps: add support for RC of hisilicon TV demo boards

This is a NEC protocol type remote controller distributed with
hisilicon TV demo boards.

Signed-off-by: Younian Wang <wangyounian@hisilicon.com>
Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: serial_ir: Convert timers to use timer_setup()
Kees Cook [Mon, 16 Oct 2017 23:10:36 +0000 (01:10 +0200)]
media: serial_ir: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: imon: Fix null-ptr-deref in imon_probe
Arvind Yadav [Mon, 9 Oct 2017 18:14:48 +0000 (20:14 +0200)]
media: imon: Fix null-ptr-deref in imon_probe

It seems that the return value of usb_ifnum_to_if() can be NULL and
needs to be checked.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: staging: atomisp2: cleanup null check on memory allocation
Aishwarya Pant [Tue, 17 Oct 2017 13:14:09 +0000 (15:14 +0200)]
media: staging: atomisp2: cleanup null check on memory allocation

For memory allocation functions that fail with a NULL return value, it
is preferred to use the (!x) test in place of (x == NULL).

Changes in atomisp2/css2400/sh_css.c were done by hand.

Done with the help of the following cocci script:

@@
type T;
T* p;
statement s,s1;
@@

p =
  \(devm_kzalloc\|devm_ioremap\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\|
   kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
   kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...)
...when != p

if (
- p == NULL
+ !p
 ) s
 else s1

--
Changes in v3:
  Rebase changes over atomisp-next branch of the media tree
Changes in atomisp2/css2400/sh_css.c were done by hand, the above script
was not able to match the pattern if (a->b != null).

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: staging: media: atomisp: Fix oops by unbalanced clk enable/disable call
Hans de Goede [Mon, 16 Oct 2017 12:34:48 +0000 (14:34 +0200)]
media: staging: media: atomisp: Fix oops by unbalanced clk enable/disable call

The common-clk core expects clk consumers to always call enable/disable
in a balanced manner. The atomisp driver does not call gmin_flisclk_ctrl()
in a balanced manner, so add a clock_on bool and skip redundant calls.

This fixes kernel oops like this one:

[   19.811613] gc0310_s_config S
[   19.811655] ------------[ cut here ]------------
[   19.811664] WARNING: CPU: 1 PID: 720 at drivers/clk/clk.c:594 clk_core_disabl
[   19.811666] Modules linked in: tpm_crb(+) snd_soc_sst_atom_hifi2_platform tpm
[   19.811744] CPU: 1 PID: 720 Comm: systemd-udevd Tainted: G         C OE   4.1
[   19.811746] Hardware name: Insyde T701/T701, BIOS BYT70A.YNCHENG.WIN.007 08/2
[   19.811749] task: ffff988df7ab2500 task.stack: ffffac1400474000
[   19.811752] RIP: 0010:clk_core_disable+0xc0/0x130
...
[   19.811775] Call Trace:
[   19.811783]  clk_core_disable_lock+0x1f/0x30
[   19.811788]  clk_disable+0x1f/0x30
[   19.811794]  gmin_flisclk_ctrl+0x87/0xf0
[   19.811801]  0xffffffffc0528512
[   19.811805]  0xffffffffc05295e2
[   19.811811]  ? acpi_device_wakeup_disable+0x50/0x60
[   19.811815]  ? acpi_dev_pm_attach+0x8e/0xd0
[   19.811818]  ? 0xffffffffc05294d0
[   19.811823]  i2c_device_probe+0x1cd/0x280
[   19.811828]  driver_probe_device+0x2ff/0x450

Fixes: "staging: atomisp: use clock framework for camera clocks"

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: tc358743: validate lane count
Philipp Zabel [Tue, 17 Oct 2017 11:05:11 +0000 (13:05 +0200)]
media: tc358743: validate lane count

The TC358743 does not support more than 4 data lanes. Check that the
lane count is valid.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: i2c: OV5647: change to use macro for the registers
Jacob Chen [Sun, 1 Oct 2017 10:22:38 +0000 (12:22 +0200)]
media: i2c: OV5647: change to use macro for the registers

ref docuemnt:
  ov5647-datasheet-v1.00-2009

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Reviewed-by: Luis Oliveira <lolivei@synopsys.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: i2c: OV5647: ensure clock lane in LP-11 state before streaming on
Jacob Chen [Sun, 1 Oct 2017 10:22:37 +0000 (12:22 +0200)]
media: i2c: OV5647: ensure clock lane in LP-11 state before streaming on

When I was supporting Rpi Camera Module on the ASUS Tinker board,
I found this driver have some issues with rockchip's mipi-csi driver.
It didn't place clock lane in LP-11 state before performing
D-PHY initialisation.

>From our experience, on some OV sensors,
LP-11 state is not achieved while BIT(5)-0x4800 is cleared.

So let's set BIT(5) and BIT(0) both while not streaming, in order to
coax the clock lane into LP-11 state.

0x4800 : MIPI CTRL 00
BIT(5) : clock lane gate enable
0: continuous
1: none-continuous
BIT(0) : manually set clock lane
0: Not used
1: used

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Reviewed-by: Luis Oliveira <lolivei@synopsys.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: ov7670: Add the ov7670_s_power function
Wenyou Yang [Mon, 16 Oct 2017 03:14:27 +0000 (05:14 +0200)]
media: ov7670: Add the ov7670_s_power function

Add the ov7670_s_power function which is responsible for
manipulating the power dowm mode through the PWDN pin and the reset
operation through the RESET pin, and keep it powered at all times.

[sakari.ailus@linux.intel.com: set pwdn_gpio direction only once]
Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: ov7670: Add the get_fmt callback
Wenyou Yang [Mon, 16 Oct 2017 03:14:26 +0000 (05:14 +0200)]
media: ov7670: Add the get_fmt callback

Add the get_fmt callback, also enable V4L2_SUBDEV_FL_HAS_DEVNODE flag
to make this subdev has device node.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: ov7670: Add entity pads initialization
Wenyou Yang [Mon, 16 Oct 2017 03:14:25 +0000 (05:14 +0200)]
media: ov7670: Add entity pads initialization

Add the media entity pads initialization.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: tegra-cec: add Tegra HDMI CEC driver
Hans Verkuil [Sat, 15 Jul 2017 08:51:00 +0000 (10:51 +0200)]
media: tegra-cec: add Tegra HDMI CEC driver

This driver adds support for the Tegra CEC IP. It is based on the
NVIDIA drivers/misc/tegra-cec driver in their 3.10 kernel.

This has been converted to the CEC framework and cleaned up.

Tested with my Jetson TK1 board. It has also been tested with the
Tegra X1 in an embedded product.

Note of warning for the Tegra X2: this SoC supports two HDMI outputs,
but only one CEC adapter and the CEC bus is shared between the
two outputs. This is a design mistake and the CEC adapter can
control only one HDMI output. Never hook up both HDMI outputs
to the CEC bus in a hardware design: this is illegal as per the
CEC specification.

The CEC bus can be shared between multiple inputs and zero or one
outputs, but not between multiple outputs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: dt-bindings: document the tegra CEC bindings
Hans Verkuil [Sat, 15 Jul 2017 08:51:24 +0000 (10:51 +0200)]
media: dt-bindings: document the tegra CEC bindings

This documents the binding for the Tegra CEC module.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: staging: atomisp: use ARRAY_SIZE
Jérémy Lefaure [Sun, 1 Oct 2017 19:30:54 +0000 (21:30 +0200)]
media: staging: atomisp: use ARRAY_SIZE

Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is useless to use a variable to store this constant calculated at
compile time.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: staging/atomisp: make six local functions static to appease sparse
Muhammad Falak R Wani [Sat, 23 Sep 2017 19:45:34 +0000 (21:45 +0200)]
media: staging/atomisp: make six local functions static to appease sparse

The functions __bo_alloc, __bo_search_and_remove_from_free_rbtree,
__bo_search_by_addr, __bo_search_by_addr_in_range, __bo_break_up and
__bo_merge  are local to the source and do not need to be in the global
scope, so make them static.

Cleans up sparse warnings:

warning: symbol '__bo_alloc' was not declared. Should it be static?
warning: symbol '__bo_search_and_remove_from_free_rbtree' was not declared. Should it be static?
warning: symbol '__bo_search_by_addr' was not declared. Should it be static?
warning: symbol '__bo_search_by_addr_in_range' was not declared. Should it be static?
warning: symbol '__bo_break_up' was not declared. Should it be static?
warning: symbol '__bo_merge' was not declared. Should it be static?

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: staging: atomisp: Update TODO regarding sensors
Sakari Ailus [Mon, 25 Sep 2017 11:17:31 +0000 (13:17 +0200)]
media: staging: atomisp: Update TODO regarding sensors

There was no specific item regarding what should be done to sensor, lens
and flash drivers. Add one, to replace the vague item denoting support
only to particular sensor, lens and flash devices.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: staging: atomisp: Add driver prefix to Kconfig option and module names
Sakari Ailus [Mon, 11 Sep 2017 22:46:32 +0000 (00:46 +0200)]
media: staging: atomisp: Add driver prefix to Kconfig option and module names

By adding the "atomisp-" prefix to module names (and "ATOMISP_" to Kconfig
options), the staging drivers for e.g. sensors are labelled as being
specific to atomisp, which they effectively are.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: staging: media: MAINTAINERS: Add entry for atomisp driver
Sakari Ailus [Thu, 14 Sep 2017 10:06:26 +0000 (12:06 +0200)]
media: staging: media: MAINTAINERS: Add entry for atomisp driver

Add the maintainers entry to the atomisp staging media driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: imx274: V4l2 driver for Sony imx274 CMOS sensor
Leon Luo [Thu, 5 Oct 2017 00:06:21 +0000 (02:06 +0200)]
media: imx274: V4l2 driver for Sony imx274 CMOS sensor

The imx274 is a Sony CMOS image sensor that has 1/2.5 image size.
It supports up to 3840x2160 (4K) 60fps, 1080p 120fps. The interface
is 4-lane MIPI CSI-2 running at 1.44Gbps each.

This driver has been tested on Xilinx ZCU102 platform with a Leopard
LI-IMX274MIPI-FMC camera board.

Support for the following features:
-Resolutions: 3840x2160, 1920x1080, 1280x720
-Frame rate: 3840x2160 : 5 – 60fps
            1920x1080 : 5 – 120fps
            1280x720 : 5 – 120fps
-Exposure time: 16 – (frame interval) micro-seconds
-Gain: 1x - 180x
-VFLIP: enable/disabledrivers/media/i2c/imx274.c
-Test pattern: 12 test patterns

Signed-off-by: Leon Luo <leonl@leopardimaging.com>
Tested-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: imx274: device tree binding file
Leon Luo [Thu, 5 Oct 2017 00:06:20 +0000 (02:06 +0200)]
media: imx274: device tree binding file

The binding file for imx274 CMOS sensor V4l2 driver

Signed-off-by: Leon Luo <leonl@leopardimaging.com>
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: tc358743: set entity function to video interface bridge
Philipp Zabel [Thu, 21 Sep 2017 15:32:11 +0000 (17:32 +0200)]
media: tc358743: set entity function to video interface bridge

The TC358743 is an HDMI to MIPI CSI2-2 bridge.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: imx: Fix VDIC CSI1 selection
Tim Harvey [Mon, 18 Sep 2017 23:08:16 +0000 (01:08 +0200)]
media: imx: Fix VDIC CSI1 selection

When using VDIC with CSI1, make sure to select the correct CSI in
IPU_CONF.

Fixes: f0d9c8924e2c3376 ("[media] media: imx: Add IC subdev drivers")

Suggested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: tc358743: remove an unneeded condition
Dan Carpenter [Thu, 28 Sep 2017 13:03:54 +0000 (15:03 +0200)]
media: tc358743: remove an unneeded condition

We can remove the check for if "state->cec_adap" is NULL.  The
cec_allocate_adapter() function never returns NULL and also we verified
that "state->cec_adap" is an error pointer.

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>
6 years agomedia: au0828/em28xx: make vb2_ops const
Bhumika Goyal [Wed, 27 Sep 2017 17:08:19 +0000 (19:08 +0200)]
media: au0828/em28xx: make vb2_ops const

Make vb2_ops const as they are only stored in the const field of a
vb2_queue structure. Make the declarations const too.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: cx23885/saa7134: make vb2_ops const
Bhumika Goyal [Wed, 27 Sep 2017 16:59:06 +0000 (18:59 +0200)]
media: cx23885/saa7134: make vb2_ops const

Make vb2_ops const as they are only stored in the const field of a
vb2_queue structure. Make the declarations const too.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: zoran: make zoran_template const
Bhumika Goyal [Wed, 27 Sep 2017 14:16:47 +0000 (16:16 +0200)]
media: zoran: make zoran_template const

Make this const as it is only used in a copy operation in the file
referencing it. Make the declaration const too.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: bt8xx: make bttv_vbi_qops const
Bhumika Goyal [Wed, 27 Sep 2017 13:59:42 +0000 (15:59 +0200)]
media: bt8xx: make bttv_vbi_qops const

Make this const as it is only passed to the const argument of the
function videobuf_queue_sg_init in the file referencing it.
Also, make the declaration in the header const.

Structure found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: coda: Handle return value of kasprintf
Arvind Yadav [Wed, 20 Sep 2017 09:40:58 +0000 (11:40 +0200)]
media: coda: Handle return value of kasprintf

kasprintf() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: i2c: tc358743: fix spelling mistake
Jacob Chen [Mon, 18 Sep 2017 04:00:51 +0000 (06:00 +0200)]
media: i2c: tc358743: fix spelling mistake

It should be "LP-11".

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: tm6000: cleanup trival coding style issues
Markus Elfring [Thu, 14 Sep 2017 12:34:39 +0000 (14:34 +0200)]
media: tm6000: cleanup trival coding style issues

- Delete seven error messages for a failed memory allocation
- Adjust seven checks for null pointers
- Use common error handling code in tm6000_usb_probe()
- Adjust jump targets so that the function "kfree" will be always called
  with a non-null pointer.
- Delete an initialisation for the local variable "dev"
  which became unnecessary with this refactoring.

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>
6 years agomedia: cec-pin.h: move non-kAPI parts into cec-pin-priv.h
Hans Verkuil [Fri, 13 Oct 2017 16:01:32 +0000 (18:01 +0200)]
media: cec-pin.h: move non-kAPI parts into cec-pin-priv.h

The kAPI cec-pin.h header also defined data structures that did
not belong here but were private to the CEC core code.

Split that part off into a cec-pin-priv.h header.

Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: venus: reimplement decoder stop command
Stanimir Varbanov [Fri, 13 Oct 2017 14:13:17 +0000 (16:13 +0200)]
media: venus: reimplement decoder stop command

This addresses the wrong behavior of decoder stop command by
rewriting it. These new implementation enqueue an empty buffer
on the decoder input buffer queue to signal end-of-stream. The
client should stop queuing buffers on the V4L2 Output queue
and continue queuing/dequeuing buffers on Capture queue. This
process will continue until the client receives a buffer with
V4L2_BUF_FLAG_LAST flag raised, which means that this is last
decoded buffer with data.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.13 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: vimc: Fix return value check in vimc_add_subdevs()
Wei Yongjun [Wed, 11 Oct 2017 11:16:43 +0000 (13:16 +0200)]
media: vimc: Fix return value check in vimc_add_subdevs()

In case of error, the function platform_device_register_data() returns
ERR_PTR() and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: venus: venc: fix bytesused v4l2_plane field
Stanimir Varbanov [Tue, 10 Oct 2017 07:52:36 +0000 (09:52 +0200)]
media: venus: venc: fix bytesused v4l2_plane field

This fixes wrongly filled bytesused field of v4l2_plane structure
by include data_offset in the plane, Also fill data_offset and
bytesused for capture type of buffers only.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: <stable@vger.kernel.org> # for v4.13 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: atmel-isc: Rework the format list
Wenyou Yang [Tue, 10 Oct 2017 02:46:40 +0000 (04:46 +0200)]
media: atmel-isc: Rework the format list

To improve the readability of code, split the format array into two,
one for the format description, other for the register configuration.
Meanwhile, add the flag member to indicate the format can be achieved
from the sensor or be produced by the controller, and rename members
related to the register configuration.

Also add more formats support: GREY, ARGB444, ARGB555 and ARGB32.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: atmel-isc: Remove unnecessary member
Wenyou Yang [Tue, 10 Oct 2017 02:46:39 +0000 (04:46 +0200)]
media: atmel-isc: Remove unnecessary member

Remove the memeber *config from the isc_subdev_entity struct,
the member is useless afterward.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: atmel-isc: Enable the clocks during probe
Wenyou Yang [Tue, 10 Oct 2017 02:46:38 +0000 (04:46 +0200)]
media: atmel-isc: Enable the clocks during probe

To meet the relationship, enable the HCLOCK and ispck during the
device probe, "isc_pck frequency is less than or equal to isc_ispck,
and isc_ispck is greater than or equal to HCLOCK."
Meanwhile, call the pm_runtime_enable() in the right place.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
6 years agomedia: atmel-isc: Add prepare and unprepare ops
Wenyou Yang [Tue, 10 Oct 2017 02:46:37 +0000 (04:46 +0200)]
media: atmel-isc: Add prepare and unprepare ops

A software write operation to the ISC_CLKEN or ISC_CLKDIS register
requires double clock domain synchronization and is not permitted
when the ISC_SR.SIP is asserted. So add the .prepare and .unprepare
ops to make sure the ISC_CLKSR.SIP is unasserted before the write
operation to the ISC_CLKEN or ISC_CLKDIS register.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>