linux-block.git
12 months agomedia: i2c: ov01a10: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:54 +0000 (21:16 +0300)]
media: i2c: ov01a10: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: og01a1b: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:53 +0000 (21:16 +0300)]
media: i2c: og01a1b: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx355: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:52 +0000 (21:16 +0300)]
media: i2c: imx355: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx319: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:51 +0000 (21:16 +0300)]
media: i2c: imx319: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx258: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:50 +0000 (21:16 +0300)]
media: i2c: imx258: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx219: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:49 +0000 (21:16 +0300)]
media: i2c: imx219: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx214: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:48 +0000 (21:16 +0300)]
media: i2c: imx214: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx208: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:47 +0000 (21:16 +0300)]
media: i2c: imx208: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: hi847: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:46 +0000 (21:16 +0300)]
media: i2c: hi847: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: hi846: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:45 +0000 (21:16 +0300)]
media: i2c: hi846: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

Now that the runtime PM operations are not called from the system PM
handlers, the sensor is guaranteed not to be streaming when the runtime
PM resume handler is called, and to have been stopped already when the
runtime PM suspend handler is called. Drop the manual stream start/stop
from the runtime PM handlers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: hi556: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:44 +0000 (21:16 +0300)]
media: i2c: hi556: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ccs: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:43 +0000 (21:16 +0300)]
media: i2c: ccs: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ar0521: Drop system suspend and resume handlers
Laurent Pinchart [Thu, 14 Sep 2023 18:16:42 +0000 (21:16 +0300)]
media: i2c: ar0521: Drop system suspend and resume handlers

Stopping streaming on a camera pipeline at system suspend time, and
restarting it at system resume time, requires coordinated action between
the bridge driver and the camera sensor driver. This is handled by the
bridge driver calling the sensor's .s_stream() handler at system suspend
and resume time. There is thus no need for the sensor to independently
implement system sleep PM operations. Drop them.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Krzysztof HaƂasa <khalasa@piap.pl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agoDocumentation: media: camera-sensor: Improve power management documentation
Laurent Pinchart [Thu, 14 Sep 2023 18:16:41 +0000 (21:16 +0300)]
Documentation: media: camera-sensor: Improve power management documentation

Camera sensor drivers are highly subject to cargo cult programming, with
back practices being copied from old to new drivers. In particular, many
drivers implement system and runtime PM incorrectly. As a first step
towards fixing this situation, refactor and expand the power management
documentation to detail correct usage of system and runtime PM.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agoDocumentation: media: camera-sensor: Move power management section
Laurent Pinchart [Thu, 14 Sep 2023 18:16:40 +0000 (21:16 +0300)]
Documentation: media: camera-sensor: Move power management section

Move the power management section up, just after clocks, as it relates
to internal system resources and not features exposed to applications.
The text itself is otherwise unchanged.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agoDocumentation: media: camera-sensor: Use link to upstream DT bindings
Laurent Pinchart [Thu, 14 Sep 2023 18:16:39 +0000 (21:16 +0300)]
Documentation: media: camera-sensor: Use link to upstream DT bindings

The Documentation/devicetree/bindings/clock/clock-bindings.txt file is
deprecated and points to clock-bindings.yaml, which is not hosted in the
kernel source tree. Use an HTTPS link to refer to the YAML binding
document.

While at it, drop "currently" from the paragraph, as the whole file
refers to the current recommended practices except where explicitly
noted.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agoDocumentation: media: camera-sensor: Fix typo and vocabulary selection
Laurent Pinchart [Thu, 14 Sep 2023 18:16:38 +0000 (21:16 +0300)]
Documentation: media: camera-sensor: Fix typo and vocabulary selection

Drop an unneeded double colon, and use 'shall' instead of 'must' for
consistency with the rest of the file.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov9734: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:37 +0000 (21:16 +0300)]
media: i2c: ov9734: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov9282: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:36 +0000 (21:16 +0300)]
media: i2c: ov9282: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov8856: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:35 +0000 (21:16 +0300)]
media: i2c: ov8856: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov7740: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:34 +0000 (21:16 +0300)]
media: i2c: ov7740: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov5695: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:33 +0000 (21:16 +0300)]
media: i2c: ov5695: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov5675: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:32 +0000 (21:16 +0300)]
media: i2c: ov5675: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov5670: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:31 +0000 (21:16 +0300)]
media: i2c: ov5670: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov5647: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:30 +0000 (21:16 +0300)]
media: i2c: ov5647: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov4689: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:29 +0000 (21:16 +0300)]
media: i2c: ov4689: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Mikhail Rudenko <mike.rudenko@gmail.com>
[Sakari Ailus: remove now-redundant "streaming" from comment.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov2740: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:28 +0000 (21:16 +0300)]
media: i2c: ov2740: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov2685: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:27 +0000 (21:16 +0300)]
media: i2c: ov2685: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov13b10: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:26 +0000 (21:16 +0300)]
media: i2c: ov13b10: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov13858: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:25 +0000 (21:16 +0300)]
media: i2c: ov13858: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov08x40: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:24 +0000 (21:16 +0300)]
media: i2c: ov08x40: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov08d10: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:23 +0000 (21:16 +0300)]
media: i2c: ov08d10: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov01a10: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:22 +0000 (21:16 +0300)]
media: i2c: ov01a10: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: og01a1b: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:21 +0000 (21:16 +0300)]
media: i2c: og01a1b: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: mt9m001: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:20 +0000 (21:16 +0300)]
media: i2c: mt9m001: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx412: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:19 +0000 (21:16 +0300)]
media: i2c: imx412: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx355: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:18 +0000 (21:16 +0300)]
media: i2c: imx355: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx335: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:17 +0000 (21:16 +0300)]
media: i2c: imx335: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx334: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:16 +0000 (21:16 +0300)]
media: i2c: imx334: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

The streaming field of the driver's private structure is now unused,
drop it as well.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx319: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:15 +0000 (21:16 +0300)]
media: i2c: imx319: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx258: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:14 +0000 (21:16 +0300)]
media: i2c: imx258: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx219: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:13 +0000 (21:16 +0300)]
media: i2c: imx219: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx214: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:12 +0000 (21:16 +0300)]
media: i2c: imx214: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx208: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:11 +0000 (21:16 +0300)]
media: i2c: imx208: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: hi846: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:10 +0000 (21:16 +0300)]
media: i2c: hi846: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: hi556: Drop check for reentrant .s_stream()
Laurent Pinchart [Thu, 14 Sep 2023 18:16:09 +0000 (21:16 +0300)]
media: i2c: hi556: Drop check for reentrant .s_stream()

The subdev .s_stream() operation shall not be called to start streaming
on an already started subdev, or stop streaming on a stopped subdev.
Remove the check that guards against that condition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l2-subdev: Document and enforce .s_stream() requirements
Laurent Pinchart [Mon, 18 Sep 2023 12:48:38 +0000 (15:48 +0300)]
media: v4l2-subdev: Document and enforce .s_stream() requirements

The subdev .s_stream() operation must not be called to start an already
started subdev, or stop an already stopped one. This requirement has
never been formally documented. Fix it, and catch possible offenders
with a WARN_ON() in the call_s_stream() wrapper.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov13b10: Add 1364x768 register settings
Hao Yao [Fri, 15 Sep 2023 08:45:27 +0000 (16:45 +0800)]
media: ov13b10: Add 1364x768 register settings

This commit adds support for:

- 1364x768 at 120 FPS

Signed-off-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dt-bindings: Add OV5642
Fabio Estevam [Wed, 13 Sep 2023 19:28:11 +0000 (16:28 -0300)]
media: dt-bindings: Add OV5642

As explained in the description text from trivial-devices.yaml:

"This is a list of trivial I2C and SPI devices that have simple device tree
bindings, consisting only of a compatible field, an address and possibly an
interrupt line."

A camera device does not fall into this category as it needs other
properties such as regulators, reset and powerdown GPIOs, clocks,
media endpoint.

Remove the OV5642 entry from trivial-devices.yaml and add its own
ovti,ov5642.yaml.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: Documentation: Mention CCS tools
Sakari Ailus [Thu, 14 Sep 2023 22:01:24 +0000 (01:01 +0300)]
media: Documentation: Mention CCS tools

CCS tools is a useful set of programs and libraries for working with CCS
static data. Do mention that in context of the CCS driver.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx296: Replace streaming flag with runtime PM check
Laurent Pinchart [Thu, 14 Sep 2023 17:46:47 +0000 (20:46 +0300)]
media: i2c: imx296: Replace streaming flag with runtime PM check

The streaming flag in the driver private structure is used for the sole
purpose of gating register writes when setting a V4L2 control. This is
better handled by checking if the sensor is powered up using the runtime
PM API. Do so and drop the streaming flag.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx415: Replace streaming flag with runtime PM check
Laurent Pinchart [Thu, 14 Sep 2023 17:46:00 +0000 (20:46 +0300)]
media: i2c: imx415: Replace streaming flag with runtime PM check

The streaming flag in the driver private structure is used for the sole
purpose of gating register writes when setting a V4L2 control. This is
better handled by checking if the sensor is powered up using the runtime
PM API. Do so and drop the streaming flag.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Sakari Ailus: Runtime PM put when setting analgue gain.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov5693: Drop the unused streaming flag
Laurent Pinchart [Thu, 14 Sep 2023 17:45:08 +0000 (20:45 +0300)]
media: i2c: ov5693: Drop the unused streaming flag

The streaming flag in the driver's private structure is set but never
used. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: Use pm_runtime_resume_and_get()
Laurent Pinchart [Thu, 14 Sep 2023 17:20:54 +0000 (20:20 +0300)]
media: i2c: Use pm_runtime_resume_and_get()

Simplify error handling by using pm_runtime_resume_and_get() instead of
pm_runtime_get_sync() with a put call in the error path.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> (st-vgxy61)
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov5640: Fix a memory leak when ov5640_probe fails
Xiaolei Wang [Mon, 7 Aug 2023 09:05:35 +0000 (17:05 +0800)]
media: ov5640: Fix a memory leak when ov5640_probe fails

sensor->ctrls.handler is initialized in ov5640_init_controls(),
so when the sensor is not connected and ov5640_sensor_resume()
fails, sensor->ctrls.handler should be released, otherwise a
memory leak will be detected:

unreferenced object 0xc674ca80 (size 64):
   comm "swapper/0", pid 1, jiffies 4294938337 (age 204.880s)
   hex dump (first 32 bytes):
     80 55 75 c6 80 54 75 c6 00 55 75 c6 80 52 75 c6 .Uu..Tu..Uu..Ru.
     00 53 75 c6 00 00 00 00 00 00 00 00 00 00 00 00 .Su..........

Fixes: 85644a9b37ec ("media: ov5640: Use runtime PM")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx334: add support for test pattern generator
Shravan Chippa [Fri, 4 Aug 2023 15:15:41 +0000 (20:45 +0530)]
media: i2c: imx334: add support for test pattern generator

Add support for the imx334's test pattern generator.
By default the test pattern generator is disabled, so add support for
enabling and disabling horizontal and vertical colour bars.

Signed-off-by: Shravan Chippa <shravan.chippa@microchip.com>
Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov7670: Drop CONFIG_OF ifdeffery
Biju Das [Sun, 10 Sep 2023 15:00:33 +0000 (16:00 +0100)]
media: i2c: ov7670: Drop CONFIG_OF ifdeffery

Drop of_match_ptr() from ov7670_driver and get rid of ugly CONFIG_OF
if check. This slightly increases the size of ov7670_driver on non-OF
system and shouldn't be an issue.

Add mod_devicetable.h include.

It also allows, in case if needed, to enumerate this device via ACPI with
PRP0001 magic.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ov7670: Extend match support for OF tables
Biju Das [Sun, 10 Sep 2023 15:00:32 +0000 (16:00 +0100)]
media: i2c: ov7670: Extend match support for OF tables

The driver has an OF match table, still, it uses an ID lookup table for
retrieving match data. Currently, the driver is working on the
assumption that an I2C device registered via OF will always match a
legacy I2C device ID. The correct approach is to have an OF device ID
table using i2c_get_match_data() if the devices are registered via OF/ID.

Unify the OF/ID table by using struct ov7670_devtype as match data for
both these tables and replace the ID lookup table for the match data by
i2c_get_match_data().

Split the array ov7670_devdata[] as individual variables, and
make lines shorter by referring to e.g. &ov7670_devdata instead of
&ov7670_devdata[MODEL_OV7670].

Drop enum ov7670_model as there is no user.

While at it, remove the trailing comma in the terminator entry for the OF
table making code robust against (theoretical) misrebases or other similar
things where the new entry goes _after_ the termination without the
compiler noticing.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: mt9v032: Drop CONFIG_OF ifdeffery
Biju Das [Sun, 10 Sep 2023 16:54:32 +0000 (17:54 +0100)]
media: i2c: mt9v032: Drop CONFIG_OF ifdeffery

Drop of_match_ptr() from mt9v032_driver and get rid of ugly CONFIG_OF
if check. This slightly increases the size of mt9v032_driver on non-OF
system and shouldn't be an issue.

Add mod_devicetable.h include.

It also allows, in case if needed, to enumerate this device via ACPI with
PRP0001 magic.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: mt9v032: Extend match support for OF tables
Biju Das [Sun, 10 Sep 2023 16:54:31 +0000 (17:54 +0100)]
media: i2c: mt9v032: Extend match support for OF tables

The driver has an OF match table, still, it uses an ID lookup table for
retrieving match data. Currently, the driver is working on the
assumption that an I2C device registered via OF will always match a
legacy I2C device ID. The correct approach is to have an OF device ID
table using i2c_get_match_data() if the devices are registered via OF/ID.

Unify the OF/ID table by using mt9v032_model_info as match data for both
these tables and replace the ID lookup table for the match data by
i2c_get_match_data() and simplifly probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: Drop ifdeffery from sensor drivers
Jacopo Mondi [Mon, 11 Sep 2023 14:56:36 +0000 (16:56 +0200)]
media: i2c: Drop ifdeffery from sensor drivers

Since commit 7d3c7d2a2914 ("media: i2c: Add a camera sensor top level
menu") the CONFIG_MEDIA_CONTROLLER and CONFIG_VIDEO_V4L2_SUBDEV_API are
selected by the top-level VIDEO_CAMERA_SENSOR menu.

Remove all ifdefferies from camera sensor drivers to simplify the code.

Compile-tested only.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: video-i2c: Convert enum->pointer for data in the match tables
Biju Das [Sun, 20 Aug 2023 07:58:46 +0000 (08:58 +0100)]
media: i2c: video-i2c: Convert enum->pointer for data in the match tables

Convert enum->pointer for data in the match tables, so that
device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c
bus type match support added to it.

Replace enum->struct *video_i2c_chip for data in the match table. Simplify
the probe() by replacing device_get_match_data() and ID lookup for
retrieving data by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: platform: use capital "OR" for multiple licenses in SPDX
Krzysztof Kozlowski [Wed, 23 Aug 2023 08:56:10 +0000 (10:56 +0200)]
media: platform: use capital "OR" for multiple licenses in SPDX

Documentation/process/license-rules.rst and checkpatch expect the SPDX
identifier syntax for multiple licenses to use capital "OR".  Correct it
to keep consistent format and avoid copy-paste issues.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l2-subdev: Document that routing support depends on streams
Laurent Pinchart [Fri, 18 Aug 2023 15:55:18 +0000 (18:55 +0300)]
media: v4l2-subdev: Document that routing support depends on streams

Routing support, through the subdev .set_routing() operation, requires
the subdev to support streams. This is however not clearly documented
anywhere. Fix it by expanding the operation's documentation to indicate
that subdevs must set the V4L2_SUBDEV_FL_STREAMS flag.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: imx415: Use v4l2_subdev_get_fmt()
Umang Jain [Wed, 30 Aug 2023 04:53:23 +0000 (10:23 +0530)]
media: i2c: imx415: Use v4l2_subdev_get_fmt()

The imx415 driver uses the subdev active state, there's
no need to implement the .get_fmt() operation manually. Use
the v4l2_subdev_get_fmt() helper instead.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Michael Riesch <michael.riesch@wolfvision.net>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: max9286: Fix some redundant of_node_put() calls
Christophe JAILLET [Fri, 25 Aug 2023 22:13:40 +0000 (00:13 +0200)]
media: i2c: max9286: Fix some redundant of_node_put() calls

This is odd to have a of_node_put() just after a for_each_child_of_node()
or a for_each_endpoint_of_node() loop. It should already be called
during the last iteration.

Remove these calls.

Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ivsc: ace: probe ace device after IPU bridge is initialized.
Wentong Wu [Tue, 29 Aug 2023 05:24:28 +0000 (13:24 +0800)]
media: ivsc: ace: probe ace device after IPU bridge is initialized.

During probe ivsc ace device, acpi_dev_clear_dependencies() will be
called to clear the consumer and supplier relationship between camera
sensor device and ivsc device. But IPU bridge will setup the connection
swnodes for ivsc device and camera sensor device based on this consumer
and supplier relationship. This patch defers ivsc ace's probe to make
sure IPU bridge is initialized before this consumer and supplier
relationship between camera sensor device and IVSC device is cleared.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ivsc: ace: remove name identifier
Wentong Wu [Tue, 29 Aug 2023 05:24:27 +0000 (13:24 +0800)]
media: ivsc: ace: remove name identifier

Remove name identifier to match the device with the
defined UUID when load driver module.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ivsc: csi: remove name identifier
Wentong Wu [Tue, 29 Aug 2023 05:24:26 +0000 (13:24 +0800)]
media: ivsc: csi: remove name identifier

Remove name identifier to match the device with the
defined UUID when load driver module.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l2-mc: Make v4l2_pipeline_pm_{get,put} deprecated
Sakari Ailus [Wed, 23 Aug 2023 09:03:42 +0000 (12:03 +0300)]
media: v4l2-mc: Make v4l2_pipeline_pm_{get,put} deprecated

The v4l2_pipeline_pm_get() and v4l2_pipeline_pm_put() functions were
needed to control sub-devices' power states before runtime PM. These
functions should no longer be used, and instead sub-device drivers should
use runtime PM.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2640: Use the devm_clk_get_enabled() helper function
Ruan Jinjie [Fri, 18 Aug 2023 10:16:24 +0000 (18:16 +0800)]
media: ov2640: Use the devm_clk_get_enabled() helper function

With devm_clk_get_enabled() the call to clk_disable_unprepare() can be
dropped from the error path and the remove callback.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l: Fix documentation for 12-bit packed Bayer
Suhrid Subramaniam [Tue, 11 Jul 2023 01:31:40 +0000 (18:31 -0700)]
media: v4l: Fix documentation for 12-bit packed Bayer

Fix documentation for R13 and R33 low bits.

Signed-off-by: Suhrid Subramaniam <suhrid.subramaniam@mediatek.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: staging: ipu3-imgu: Initialise height_per_slice in the stripes
Jean-Michel Hautbois [Thu, 16 Sep 2021 17:25:04 +0000 (19:25 +0200)]
media: staging: ipu3-imgu: Initialise height_per_slice in the stripes

While playing with low resolutions for the grid, it appeared that
height_per_slice is not initialised if we are not using both stripes for
the calculations. This pattern occurs three times:
- for the awb_fr processing block
- for the af processing block
- for the awb processing block

The idea of this small portion of code is to reduce complexity in
loading the statistics, it could be done also when only one stripe is
used. Fix it by getting this initialisation code outside of the else()
test case.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dt-bindings: ov5693: fix maintainer email address
Tommaso Merciai [Mon, 31 Jul 2023 21:52:15 +0000 (23:52 +0200)]
media: dt-bindings: ov5693: fix maintainer email address

Switch my mail address from a company mail to a personal one.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ivsc: Improve Kconfig help text
Sakari Ailus [Fri, 4 Aug 2023 06:23:22 +0000 (09:23 +0300)]
media: ivsc: Improve Kconfig help text

Improve the Kconfig help text to convey the ACE is for changing camera
sensor ownership and CSI for configuring the CSI-2 rx and tx.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov5640: fix vblank unchange issue when work at dvp mode
Guoniu.zhou [Wed, 19 Jul 2023 07:30:12 +0000 (15:30 +0800)]
media: ov5640: fix vblank unchange issue when work at dvp mode

The value of V4L2_CID_VBLANK control is initialized to default vblank
value of 640x480 when driver probe. When OV5640 work at DVP mode, the
control value won't update and lead to sensor can't output data if the
resolution remain the same as last time since incorrect total vertical
size. So update it when there is a new value applied.

Fixes: bce93b827de6 ("media: ov5640: Add VBLANK control")
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov13b10: Fix some error checking in probe
Dan Carpenter [Wed, 19 Jul 2023 10:16:10 +0000 (13:16 +0300)]
media: ov13b10: Fix some error checking in probe

The "ret = " assignment was missing, so ov13b10_power_on() is not
checked for errors.  Add the assignment.

Fixes: 6e28afd15228 ("media: ov13b10: add PM control support based on power resources")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agoMAINTAINERS: fix file path for Omnvision OV4689
Mikhail Rudenko [Thu, 3 Aug 2023 12:37:42 +0000 (15:37 +0300)]
MAINTAINERS: fix file path for Omnvision OV4689

Correct the driver source path specified in the MAINTAINERS file,
which was mistakenly set due to an oversight during the driver's
initial addition.

Signed-off-by: Mikhail Rudenko <mike.rudenko@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cx231xx: Add EP5_BUF_SIZE and EP5_TIMEOUT_MS macros
Jinjie Ruan [Sun, 3 Sep 2023 08:14:40 +0000 (16:14 +0800)]
media: cx231xx: Add EP5_BUF_SIZE and EP5_TIMEOUT_MS macros

Define EP5_BUF_SIZE and EP5_TIMEOUT_MS macros to make the code
more readable.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Suggested-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cx231xx: Switch to use kmemdup() helper
Jinjie Ruan [Sun, 3 Sep 2023 08:14:39 +0000 (16:14 +0800)]
media: cx231xx: Switch to use kmemdup() helper

Use kmemdup() helper instead of open-coding to
simplify the code.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: videobuf2: fix typo: vb2_dbuf -> vb2_qbuf
Hans Verkuil [Wed, 30 Aug 2023 12:31:40 +0000 (14:31 +0200)]
media: videobuf2: fix typo: vb2_dbuf -> vb2_qbuf

Fix a small typo in the debug message: vb2_dbuf -> vb2_qbuf

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
12 months agomedia: gspca: cpia1: shift-out-of-bounds in set_flicker
Rajeshwar R Shinde [Wed, 30 Aug 2023 07:44:01 +0000 (13:14 +0530)]
media: gspca: cpia1: shift-out-of-bounds in set_flicker

Syzkaller reported the following issue:
UBSAN: shift-out-of-bounds in drivers/media/usb/gspca/cpia1.c:1031:27
shift exponent 245 is too large for 32-bit type 'int'

When the value of the variable "sd->params.exposure.gain" exceeds the
number of bits in an integer, a shift-out-of-bounds error is reported. It
is triggered because the variable "currentexp" cannot be left-shifted by
more than the number of bits in an integer. In order to avoid invalid
range during left-shift, the conditional expression is added.

Reported-by: syzbot+e27f3dbdab04e43b9f73@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/20230818164522.12806-1-coolrrsh@gmail.com
Link: https://syzkaller.appspot.com/bug?extid=e27f3dbdab04e43b9f73
Signed-off-by: Rajeshwar R Shinde <coolrrsh@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: verisilicon: Do not enable G2 postproc downscale if source is narrower than...
Marek Vasut [Thu, 24 Aug 2023 01:39:35 +0000 (03:39 +0200)]
media: verisilicon: Do not enable G2 postproc downscale if source is narrower than destination

In case of encoded input VP9 data width that is not multiple of macroblock
size, which is 16 (e.g. 1080x1920 frames, where 1080 is multiple of 8), the
width is padded to be a multiple of macroblock size (for 1080x1920 frames,
that is 1088x1920).

The hantro_postproc_g2_enable() checks whether the encoded data width is
equal to decoded frame width, and if not, enables down-scale mode. For a
frame where input is 1080x1920 and output is 1088x1920, this is incorrect
as no down-scale happens, the frame is only padded. Enabling the down-scale
mode in this case results in corrupted frames.

Fix this by adjusting the check to test whether encoded data width is
greater than decoded frame width, and only in that case enable the
down-scale mode.

To generate input test data to trigger this bug, use e.g.:
$ gst-launch-1.0 videotestsrc ! video/x-raw,width=272,height=256,format=I420 ! \
                 vp9enc ! matroskamux ! filesink location=/tmp/test.vp9
To trigger the bug upon decoding (note that the NV12 must be forced, as
that assures the output data would pass the G2 postproc):
$ gst-launch-1.0 filesrc location=/tmp/test.vp9 ! matroskademux ! vp9parse ! \
                 v4l2slvp9dec ! video/x-raw,format=NV12 ! videoconvert ! fbdevsink

Fixes: 79c987de8b35 ("media: hantro: Use post processor scaling capacities")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: hantro: Check whether reset op is defined before use
Marek Vasut [Thu, 24 Aug 2023 01:38:58 +0000 (03:38 +0200)]
media: hantro: Check whether reset op is defined before use

The i.MX8MM/N/P does not define the .reset op since reset of the VPU is
done by genpd. Check whether the .reset op is defined before calling it
to avoid NULL pointer dereference.

Note that the Fixes tag is set to the commit which removed the reset op
from i.MX8M Hantro G2 implementation, this is because before this commit
all the implementations did define the .reset op.

Fixes: 6971efb70ac3 ("media: hantro: Allow i.MX8MQ G1 and G2 to run independently")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Adam Ford <aford173@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cobalt: Use list_for_each_entry() helper
Jinjie Ruan [Wed, 23 Aug 2023 07:16:52 +0000 (15:16 +0800)]
media: cobalt: Use list_for_each_entry() helper

Convert list_for_each() to list_for_each_entry() so that the p
list_head pointer and list_entry() call are no longer needed, which
can reduce a few lines of code. No functional changed.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: imx-jpeg: initiate a drain of the capture queue in dynamic resolution change
Ming Qian [Tue, 22 Aug 2023 01:45:06 +0000 (09:45 +0800)]
media: imx-jpeg: initiate a drain of the capture queue in dynamic resolution change

The last buffer from before the change must be marked,
with the V4L2_BUF_FLAG_LAST flag,
similarly to the Drain sequence above.

Meanwhile if V4L2_DEC_CMD_STOP is sent before
the source change triggered,
we need to restore the is_draing flag after
the draining in dynamic resolution change.

Fixes: b4e1fb8643da ("media: imx-jpeg: Support dynamic resolution change")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: c8sectpfe: Use the devm_clk_get_enabled() helper function
Ruan Jinjie [Fri, 18 Aug 2023 10:15:40 +0000 (18:15 +0800)]
media: c8sectpfe: Use the devm_clk_get_enabled() helper function

With devm_clk_get_enabled() the call to clk_disable_unprepare() can be
dropped from the error path and the remove callback.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: usb: siano: Use kmemdup to simplify kmalloc and memcpy logic
Chen Jiahao [Wed, 16 Aug 2023 02:23:23 +0000 (10:23 +0800)]
media: usb: siano: Use kmemdup to simplify kmalloc and memcpy logic

Using kmemdup() helper function rather than implementing it again
with kmalloc() + memcpy(), which improves the code readability.

Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb-usb: gp8psk: Remove an unnecessary ternary operator
Ruan Jinjie [Fri, 4 Aug 2023 06:55:23 +0000 (14:55 +0800)]
media: dvb-usb: gp8psk: Remove an unnecessary ternary operator

There is a ternary operator, the true or false judgement of which
is unnecessary in C language semantics.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: radio-wl1273: Remove an unnecessary ternary operator
Ruan Jinjie [Fri, 4 Aug 2023 06:55:22 +0000 (14:55 +0800)]
media: radio-wl1273: Remove an unnecessary ternary operator

There is a ternary operator, the true or false judgement of which
is unnecessary in C language semantics.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb-frontends: drx39xyj: Remove unnecessary ternary operators
Ruan Jinjie [Fri, 4 Aug 2023 06:55:21 +0000 (14:55 +0800)]
media: dvb-frontends: drx39xyj: Remove unnecessary ternary operators

There are a few ternary operators, the true or false judgement of which
is unnecessary in C language semantics.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: platform: cros-ec: Add Boxy to the match table
rasheed.hsueh [Fri, 18 Aug 2023 02:58:48 +0000 (10:58 +0800)]
media: platform: cros-ec: Add Boxy to the match table

The Google Boxy device uses the same approach as the Google Brask
which enables the HDMI CEC via the cros-ec-cec driver.

Signed-off-by: rasheed.hsueh <rasheed.hsueh@lcfc.corp-partner.google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: updated to the new multi-port datastructures]

12 months agomedia: cros-ec-cec: Add Constitution to the match table
Stefan Adolfsson [Wed, 16 Aug 2023 10:41:25 +0000 (12:41 +0200)]
media: cros-ec-cec: Add Constitution to the match table

Constitution has two HDMI ports which support CEC:
    Port B is EC port 0
    Port A is EC port 1

This patch depends on "media: cros-ec-cec: Add Dibbi to the match
table".

Signed-off-by: Stefan Adolfsson <sadolfsson@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: updated to the new multi-port datastructures]

12 months agomedia: cros-ec-cec: Add Dibbi to the match table
Reka Norman [Fri, 25 Aug 2023 02:44:02 +0000 (12:44 +1000)]
media: cros-ec-cec: Add Dibbi to the match table

Dibbi has two HDMI ports which support CEC:
Port D is EC port 0
Port B is EC port 1

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cros-ec-cec: Get number of CEC ports from EC
Reka Norman [Fri, 25 Aug 2023 02:44:01 +0000 (12:44 +1000)]
media: cros-ec-cec: Get number of CEC ports from EC

Add a new CEC port count host command and use it to query the number of
CEC ports from the EC. If the host command is not supported then it must
be old EC firmware which only supports one port, so fall back to
assuming one port.

This patch completes support for multiple ports in cros-ec-cec.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cros-ec-cec: Allow specifying multiple HDMI connectors
Reka Norman [Fri, 25 Aug 2023 02:44:00 +0000 (12:44 +1000)]
media: cros-ec-cec: Allow specifying multiple HDMI connectors

Update the cec_dmi_match_table to allow specifying multiple HDMI
connectors for each device.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cros-ec-cec: Support receiving messages from multiple ports
Reka Norman [Fri, 25 Aug 2023 02:43:59 +0000 (12:43 +1000)]
media: cros-ec-cec: Support receiving messages from multiple ports

Currently, received messages are sent from the EC in the cec_message
MKBP event. Since the size of ec_response_get_next_data_v1 is 16 bytes,
which is also the maximum size of a CEC message, there is no space to
add a port parameter. Increasing the size of
ec_response_get_next_data_v1 is an option, but this would increase
EC-kernel traffic for all MKBP event types.

Instead, use an event to notify that data is ready, and add a new read
command to read the data.

For backwards compatibility with old EC firmware, continue to handle
cec_message events as well.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cros-ec-cec: Support multiple ports in MKBP cec_events
Reka Norman [Fri, 25 Aug 2023 02:43:58 +0000 (12:43 +1000)]
media: cros-ec-cec: Support multiple ports in MKBP cec_events

Use the top four bits of the cec_events MKBP event to store the port
number.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cros-ec-cec: Support multiple ports in write command
Reka Norman [Fri, 25 Aug 2023 02:43:57 +0000 (12:43 +1000)]
media: cros-ec-cec: Support multiple ports in write command

Add a v1 of the CEC write command which contains a port parameter. Check
which versions of the write command the EC supports and use the highest
supported version. If it only supports v0, check that there is only one
port. With v0, the EC will assume all write commands are for port 0.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cros-ec-cec: Support multiple ports in set/get host commands
Reka Norman [Fri, 25 Aug 2023 02:43:56 +0000 (12:43 +1000)]
media: cros-ec-cec: Support multiple ports in set/get host commands

Reuse the top four bits of the cmd field to specify the port number.
The reason for doing this as opposed to adding a separate uint8_t field
is it avoids the need to add new versions of these commands. The change
is backwards compatible since these bits were previously always zero, so
the default behaviour is to always operate on port 0.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>