]> www.infradead.org Git - users/dwmw2/linux.git/log
users/dwmw2/linux.git
12 months agomedia: hi556: Add support for reset GPIO
Hans de Goede [Mon, 15 Apr 2024 13:10:36 +0000 (15:10 +0200)]
media: hi556: Add support for reset GPIO

On some ACPI platforms, such as Chromebooks the ACPI methods to
change the power-state (_PS0 and _PS3) fully take care of powering
on/off the sensor.

On other ACPI platforms, such as e.g. various HP models with IPU6 +
hi556 sensor, the sensor driver must control the reset GPIO itself.

Add support for having the driver control an optional reset GPIO.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: hi556: Return -EPROBE_DEFER if no endpoint is found
Hans de Goede [Mon, 15 Apr 2024 13:10:35 +0000 (15:10 +0200)]
media: hi556: Return -EPROBE_DEFER if no endpoint is found

With ipu bridge, endpoints may only be created when ipu bridge has
initialised. This may happen after the sensor driver has first probed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2680: Add camera orientation and sensor rotation controls
Hans de Goede [Mon, 15 Apr 2024 13:03:18 +0000 (15:03 +0200)]
media: ov2680: Add camera orientation and sensor rotation controls

Add camera orientation and sensor rotation controls using
the v4l2_fwnode_device_parse() and v4l2_ctrl_new_fwnode_properties()
helpers.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2680: Add hblank control
Hans de Goede [Mon, 15 Apr 2024 13:03:17 +0000 (15:03 +0200)]
media: ov2680: Add hblank control

Add hblank control so that the sensor has all the mandatory
controls for libcamera.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2680: Add vblank control
Hans de Goede [Mon, 15 Apr 2024 13:03:16 +0000 (15:03 +0200)]
media: ov2680: Add vblank control

Add vblank control to allow changing the framerate /
higher exposure values.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2680: Drop hts, vts ov2680_mode struct members
Hans de Goede [Mon, 15 Apr 2024 13:03:15 +0000 (15:03 +0200)]
media: ov2680: Drop hts, vts ov2680_mode struct members

The hts, vts ov2680_mode struct members always contain
OV2680_PIXELS_PER_LINE resp. OV2680_LINES_PER_FRAME,
drop them and simply use these values directly.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2680: Stop sending more data then requested
Hans de Goede [Mon, 15 Apr 2024 13:03:14 +0000 (15:03 +0200)]
media: ov2680: Stop sending more data then requested

There is no reason to send OV2680_END_MARGIN extra columns on top of
the mode width and the same for sending extra lines over the mode height.

This sending of extra lines/columns was inherited from the atomisp
ov2680 driver, it is unclear why this was done and this complicates
adding V4L2_CID_VBLANK support, so remove it.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2680: Do not fail if data-lanes property is absent
Fabio Estevam [Sun, 14 Apr 2024 21:09:06 +0000 (18:09 -0300)]
media: ov2680: Do not fail if data-lanes property is absent

Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint
property verification") the ov2680 driver no longer probes when the
'data-lanes' property is absent.

The OV2680 sensor has only one data lane, so there is no need for
describing it the devicetree.

Remove the unnecessary data-lanes property check.

Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: imx335: Limit analogue gain value
Umang Jain [Sun, 14 Apr 2024 14:06:21 +0000 (19:36 +0530)]
media: imx335: Limit analogue gain value

The sensor gain (both analog and digital) are controlled by a
single gain value where:
- 0dB to 30dB correspond to analog gain
- 30.3dB to 72dB correspond to digital gain
  (with 0.3dB step)

Hence, limit the analogue gain value to 100.
For digital gain, support can be added later if needed.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@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: imx335: Fix active area height discrepency
Umang Jain [Sun, 14 Apr 2024 14:06:20 +0000 (19:36 +0530)]
media: imx335: Fix active area height discrepency

The imx335 reports a recommended pixel area of - 2592x1944.
The driver supported mode however limits it to height=1940.

Fix the height discrepency by correctly the value of height
(with updates to vblank and mode registers).

The IMX335_REG_HTRIMMING should also be corrected to the start
offset(i.e. 48) instead of chosing a abritrary crop start of 384.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: imx335: Use integer values for size registers
Umang Jain [Sun, 14 Apr 2024 14:06:19 +0000 (19:36 +0530)]
media: imx335: Use integer values for size registers

Consider integer values for registers that are related to various
sizes in the register map. This helps in improving the overall
readability.

No functional changes intended in this patch.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: imx335: Use V4L2 CCI for accessing sensor registers
Umang Jain [Sun, 14 Apr 2024 14:06:18 +0000 (19:36 +0530)]
media: imx335: Use V4L2 CCI for accessing sensor registers

Use the new comon CCI register access helpers to replace the private
register access helpers in the imx335 driver.

Select V4L2_CCI_I2C Kconfig option which the imx335 driver now
depends on.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: imx335: Parse fwnode properties
Kieran Bingham [Sun, 14 Apr 2024 14:06:17 +0000 (19:36 +0530)]
media: imx335: Parse fwnode properties

Call the V4L2 fwnode device parser to handle controls that are
standardised by the framework.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: imx335: Support 2 or 4 lane operation modes
Kieran Bingham [Sun, 14 Apr 2024 14:06:16 +0000 (19:36 +0530)]
media: imx335: Support 2 or 4 lane operation modes

The IMX335 can support both 2 and 4 lane configurations.
Extend the driver to configure the lane mode accordingly.
Update the pixel rate depending on the number of lanes in use.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@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>
[hverkuil: fixup missing : in @lane_mode kerneldoc line]

12 months agomedia: v4l2-ctrls: Return handler error in creating new fwnode properties
Sakari Ailus [Fri, 12 Apr 2024 12:56:49 +0000 (15:56 +0300)]
media: v4l2-ctrls: Return handler error in creating new fwnode properties

If the control handler is in an error state, return that error immediately
in v4l2_ctrl_new_fwnode_properties(). Effectively the change here is that
the same error code (handler's error) is returned in all cases instead of
possibly returning -EINVAL.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: staging: ipu3-imgu: Update firmware path
Sakari Ailus [Thu, 11 Apr 2024 06:54:04 +0000 (09:54 +0300)]
media: staging: ipu3-imgu: Update firmware path

Use the current firmware path in linux-firmware repository. Check the
older paths still in order to avoid causing issues to the users.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l: Don't turn on privacy LED if streamon fails
Sakari Ailus [Wed, 10 Apr 2024 09:58:44 +0000 (12:58 +0300)]
media: v4l: Don't turn on privacy LED if streamon fails

Turn on the privacy LED only if streamon succeeds. This can be done after
enabling streaming on the sensor.

Fixes: b6e10ff6c23d ("media: v4l2-core: Make the v4l2-core code enable/disable the privacy LED if present")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ti: j721e-csi2rx: Fix races while restarting DMA
Jai Luthra [Fri, 23 Feb 2024 08:23:02 +0000 (13:53 +0530)]
media: ti: j721e-csi2rx: Fix races while restarting DMA

After the frame is submitted to DMA, it may happen that the submitted
list is not updated soon enough, and the DMA callback is triggered
before that.

This can lead to kernel crashes, so move everything in a single
lock/unlock section to prevent such races.

Fixes: b4a3d877dc92 ("media: ti: Add CSI2RX support for J721E")
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cadence: csi2rx: configure DPHY before starting source stream
Pratyush Yadav [Fri, 23 Feb 2024 08:23:01 +0000 (13:53 +0530)]
media: cadence: csi2rx: configure DPHY before starting source stream

When the source device is operating above 1.5 Gbps per lane, it needs to
send the Skew Calibration Sequence before sending any HS data. If the
DPHY is initialized after the source stream is started, then it might
miss the sequence and not be able to receive data properly. Move the
start of source subdev to the end of the sequence to make sure
everything is ready to receive data before the source starts streaming.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Fixes: 3295cf1241d3 ("media: cadence: Add support for external dphy")
Tested-by: Julien Massot <julien.massot@collabora.com>
Tested-by: Changhuang Liang <Changhuang.liang@starfivetech.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
Reviewed-by: Changhuang Liang <Changhuang.liang@starfivetech.com>
Signed-off-by: Jai Luthra <j-luthra@ti.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: mc: mark the media devnode as registered from the, start
Hans Verkuil [Fri, 23 Feb 2024 08:46:19 +0000 (09:46 +0100)]
media: mc: mark the media devnode as registered from the, start

First the media device node was created, and if successful it was
marked as 'registered'. This leaves a small race condition where
an application can open the device node and get an error back
because the 'registered' flag was not yet set.

Change the order: first set the 'registered' flag, then actually
register the media device node. If that fails, then clear the flag.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Fixes: cf4b9211b568 ("[media] media: Media device node support")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
12 months agomedia: dt-bindings: i2c: use absolute path to other schema
Alexander Stein [Fri, 1 Mar 2024 08:40:08 +0000 (09:40 +0100)]
media: dt-bindings: i2c: use absolute path to other schema

Absolute path to other DT schema is preferred over relative one.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart+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: dt-bindings: sony,imx290: Allow props from video-interface-devices
Alexander Stein [Fri, 1 Mar 2024 08:40:07 +0000 (09:40 +0100)]
media: dt-bindings: sony,imx290: Allow props from video-interface-devices

Allow properties from video-interface-devices. This aligns the bindings
to sony,imx415.yaml. Changes inspired by commit e2e73ed46c395 ("media:
dt-bindings: sony,imx415: Allow props from video-interface-devices")

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-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 agoMerge tag 'tags/media-next-imx-20240419' of git://git.kernel.org/pub/scm/linux/kernel...
Hans Verkuil [Mon, 22 Apr 2024 08:44:31 +0000 (10:44 +0200)]
Merge tag 'tags/media-next-imx-20240419' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git into media_stage

NXP media drivers improvements.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.linuxtv.org/project/linux-media/patch/20240419103822.GA6868@pendragon.ideasonboard.com/
12 months agomedia: dt-bindings: nxp,imx8-isi: Refuse port@1 for single pipeline models
Alexander Stein [Fri, 12 Apr 2024 09:55:49 +0000 (11:55 +0200)]
media: dt-bindings: nxp,imx8-isi: Refuse port@1 for single pipeline models

In case the hardware only supports just one pipeline, explicitly refuse
port@1 in ports node.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240412095549.258870-1-alexander.stein@ew.tq-group.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
12 months agomedia: mipi-csis: Emit V4L2_EVENT_FRAME_SYNC events
Stefan Klug [Thu, 14 Mar 2024 09:36:50 +0000 (10:36 +0100)]
media: mipi-csis: Emit V4L2_EVENT_FRAME_SYNC events

The Samsung CSIS MIPI receiver provides a start-of-frame interrupt and
a framecount register. As the CSI receiver is the hardware unit that lies
closest to the sensor, the frame counter is the best we can get on these
devices. In case of the ISI available on the i.MX8 M Plus it is also the
only native start-of-frame signal available.

This patch exposes the sof interrupt and the framecount as
V4L2_EVENT_FRAME_SYNC event on the subdevice.

It was tested on a Debix-Som-A with a 6.8-rc4 kernel.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Link: https://lore.kernel.org/r/20240314093652.56923-1-stefan.klug@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
12 months agomedia: usb: siano: Fix allocation of urbs
Ricardo Ribalda [Mon, 15 Apr 2024 12:48:13 +0000 (12:48 +0000)]
media: usb: siano: Fix allocation of urbs

USB urbs must be allocated with usb_alloc_urb. Quoting the manual

Only use this function (usb_init_urb) if you _really_ understand what you
are doing.

Fix the following smatch error:

drivers/media/usb/siano/smsusb.c:53:38: warning: array of flexible structures

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: logging
Stefan Herdler [Mon, 15 Apr 2024 02:24:11 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: logging

This patch fixes the following checkpatch warnings:

WARNING:PRINTK_WITHOUT_KERN_LEVEL: printk() should include KERN_<LEVEL> facility level
WARNING:PREFER_PR_LEVEL: Prefer [subsystem eg: netdev]_dbg([subsystem]dev, ... then dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG ...
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'ciintf_slot_ts_enable', this function's name, in a string
CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'level' may be better as '(level)' to avoid precedence issues

There was no consistent style of logging functions used so far.
Convert all logging to the appropriate pr_* macros.
Add a global pr_fmt macro for the whole driver.

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: miscellaneous
Stefan Herdler [Mon, 15 Apr 2024 02:24:10 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: miscellaneous

This patch fixes the following checkpatch warnings:

WARNING:RETURN_VOID: void function return statements are not generally useful
WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: constant_comparsation
Stefan Herdler [Mon, 15 Apr 2024 02:24:09 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: constant_comparsation

This patch fixes the following checkpatch warnings:

WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: trailing_statements
Stefan Herdler [Mon, 15 Apr 2024 02:24:08 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: trailing_statements

This patch fixes the following checkpatch errors:

ERROR:TRAILING_STATEMENTS: trailing statements should be on next line

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: assign_in_if
Stefan Herdler [Mon, 15 Apr 2024 02:24:07 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: assign_in_if

This patch fixes the following checkpatch errors:

ERROR:ASSIGN_IN_IF: do not use assignment in if condition

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: export_symbol
Stefan Herdler [Mon, 15 Apr 2024 02:24:06 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: export_symbol

This patch fixes the following checkpatch warnings:

WARNING:EXPORT_SYMBOL: EXPORT_SYMBOL(foo); should immediately follow its function/variable

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: braces
Stefan Herdler [Mon, 15 Apr 2024 02:24:05 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: braces

This patch fixes the following checkpatch warnings and errors:

WARNING:BRACES: braces {} are not necessary for any arm of this statement
WARNING:BRACES: braces {} are not necessary for single statement blocks
ERROR:OPEN_BRACE: that open brace { should be on the previous line
CHECK:BRACES: braces {} should be used on all arms of this statement
CHECK:BRACES: Unbalanced braces around else statement

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: comments
Stefan Herdler [Mon, 15 Apr 2024 02:24:04 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: comments

This patch fixes the following checkpatch warnings:

WARNING:BLOCK_COMMENT_STYLE: Block comments use * on subsequent lines
WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
WARNING: It's generally not useful to have the filename in the file

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: whitespace
Stefan Herdler [Mon, 15 Apr 2024 02:24:03 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: whitespace

It fixes the following checkpatch errors:

ERROR:SPACING: space prohibited before that ',' (ctx:WxW)
ERROR:SPACING: space required after that ',' (ctx:VxV)
ERROR:SWITCH_CASE_INDENT_LEVEL: switch and case should be at the same indent

This patch contains the large multi line blocks.

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: coding style fixes: whitespace and newlines
Stefan Herdler [Mon, 15 Apr 2024 02:24:02 +0000 (04:24 +0200)]
media: ttpci: coding style fixes: whitespace and newlines

This patch fixes the following checkpatch warnings and errors:

ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar"
ERROR:POINTER_LOCATION: "foo* bar" should be "foo *bar"
ERROR:SPACING: space prohibited after that open parenthesis '('
ERROR:SPACING: space prohibited before that close parenthesis ')'
ERROR:SPACING: space prohibited before that ',' (ctx:WxW)
ERROR:SPACING: space required after that ',' (ctx:VxV)
ERROR:SPACING: space required before that '-' (ctx:OxV)
ERROR:SPACING: space required before the open parenthesis '('
ERROR:SPACING: spaces required around that '!=' (ctx:VxO)
ERROR:SPACING: spaces required around that '<' (ctx:VxV)
ERROR:SPACING: spaces required around that '=' (ctx:VxV)
ERROR:SPACING: spaces required around that '>=' (ctx:VxV)
WARNING:SPACING: space prohibited between function name and open parenthesis '('
WARNING:TABSTOP: Statements should start on a tabstop
WARNING:LEADING_SPACE: please, no spaces at the start of a line
WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements
WARNING:LINE_SPACING: Missing a blank line after declarations

Signed-off-by: Stefan Herdler <herdler@nurfuerspam.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: adv7180: Only request valids IRQs
Ricardo Ribalda [Wed, 10 Apr 2024 21:54:42 +0000 (21:54 +0000)]
media: adv7180: Only request valids IRQs

i2c_device_probe(), seems to assume that irq = 0 means that there is no
irq to request.

The driver also believes that on the clean path. So lets be consistent
here.

Also make smatch happy.

Fix:
drivers/media/i2c/adv7180.c:1526 adv7180_probe() warn: 'client->irq' from request_threaded_irq() not released on lines: 1526

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l2-ctrls-core.c: Do not use iterator outside loop
Ricardo Ribalda [Wed, 10 Apr 2024 21:54:41 +0000 (21:54 +0000)]
media: v4l2-ctrls-core.c: Do not use iterator outside loop

Simplify a bit the code introducing a new variable for iterating through
the control list.

It also makes smatch happy:

drivers/media/v4l2-core/v4l2-ctrls-api.c:1091 v4l2_query_ext_ctrl() warn: iterator used outside loop: 'ref'

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: fix tiny whitespace issue in 'pos  = ref': use just one space]

12 months agomedia: platform: sti: hva: clk_unprepare unconditionally
Ricardo Ribalda [Wed, 10 Apr 2024 21:54:40 +0000 (21:54 +0000)]
media: platform: sti: hva: clk_unprepare unconditionally

hva->clk cannot be NULL at this point. Simplify the code and make smatch
happy:

drivers/media/platform/st/sti/hva/hva-hw.c:412 hva_hw_probe() warn: 'hva->clk' from clk_prepare() not released on lines: 412

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cxd2880: Replaze kmalloc with kzalloc
Ricardo Ribalda [Wed, 10 Apr 2024 21:54:39 +0000 (21:54 +0000)]
media: cxd2880: Replaze kmalloc with kzalloc

Fix smatch error:
drivers/media/spi/cxd2880-spi.c:391 cxd2880_start_feed() warn: Please consider using kzalloc instead of kmalloc

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb-usb: dib0700_devices: Add missing release_firmware()
Ricardo Ribalda [Thu, 11 Apr 2024 21:17:56 +0000 (21:17 +0000)]
media: dvb-usb: dib0700_devices: Add missing release_firmware()

Add missing release_firmware on the error paths.

drivers/media/usb/dvb-usb/dib0700_devices.c:2415 stk9090m_frontend_attach() warn: 'state->frontend_firmware' from request_firmware() not released on lines: 2415.
drivers/media/usb/dvb-usb/dib0700_devices.c:2497 nim9090md_frontend_attach() warn: 'state->frontend_firmware' from request_firmware() not released on lines: 2489,2497.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb-frontends: drx39xyj: Refactor firmware upload
Ricardo Ribalda [Thu, 11 Apr 2024 21:17:55 +0000 (21:17 +0000)]
media: dvb-frontends: drx39xyj: Refactor firmware upload

Do not cache the file, instead load it on demand.

This makes smatch a happy parser:
drivers/media/dvb-frontends/drx39xyj/drxj.c:11908 drx_ctrl_u_code() warn: 'fw' from request_firmware() not released on lines: 11877,11886,11896.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: tunner: xc5000: Refactor firmware load
Ricardo Ribalda [Thu, 11 Apr 2024 21:17:54 +0000 (21:17 +0000)]
media: tunner: xc5000: Refactor firmware load

Make sure the firmware is released when we leave
xc_load_fw_and_init_tuner()

This change makes smatch happy:
drivers/media/tuners/xc5000.c:1213 xc_load_fw_and_init_tuner() warn: 'fw' from request_firmware() not released on lines: 1213.

Cc: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: c8sectpfe: Refactor load_c8sectpfe_fw
Ricardo Ribalda [Thu, 11 Apr 2024 21:17:53 +0000 (21:17 +0000)]
media: c8sectpfe: Refactor load_c8sectpfe_fw

release_firmware() in the same function that it was requested. It is
more clear and makes smatch happy.

drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c:1146 load_c8sectpfe_fw() warn: 'fw' from request_firmware() not released on lines: 1125,1132.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: saa7134: Use devm_request_irq
Ricardo Ribalda [Thu, 11 Apr 2024 21:17:52 +0000 (21:17 +0000)]
media: saa7134: Use devm_request_irq

The handled version of request_irq let us remove the free_irq and makes
smatch happier:

drivers/media/pci/saa7134/saa7134-alsa.c:1186 alsa_card_saa7134_create() warn: 'dev->pci->irq' from request_irq() not released on lines: 1186

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: solo6x10: Use devm functions
Ricardo Ribalda [Thu, 11 Apr 2024 21:17:51 +0000 (21:17 +0000)]
media: solo6x10: Use devm functions

Let devm handle the life cycle of the irq request.

Makes smatch happier:

drivers/media/pci/solo6x10/solo6x10-core.c:631 solo_pci_probe() warn: 'pdev' from pci_request_regions() not released on lines: 631.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: solo6x10: Use pcim functions
Ricardo Ribalda [Thu, 11 Apr 2024 21:17:50 +0000 (21:17 +0000)]
media: solo6x10: Use pcim functions

Instead of handling manually the release of the memory regions let devm
do that for us.

Makes smatch happy:
drivers/media/pci/solo6x10/solo6x10-core.c:631 solo_pci_probe() warn: 'pdev' from pci_request_regions() not released on lines: 631.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: videodev2: Fix v4l2_ext_control packing.
Ricardo Ribalda [Wed, 10 Apr 2024 12:24:39 +0000 (12:24 +0000)]
media: videodev2: Fix v4l2_ext_control packing.

The structure is packed, which requires that all its fields need to be
also packed.

./include/uapi/linux/videodev2.h:1810:2: warning: field  within 'struct v4l2_ext_control' is less aligned than 'union v4l2_ext_control::(anonymous at ./include/uapi/linux/videodev2.h:1810:2)' and is usually due to 'struct v4l2_ext_control' being packed, which can lead to unaligned accesses [-Wunaligned-access]

Explicitly set the inner union as packed.

Marking the inner union as 'packed' does not change the layout, since the
whole struct is already packed, it just silences the clang warning. See
also this llvm discussion:

https://github.com/llvm/llvm-project/issues/55520

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb: Fix dtvs_stats packing.
Ricardo Ribalda [Wed, 10 Apr 2024 12:24:38 +0000 (12:24 +0000)]
media: dvb: Fix dtvs_stats packing.

The structure is packed, which requires that all its fields need to be
also packed.

./include/uapi/linux/dvb/frontend.h:854:2: warning: field  within 'struct dtv_stats' is less aligned than 'union dtv_stats::(anonymous at ./include/uapi/linux/dvb/frontend.h:854:2)' and is usually due to 'struct dtv_stats' being packed, which can lead to unaligned accesses [-Wunaligned-access]

Explicitly set the inner union as packed.

Marking the inner union as 'packed' does not change the layout, since the
whole struct is already packed, it just silences the clang warning. See
also this llvm discussion:

https://github.com/llvm/llvm-project/issues/55520

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb: as102-fe: Fix as10x_register_addr packing
Ricardo Ribalda [Wed, 10 Apr 2024 12:24:37 +0000 (12:24 +0000)]
media: dvb: as102-fe: Fix as10x_register_addr packing

This structure is embedded in multiple other structures that are packed,
which conflicts with it being aligned.

drivers/media/usb/as102/as10x_cmd.h:379:30: warning: field reg_addr within 'struct as10x_dump_memory::(unnamed at drivers/media/usb/as102/as10x_cmd.h:373:2)' is less aligned than 'struct as10x_register_addr' and is usually due to 'struct as10x_dump_memory::(unnamed at drivers/media/usb/as102/as10x_cmd.h:373:2)' being packed, which can lead to unaligned accesses [-Wunaligned-access]

Mark it as being packed.

Marking the inner struct as 'packed' does not change the layout, since the
whole struct is already packed, it just silences the clang warning. See
also this llvm discussion:

https://github.com/llvm/llvm-project/issues/55520

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: c8sectpfe: Do not depend on DEBUG_FS
Ricardo Ribalda [Thu, 11 Apr 2024 12:14:03 +0000 (12:14 +0000)]
media: c8sectpfe: Do not depend on DEBUG_FS

Make dependency on DEBUG_FS conditional, that way we are not forced to
enable DEBUG_FS if we can to use this driver.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: atomisp: Implement link_setup() op for ISP subdev MC entity
Hans de Goede [Sun, 4 Feb 2024 16:01:45 +0000 (17:01 +0100)]
media: atomisp: Implement link_setup() op for ISP subdev MC entity

The atomisp driver's Android heritage makes it weird in that
even though it uses MC + subdev-s it is designed to primarily
be controlled through its /dev/video# node.

It implements s_input() on /dev/video# to select which sensor to use,
while ignoring link_setup() calls to enable a link to another sensor.

Add support for selecting the active sensor the MC way by adding
link_setup() support.

The implementation is a bit convoluted due to the atomisp driver's
heritage.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Make MC link from ISP to /dev/video# output node immutable
Hans de Goede [Sun, 4 Feb 2024 16:41:15 +0000 (17:41 +0100)]
media: atomisp: Make MC link from ISP to /dev/video# output node immutable

The link from the ISP's source pad to the /dev/video# output v4l2-dev
is always enabled and immutable, mark it as such.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Change ISP subdev name to "ATOM ISP"
Hans de Goede [Sun, 4 Feb 2024 09:50:49 +0000 (10:50 +0100)]
media: atomisp: Change ISP subdev name to "ATOM ISP"

Change the generic "ATOMISP_SUBDEV" name to "ATOM ISP" to make clear
that this is the subdev for the ISP itself.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Add DMABUF support
Hans de Goede [Fri, 2 Feb 2024 07:37:28 +0000 (08:37 +0100)]
media: atomisp: Add DMABUF support

Add DMABUF support and while at it drop userptr support.

Now that atomisp has been ported to videobuf2 this is trivial.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Stop setting sd->devnode for the ATOMISP_SUBDEV v4l2-subdev
Hans de Goede [Sun, 28 Jan 2024 12:43:30 +0000 (13:43 +0100)]
media: atomisp: Stop setting sd->devnode for the ATOMISP_SUBDEV v4l2-subdev

Stop setting sd->devnode for the ATOMISP_SUBDEV v4l2-subdev, so that
a proper /dev/v4l-subdev# gets created for it.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Remove ISP controls which get passed through to the camera
Hans de Goede [Sun, 4 Feb 2024 22:33:25 +0000 (23:33 +0100)]
media: atomisp: Remove ISP controls which get passed through to the camera

Drop all ISP controls and ioctls which just get passed through
to the camera subdev. Instead these calls should be done directly
at the sensor subdev.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Remove custom VCM handling
Hans de Goede [Sun, 4 Feb 2024 17:09:43 +0000 (18:09 +0100)]
media: atomisp: Remove custom VCM handling

Remove the custom VCM handling, instead the VCM should be controlled
through its own v4l2-subdev and the new ipu-bridge.c code already
supports instantiating an i2c_client for this and setting up
the necessary endpoints in the fwnode graph.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Rename atomisp_set_crop_and_fmt()
Hans de Goede [Sun, 4 Feb 2024 10:22:07 +0000 (11:22 +0100)]
media: atomisp: Rename atomisp_set_crop_and_fmt()

Rename atomisp_set_crop_and_fmt() to atomisp_set_sensor_crop_and_fmt()
to make clear that it operates on the sensor subdev.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Remove isp_subdev_propagate()
Hans de Goede [Sat, 3 Feb 2024 11:42:06 +0000 (12:42 +0100)]
media: atomisp: Remove isp_subdev_propagate()

isp_subdev_propagate() is a wrapper around atomisp_subdev_set_selection()
which gets only used in a single place.

Call atomisp_subdev_set_selection() directly in that single place instead.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: ssh_css: Fix a null-pointer dereference in load_video_binaries
Zhipeng Lu [Thu, 18 Jan 2024 15:13:00 +0000 (16:13 +0100)]
media: atomisp: ssh_css: Fix a null-pointer dereference in load_video_binaries

The allocation failure of mycs->yuv_scaler_binary in load_video_binaries()
is followed with a dereference of mycs->yuv_scaler_binary after the
following call chain:

sh_css_pipe_load_binaries()
  |-> load_video_binaries(mycs->yuv_scaler_binary == NULL)
  |
  |-> sh_css_pipe_unload_binaries()
        |-> unload_video_binaries()

In unload_video_binaries(), it calls to ia_css_binary_unload with argument
&pipe->pipe_settings.video.yuv_scaler_binary[i], which refers to the
same memory slot as mycs->yuv_scaler_binary. Thus, a null-pointer
dereference is triggered.

Link: https://lore.kernel.org/r/20240118151303.3828292-1-alexious@zju.edu.cn
Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: atomisp: Fix double negation in unsupported revision error
Hans de Goede [Mon, 19 Feb 2024 13:19:56 +0000 (14:19 +0100)]
media: atomisp: Fix double negation in unsupported revision error

s/is not unsupported/is not supported/ in the unsupported revision
error.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: v4l2-subdev: Fix stream handling for crop API
Laurent Pinchart [Mon, 1 Apr 2024 23:37:25 +0000 (02:37 +0300)]
media: v4l2-subdev: Fix stream handling for crop API

When support for streams was added to the V4L2 subdev API, the
v4l2_subdev_crop structure was extended with a stream field, but the
field was not handled in the core code that translates the
VIDIOC_SUBDEV_[GS]_CROP ioctls to the selection API. Fix it.

Fixes: 2f91e10ee6fd ("media: subdev: add stream based configuration")
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: mc: Fix graph walk in media_pipeline_start
Tomi Valkeinen [Mon, 18 Mar 2024 09:50:59 +0000 (11:50 +0200)]
media: mc: Fix graph walk in media_pipeline_start

The graph walk tries to follow all links, even if they are not between
pads. This causes a crash with, e.g. a MEDIA_LNK_FL_ANCILLARY_LINK link.

Fix this by allowing the walk to proceed only for MEDIA_LNK_FL_DATA_LINK
links.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: stable@vger.kernel.org # for 6.1 and later
Fixes: ae219872834a ("media: mc: entity: Rewrite media_pipeline_start()")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agostaging: media: ipu3-imgu: Update e-mail addresses
Sakari Ailus [Thu, 4 Apr 2024 08:41:15 +0000 (11:41 +0300)]
staging: media: ipu3-imgu: Update e-mail addresses

Remove e-mail addresses no longer in use.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dw9714: Update e-mail addresses
Sakari Ailus [Thu, 4 Apr 2024 08:37:39 +0000 (11:37 +0300)]
media: dw9714: Update e-mail addresses

Remove inactive e-mail addresses.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ipu3-cio2: Update e-mail addresses
Sakari Ailus [Thu, 4 Apr 2024 08:32:59 +0000 (11:32 +0300)]
media: ipu3-cio2: Update e-mail addresses

Remove e-mail addresses that are no longer valid.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: et8ek8: Don't strip remove function when driver is builtin
Uwe Kleine-König [Sun, 24 Mar 2024 16:00:44 +0000 (17:00 +0100)]
media: i2c: et8ek8: Don't strip remove function when driver is builtin

Using __exit for the remove function results in the remove callback
being discarded with CONFIG_VIDEO_ET8EK8=y. When such a device gets
unbound (e.g. using sysfs or hotplug), the driver is just removed
without the cleanup being performed. This results in resource leaks. Fix
it by compiling in the remove callback unconditionally.

This also fixes a W=1 modpost warning:

WARNING: modpost: drivers/media/i2c/et8ek8/et8ek8: section mismatch in reference: et8ek8_i2c_driver+0x10 (section: .data) -> et8ek8_remove (section: .exit.text)

Fixes: c5254e72b8ed ("[media] media: Driver for Toshiba et8ek8 5MP sensor")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ipu-cio2: Remove unnecessary runtime PM power state setting
Bjorn Helgaas [Mon, 25 Mar 2024 22:03:25 +0000 (17:03 -0500)]
media: ipu-cio2: Remove unnecessary runtime PM power state setting

ipu-cio2 uses generic power management, and pci_pm_runtime_suspend() and
pci_pm_runtime_resume() already take care of setting the PCI device power
state, so the driver doesn't need to do it explicitly.

Remove explicit setting to D3hot or D0 during runtime suspend and resume.

Remove #defines that are no longer used.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Hyungwoo Yang <hyungwoo.yang@intel.com>
Cc: Rajmohan Mani <rajmohan.mani@intel.com>
Cc: Vijaykumar Ramya <ramya.vijaykumar@intel.com>
Cc: Samu Onkalo <samu.onkalo@intel.com>
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Jouni Ukkonen <jouni.ukkonen@intel.com>
Cc: Antti Laakso <antti.laakso@intel.com>
[Sakari Ailus: Remove now-redundant local variables.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agostaging: media: imx: Remove duplicate Kconfig dependency
Rajeshwar R Shinde [Fri, 29 Mar 2024 05:44:46 +0000 (11:14 +0530)]
staging: media: imx: Remove duplicate Kconfig dependency

The kernel configuration VIDEO_DEV is defined twice in Kconfig.
Thus, the duplicate Kconfig dependency is removed.

Signed-off-by: Rajeshwar R Shinde <coolrrsh@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agostaging: media: ipu3: remove redundant assignment to pointer css_pipe
Colin Ian King [Thu, 28 Mar 2024 11:44:55 +0000 (11:44 +0000)]
staging: media: ipu3: remove redundant assignment to pointer css_pipe

Pointer css_pipe is being assigned a value that is never read afterwards.
The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/staging/media/ipu3/ipu3-css.c:2058:3: warning: Value stored
to 'css_pipe' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.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: ovti,ov2680: Document link-frequencies
Fabio Estevam [Tue, 2 Apr 2024 17:40:28 +0000 (14:40 -0300)]
media: dt-bindings: ovti,ov2680: Document link-frequencies

Document the link-frequencies property as recommended by the following
document:

https://www.kernel.org/doc/html/v6.9-rc1/driver-api/media/camera-sensor.html#handling-clocks

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: dt-bindings: ovti,ov2680: Fix the power supply names
Fabio Estevam [Tue, 2 Apr 2024 17:40:27 +0000 (14:40 -0300)]
media: dt-bindings: ovti,ov2680: Fix the power supply names

The original .txt bindings had the OV2680 power supply names correct,
but the transition from .txt to yaml spelled them incorrectly.

Fix the OV2680 power supply names as the original .txt bindings
as these are the names used by the OV2680 driver and in devicetree.

Fixes: 57226cd8c8bf ("media: dt-bindings: ov2680: convert bindings to 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: ov2680: Allow probing if link-frequencies is absent
Fabio Estevam [Thu, 28 Mar 2024 22:44:13 +0000 (19:44 -0300)]
media: ov2680: Allow probing if link-frequencies is absent

Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint
property verification") the ov2680 no longer probes on a imx7s-warp7:

ov2680 1-0036: error -EINVAL: supported link freq 330000000 not found
ov2680 1-0036: probe with driver ov2680 failed with error -22

As the 'link-frequencies' property is not mandatory, allow the probe
to succeed by skipping the link-frequency verification when the
property is absent.

Cc: stable@vger.kernel.org
Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2680: Clear the 'ret' variable on success
Fabio Estevam [Thu, 28 Mar 2024 22:44:12 +0000 (19:44 -0300)]
media: ov2680: Clear the 'ret' variable on success

Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint
property verification") even when the correct 'link-frequencies'
property is passed in the devicetree, the driver fails to probe:

ov2680 1-0036: probe with driver ov2680 failed with error -22

The reason is that the variable 'ret' may contain the -EINVAL value
from a previous assignment:

ret = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency",
       &rate);

Fix the problem by clearing 'ret' on the successful path.

Tested on imx7s-warp board with the following devicetree:

port {
ov2680_to_mipi: endpoint {
remote-endpoint = <&mipi_from_sensor>;
clock-lanes = <0>;
data-lanes = <1>;
link-frequencies = /bits/ 64 <330000000>;
};
};

Cc: stable@vger.kernel.org
Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification")
Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ov2740: Fix LINK_FREQ and PIXEL_RATE control value reporting
Sakari Ailus [Wed, 27 Mar 2024 08:57:31 +0000 (10:57 +0200)]
media: ov2740: Fix LINK_FREQ and PIXEL_RATE control value reporting

The driver dug the supported link frequency up from the V4L2 fwnode
endpoint and used it internally, but failed to report this in the
LINK_FREQ and PIXEL_RATE controls. Fix this.

Fixes: 0677a2d9b735 ("media: ov2740: Add support for 180 MHz link frequency")
Cc: stable@vger.kernel.org # for v6.8 and later
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l: async: Properly re-initialise notifier entry in unregister
Sakari Ailus [Fri, 8 Mar 2024 13:06:13 +0000 (15:06 +0200)]
media: v4l: async: Properly re-initialise notifier entry in unregister

The notifier_entry of a notifier is not re-initialised after unregistering
the notifier. This leads to dangling pointers being left there so use
list_del_init() to return the notifier_entry an empty list.

Fixes: b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init")
Cc: <stable@vger.kernel.org> # for 6.6 and later
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l: async: Don't set notifier's V4L2 device if registering fails
Sakari Ailus [Fri, 8 Mar 2024 13:07:45 +0000 (15:07 +0200)]
media: v4l: async: Don't set notifier's V4L2 device if registering fails

The V4L2 device used to be set when the notifier was registered but this
has been moved to the notifier initialisation. Don't touch the V4L2 device
if registration fails.

Fixes: b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init")
Cc: <stable@vger.kernel.org> # for 6.6 and later
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l: async: Fix notifier list entry init
Alexander Stein [Thu, 7 Mar 2024 14:24:51 +0000 (15:24 +0100)]
media: v4l: async: Fix notifier list entry init

struct v4l2_async_notifier has several list_head members, but only
waiting_list and done_list are initialized. notifier_entry was kept
'zeroed' leading to an uninitialized list_head.
This results in a NULL-pointer dereference if csi2_async_register() fails,
e.g. node for remote endpoint is disabled, and returns -ENOTCONN.
The following calls to v4l2_async_nf_unregister() results in a NULL
pointer dereference.
Add the missing list head initializer.

Fixes: b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init")
Cc: <stable@vger.kernel.org> # for 6.6 and later
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: mc: Add nop implementations of media_device_{init,cleanup}
Sakari Ailus [Wed, 22 Nov 2017 15:30:45 +0000 (17:30 +0200)]
media: mc: Add nop implementations of media_device_{init,cleanup}

To support compilation with Media controller disabled, drivers were
required to conditionally call media_device_init and media_device_cleanup.
Add nop implementations of both so drivers don't need to care (or at least
care less).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ipu3-cio2: Request IRQ earlier
Sakari Ailus [Tue, 20 Dec 2022 14:01:20 +0000 (16:01 +0200)]
media: ipu3-cio2: Request IRQ earlier

Call devm_request_irq() before registering the async notifier, as otherwise
it would be possible to use the device before the interrupts could be
delivered to the driver.

Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l2-subdev: Remove non-pad dv timing callbacks
Paweł Anikiel [Fri, 5 Apr 2024 14:14:11 +0000 (14:14 +0000)]
media: v4l2-subdev: Remove non-pad dv timing callbacks

After the conversion of dv timing calls to use a pad argument is done,
remove the old callbacks. Update the subdev ioctl handlers to use the
new callbacks.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: tegra-video: Use pad variant of dv timing subdev calls
Paweł Anikiel [Fri, 5 Apr 2024 14:14:10 +0000 (14:14 +0000)]
media: tegra-video: Use pad variant of dv timing subdev calls

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: vpif_display: Use pad variant of dv timing subdev calls
Paweł Anikiel [Mon, 8 Apr 2024 15:10:02 +0000 (15:10 +0000)]
media: vpif_display: Use pad variant of dv timing subdev calls

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: vpif_capture: Use pad variant of dv timing subdev calls
Paweł Anikiel [Fri, 5 Apr 2024 14:14:09 +0000 (14:14 +0000)]
media: vpif_capture: Use pad variant of dv timing subdev calls

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: rcar-vin: Use pad variant of dv timing subdev calls
Paweł Anikiel [Fri, 5 Apr 2024 14:14:08 +0000 (14:14 +0000)]
media: rcar-vin: Use pad variant of dv timing subdev calls

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cobalt: Use pad variant of dv timing subdev calls
Paweł Anikiel [Fri, 5 Apr 2024 14:14:07 +0000 (14:14 +0000)]
media: cobalt: Use pad variant of dv timing subdev calls

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: spi: gs1662: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:14:06 +0000 (14:14 +0000)]
media: spi: gs1662: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]

12 months agomedia: i2c: tvp7002: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:14:05 +0000 (14:14 +0000)]
media: i2c: tvp7002: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]

12 months agomedia: i2c: ths8200: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:14:04 +0000 (14:14 +0000)]
media: i2c: ths8200: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: ths7303: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:14:03 +0000 (14:14 +0000)]
media: i2c: ths7303: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]

12 months agomedia: i2c: tda1997x: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:14:02 +0000 (14:14 +0000)]
media: i2c: tda1997x: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]

12 months agomedia: i2c: tc358743: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:14:01 +0000 (14:14 +0000)]
media: i2c: tc358743: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]

12 months agomedia: i2c: adv7842: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:14:00 +0000 (14:14 +0000)]
media: i2c: adv7842: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: i2c: adv7604: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:13:59 +0000 (14:13 +0000)]
media: i2c: adv7604: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]

12 months agomedia: i2c: adv7511: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:13:58 +0000 (14:13 +0000)]
media: i2c: adv7511: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: align to open parenthesis]

12 months agomedia: i2c: adv748x: Switch dv timing callbacks to pad ops
Paweł Anikiel [Fri, 5 Apr 2024 14:13:57 +0000 (14:13 +0000)]
media: i2c: adv748x: Switch dv timing callbacks to pad ops

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l2-subdev: Add pad versions of dv timing subdev calls
Paweł Anikiel [Fri, 5 Apr 2024 14:13:56 +0000 (14:13 +0000)]
media: v4l2-subdev: Add pad versions of dv timing subdev calls

Currently, subdev dv timing calls (i.e. g/s/query_dv_timings) are video
ops without a pad argument. This is a problem if the subdevice can have
different dv timings for each pad (e.g. a DisplayPort receiver with
multiple virtual channels).

To solve this, change these calls to include a pad argument, and put
them into pad ops. Keep the old ones temporarily to make the switch
easier.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: qcom: camss: vfe-17x: Rename camss-vfe-170 to camss-vfe-17x
Bryan O'Donoghue [Thu, 22 Feb 2024 17:17:04 +0000 (17:17 +0000)]
media: qcom: camss: vfe-17x: Rename camss-vfe-170 to camss-vfe-17x

vfe-170 and vfe-175 can be supported in the same file with some minimal
indirection to differentiate between the silicon versions.

sdm845 uses vfe-170, sc8280xp uses vfe-175-200. Lets rename the file to
capture its wider scope than vfe-170 only.

Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: qcom: camss: Add sc8280xp support
Bryan O'Donoghue [Thu, 22 Feb 2024 17:17:03 +0000 (17:17 +0000)]
media: qcom: camss: Add sc8280xp support

Add in functional logic throughout the code to support the sc8280xp.

Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>