Commit graph

707572 commits

Author SHA1 Message Date
Arvind Yadav 58fd55e838 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>
2017-10-27 17:36:25 +02:00
Aishwarya Pant bbae615636 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>
2017-10-27 17:33:39 +02:00
Hans de Goede 1f709713cb 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>
2017-10-27 16:47:53 +02:00
Philipp Zabel 9d39e46bdd 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>
2017-10-27 16:15:36 +02:00
Jacob Chen cef6673440 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>
2017-10-27 16:13:42 +02:00
Jacob Chen 7bc9f038d0 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>
2017-10-27 16:12:49 +02:00
Wenyou Yang 71862f63f3 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>
2017-10-27 16:11:46 +02:00
Wenyou Yang c0662dd4e7 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>
2017-10-27 15:54:24 +02:00
Wenyou Yang d94a26f05b 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>
2017-10-27 15:53:10 +02:00
Hans Verkuil 9d2d60687c 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>
2017-10-27 15:48:57 +02:00
Hans Verkuil d524b8fc75 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>
2017-10-27 15:41:52 +02:00
Jérémy Lefaure bc64ce98d6 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>
2017-10-27 15:38:24 +02:00
Muhammad Falak R Wani 79bd3daaa8 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>
2017-10-27 15:37:55 +02:00
Sakari Ailus af7db4e90e 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>
2017-10-27 15:37:17 +02:00
Sakari Ailus 90ebe55ab8 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>
2017-10-27 15:36:18 +02:00
Sakari Ailus 183c2e0481 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>
2017-10-27 15:31:48 +02:00
Leon Luo 0985dd306f 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>
2017-10-27 15:22:17 +02:00
Leon Luo b2b60bcc7d 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>
2017-10-27 14:18:37 +02:00
Philipp Zabel f7480ad0d4 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>
2017-10-27 14:15:16 +02:00
Tim Harvey f9cc48f1b1 media: imx: Fix VDIC CSI1 selection
When using VDIC with CSI1, make sure to select the correct CSI in
IPU_CONF.

Fixes: f0d9c8924e ("[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>
2017-10-27 14:14:43 +02:00
Dan Carpenter 7996e5c47f 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>
2017-10-27 14:14:13 +02:00
Bhumika Goyal ac71484e89 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>
2017-10-27 14:13:33 +02:00
Bhumika Goyal 0e2d9a9d4a 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>
2017-10-27 14:12:44 +02:00
Bhumika Goyal 9676593c90 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>
2017-10-27 14:12:04 +02:00
Bhumika Goyal b145ef4f79 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>
2017-10-27 14:11:26 +02:00
Arvind Yadav e641e02d78 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>
2017-10-27 14:09:39 +02:00
Jacob Chen 3863d4bb55 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>
2017-10-27 14:08:44 +02:00
Markus Elfring 7e11d5027b 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>
2017-10-27 14:07:48 +02:00
Hans Verkuil 5bf24e08b6 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>
2017-10-27 14:02:19 +02:00
Stanimir Varbanov e69b987a97 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>
2017-10-27 14:01:09 +02:00
Wei Yongjun 3863360c15 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>
2017-10-27 14:00:11 +02:00
Stanimir Varbanov 5232c37ce2 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>
2017-10-27 13:59:25 +02:00
Wenyou Yang f103ea11cd 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>
2017-10-27 13:58:46 +02:00
Wenyou Yang b0ea17c589 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>
2017-10-27 13:57:35 +02:00
Wenyou Yang 01192aa1c5 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>
2017-10-27 13:56:59 +02:00
Wenyou Yang 64f6306a5a 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>
2017-10-27 13:56:05 +02:00
Wenyou Yang cab1dea3be media: atmel-isc: Add spin lock for clock enable ops
Add the spin lock for the clock enable and disable operations.

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>
2017-10-27 13:54:07 +02:00
Stanimir Varbanov cd1a77e3c9 media: venus: fix wrong size on dma_free
This change will fix an issue with dma_free size found with
DMA API debug enabled.

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>
2017-10-24 17:17:18 +02:00
Sakari Ailus 6771fce506 media: smiapp: Rely on runtime PM
Instead of relying on a mix of runtime PM and the s_power() callback, drop
the s_power() callback altogether and use runtime PM solely.

As device access is required during device power-on and power-off
sequences, runtime PM alone cannot tell whether the device is available.
Thus the "active" field is introduced in struct smiapp_sensor to tell
whether it is safe to write to the device.

Consequently there is no need to power on the device whenever a file
handle is open. This functionality is removed as well. The user may still
control the device power management through sysfs. Autosuspend remains
enabled, with 1 s delay.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-24 17:14:25 +02:00
Sakari Ailus 72eaf99f04 media: smiapp: Use __v4l2_ctrl_handler_setup()
Use unlocked __v4l2_ctrl_handler_setup() in order to make the
control setup atomic.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-24 17:08:33 +02:00
Mauro Carvalho Chehab 61065fc3e3 Merge commit '3728e6a255b5' into patchwork
* commit '3728e6a255b5': (904 commits)
  Linux 4.14-rc5
  x86/microcode: Do the family check first
  locking/lockdep: Disable cross-release features for now
  x86/mm: Flush more aggressively in lazy TLB mode
  mm, swap: use page-cluster as max window of VMA based swap readahead
  mm: page_vma_mapped: ensure pmd is loaded with READ_ONCE outside of lock
  kmemleak: clear stale pointers from task stacks
  fs/binfmt_misc.c: node could be NULL when evicting inode
  fs/mpage.c: fix mpage_writepage() for pages with buffers
  linux/kernel.h: add/correct kernel-doc notation
  tty: fall back to N_NULL if switching to N_TTY fails during hangup
  Revert "vmalloc: back off when the current task is killed"
  mm/cma.c: take __GFP_NOWARN into account in cma_alloc()
  scripts/kallsyms.c: ignore symbol type 'n'
  userfaultfd: selftest: exercise -EEXIST only in background transfer
  mm: only display online cpus of the numa node
  mm: remove unnecessary WARN_ONCE in page_vma_mapped_walk().
  mm/mempolicy: fix NUMA_INTERLEAVE_HIT counter
  include/linux/of.h: provide of_n_{addr,size}_cells wrappers for !CONFIG_OF
  mm/madvise.c: add description for MADV_WIPEONFORK and MADV_KEEPONFORK
  ...
2017-10-17 17:22:20 -07:00
Linus Torvalds 3728e6a255 media fixes for v4.14-rc6
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZ5RRxAAoJEAhfPr2O5OEVa2oQAJ7TeRcV/a76xSPb3hN/T6VL
 EPpKZYaP2BjvmqDy9p3GbN0/Jp+ltDD7HhzQQHUDMMjkouyhtLRONBmi21YcNOvH
 wGW2qTYqMis5KBDFPZ6sHEGLpZBS6c8Gsz+X6pGh6OGIQVsyEGSaaE8m6zCGj4qz
 pfNq15Zax/JU1zhTFs/iO9IzG9aW2Q++p3Tgs5OdPIOua3hwontTbKODzhFgUDip
 yjvYtD3rF1ftftxq3kPunrywsv1BvHnX2E1TVKAZoFDpd0Eo2Nud922EBRLTxAO3
 w1xdI9fLMi1BnJYx1VdQ0onDi8muVGXcIrXVvh6eA4NPsGY2AFXluUSm7zBCpxXY
 jDGTyIa+pLxr9y03zP5Nx9IHcMFApz1LzDpKaBWKCKEu3EB/9jGtY7Vrc0cHdeDa
 on93vVMHu+80Uxw4txHBJuYhXNPakz0n99zhZbbcdpHLyTM7aINXNa37IAp7tNeu
 5nCSJ2FWrNgFRC+3avvbGSfJBA12QJgyEvuEHW0bTttSDVxh14XzGz+C1lx960qc
 EbIQzPJxtwLSZ4y7OfDGBPWTrql5C0SQo9Z+K6S8reJsoILTCYZRXQaB1u+D+ff/
 zfLCYTbRwabUre9C/jeT+XrT+KJyZ+huGMs2HMslGauRbWuUwgCv86WuVkp7httz
 HtzQSKK6s5iWh2H9T2x0
 =VOJs
 -----END PGP SIGNATURE-----

Merge tag 'media/v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:
 "Core fixes:
   - cec: Respond to unregistered initiators, when applicable
   - dvb_frontend: only use kref after initialized

  Driver-specific fixes:
   - qcom, camss: Make function vfe_set_selection static
   - qcom: VIDEO_QCOM_CAMSS should depend on HAS_DMA
   - s5p-cec: add NACK detection support
   - media: staging/imx: Fix uninitialized variable warning
   - dib3000mc: i2c transfers over usb cannot be done from stack
   - venus: init registered list on streamoff"

* tag 'media/v4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  media: dvb_frontend: only use kref after initialized
  media: platform: VIDEO_QCOM_CAMSS should depend on HAS_DMA
  media: cec: Respond to unregistered initiators, when applicable
  media: s5p-cec: add NACK detection support
  media: staging/imx: Fix uninitialized variable warning
  media: qcom: camss: Make function vfe_set_selection static
  media: venus: init registered list on streamoff
  media: dvb: i2c transfers over usb cannot be done from stack
2017-10-17 06:23:09 -04:00
Sakari Ailus 7571358dd2 media: dt: bindings: media: Document data lane numbering without lane reordering
Most devices do not support lane reordering and in many cases the
documentation of the data-lanes property is incomplete for such devices.
Document that in case the lane reordering isn't supported, monotonically
incremented values from 0 or 1 shall be used.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:54:45 -07:00
Sakari Ailus a197c7fccc media: dt: bindings: media: Document practices for DT bindings, ports, endpoints
Port and endpoint numbering has been omitted in DT binding documentation
for a large number of devices. Also common properties the device uses have
been missed in binding documentation. Make it explicit that these things
need to be documented.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:52:54 -07:00
Markus Elfring 4449dd0a39 media: s5p-mfc: Adjust a null pointer check in four functions
The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written...

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:51:11 -07:00
Markus Elfring d7f15bde0f media: s5p-mfc: Improve a size determination in s5p_mfc_alloc_memdev()
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:50:30 -07:00
Markus Elfring f6cd323289 media: s5p-mfc: Delete an error message for a failed memory allocation
Omit an extra message for a memory allocation failure in s5p_mfc_probe()
function.  This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:49:53 -07:00
Hoegeun Kwon a2640560a0 media: exynos-gsc: Add hardware rotation limits
The hardware rotation limits of gsc depends on SOC (Exynos
5250/5420/5433). Distinguish them and add them to the driver data.

[s.nawrocki@samsung.com: corrected num_entities in 5420 variant data]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:49:09 -07:00
Hoegeun Kwon defc3a47c5 media: exynos-gsc: Add compatible for Exynos 5250 and 5420 SoC version
Exynos 5250 and 5420 have different hardware rotation limits.
Since we have to distinguish between these two, we add different
compatible: samsung,exynos5250-gsc and samsung,exynos5420-gsc.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:47:58 -07:00
Jacob Chen 1c860c789f [media] MAINTAINERS: add entry for Rockchip RGA driver
Add MAINTAINERS entry for the rockchip RGA driver.

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
[hans.verkuil@cisco.com: added commit message]
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-10-16 16:36:00 -07:00