platform/kernel/linux-starfive.git
12 months agomedia: anysee: fix null-ptr-deref in anysee_master_xfer
Zhang Shurong [Sat, 8 Jul 2023 16:02:20 +0000 (00:02 +0800)]
media: anysee: fix null-ptr-deref in anysee_master_xfer

In anysee_master_xfer, msg is controlled by user. When msg[i].buf
is null and msg[i].len is zero, former checks on msg[i].buf would be
passed. Malicious data finally reach anysee_master_xfer. If accessing
msg[i].buf[0] without sanity check, null ptr deref would happen.
We add check on msg[i].len to prevent crash.

Similar commit:
commit 0ed554fd769a
("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()")

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: add spaces around +]

12 months agomedia: af9005: Fix null-ptr-deref in af9005_i2c_xfer
Zhang Shurong [Sat, 8 Jul 2023 15:24:11 +0000 (23:24 +0800)]
media: af9005: Fix null-ptr-deref in af9005_i2c_xfer

In af9005_i2c_xfer, msg is controlled by user. When msg[i].buf
is null and msg[i].len is zero, former checks on msg[i].buf would be
passed. Malicious data finally reach af9005_i2c_xfer. If accessing
msg[i].buf[0] without sanity check, null ptr deref would happen.
We add check on msg[i].len to prevent crash.

Similar commit:
commit 0ed554fd769a
("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()")

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dw2102: Fix null-ptr-deref in dw2102_i2c_transfer()
Zhang Shurong [Sat, 8 Jul 2023 10:22:52 +0000 (18:22 +0800)]
media: dw2102: Fix null-ptr-deref in dw2102_i2c_transfer()

In dw2102_i2c_transfer, msg is controlled by user. When msg[i].buf
is null and msg[i].len is zero, former checks on msg[i].buf would be
passed. Malicious data finally reach dw2102_i2c_transfer. If accessing
msg[i].buf[0] without sanity check, null ptr deref would happen.
We add check on msg[i].len to prevent crash.

Similar commit:
commit 950e252cb469
("[media] dw2102: limit messages to buffer size")

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: sh_vou: Convert to devm_platform_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:59 +0000 (18:10 +0800)]
media: sh_vou: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: fimc-core: Convert to devm_platform_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:58 +0000 (18:10 +0800)]
media: fimc-core: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: platform: ti: Use devm_platform_get_and_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:57 +0000 (18:10 +0800)]
media: platform: ti: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: retained the line wrap]

12 months agomedia: stm32-dcmi: Use devm_platform_get_and_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:56 +0000 (18:10 +0800)]
media: stm32-dcmi: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: verisilicon: Convert to devm_platform_ioremap_resource() and devm_platform_ior...
Yangtao Li [Thu, 6 Jul 2023 10:10:55 +0000 (18:10 +0800)]
media: verisilicon: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname()

Use devm_platform_ioremap_resource() and
devm_platform_ioremap_resource_byname() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: microchip-sama7g5-isc: Convert to devm_platform_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:54 +0000 (18:10 +0800)]
media: microchip-sama7g5-isc: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: fimc-lite: Convert to devm_platform_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:53 +0000 (18:10 +0800)]
media: fimc-lite: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: microchip-sama5d2-isc: Convert to devm_platform_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:52 +0000 (18:10 +0800)]
media: microchip-sama5d2-isc: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: marvell: Use devm_platform_get_and_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:51 +0000 (18:10 +0800)]
media: marvell: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: pxa_camera: Use devm_platform_get_and_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:50 +0000 (18:10 +0800)]
media: pxa_camera: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: atmel-isi: Convert to devm_platform_ioremap_resource()
Yangtao Li [Thu, 6 Jul 2023 10:10:49 +0000 (18:10 +0800)]
media: atmel-isi: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb-usb-v2: af9035: Fix null-ptr-deref in af9035_i2c_master_xfer
Zhang Shurong [Wed, 5 Jul 2023 16:06:54 +0000 (00:06 +0800)]
media: dvb-usb-v2: af9035: Fix null-ptr-deref in af9035_i2c_master_xfer

In af9035_i2c_master_xfer, msg is controlled by user. When msg[i].buf
is null and msg[i].len is zero, former checks on msg[i].buf would be
passed. Malicious data finally reach af9035_i2c_master_xfer. If accessing
msg[i].buf[0] without sanity check, null ptr deref would happen.
We add check on msg[i].len to prevent crash.

Similar commit:
commit 0ed554fd769a
("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()")

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agodrivers: saa7164: remove duplicate assignments
Minjie Du [Wed, 5 Jul 2023 06:49:22 +0000 (14:49 +0800)]
drivers: saa7164: remove duplicate assignments

make second_timeout avoid double assignment.

Signed-off-by: Minjie Du <duminjie@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: wl128x: Fix spelling mistake "Transfered" -> "Transferred"
Colin Ian King [Fri, 30 Jun 2023 07:57:44 +0000 (08:57 +0100)]
media: wl128x: Fix spelling mistake "Transfered" -> "Transferred"

There is a spelling mistake in a fmdbg message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: split overly long line over two lines]

12 months agomedia: docs: qcom_camss: Update Code Aurora references
Jeffrey Hugo [Wed, 28 Jun 2023 19:04:33 +0000 (13:04 -0600)]
media: docs: qcom_camss: Update Code Aurora references

source.codeaurora.org is no longer accessible and so the reference links
in the documentation are not useful.  The content was mirrored over to
Code Linaro so lets update the references to point there instead.

Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: cx24120: Add retval check for cx24120_message_send()
Daniil Dulov [Fri, 2 Jun 2023 08:55:01 +0000 (01:55 -0700)]
media: cx24120: Add retval check for cx24120_message_send()

If cx24120_message_send() returns error, we should keep local struct
unchanged.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 5afc9a25be8d ("[media] Add support for TechniSat Skystar S2")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: mdp3: Fix resource leaks in of_find_device_by_node
Lu Hongfei [Tue, 30 May 2023 10:17:18 +0000 (18:17 +0800)]
media: mdp3: Fix resource leaks in of_find_device_by_node

Use put_device to release the object get through of_find_device_by_node,
avoiding resource leaks.

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dvb-usb: m920x: Fix a potential memory leak in m920x_i2c_xfer()
Christophe JAILLET [Mon, 29 May 2023 05:58:36 +0000 (07:58 +0200)]
media: dvb-usb: m920x: Fix a potential memory leak in m920x_i2c_xfer()

'read' is freed when it is known to be NULL, but not when a read error
occurs.

Revert the logic to avoid a small leak, should a m920x_read() call fail.

Fixes: a2ab06d7c4d6 ("media: m920x: don't use stack on USB reads")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: tc358743: Add error code to error message
Alexander Stein [Tue, 25 Apr 2023 07:33:46 +0000 (09:33 +0200)]
media: tc358743: Add error code to error message

Add the error code of a failed i2c transfer to the error message.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: dib7000p: Fix potential division by zero
Daniil Dulov [Fri, 24 Mar 2023 13:38:32 +0000 (06:38 -0700)]
media: dib7000p: Fix potential division by zero

Variable loopdiv can be assigned 0, then it is used as a denominator,
without checking it for 0.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 713d54a8bd81 ("[media] DiB7090: add support for the dib7090 based")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: (bw != NULL) -> bw]

12 months agomedia: cx18: remove unnecessary (void*) conversions
Yu Zhe [Mon, 20 Mar 2023 08:45:02 +0000 (16:45 +0800)]
media: cx18: remove unnecessary (void*) conversions

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttpci: remove unnecessary (void*) conversions
Yu Zhe [Mon, 20 Mar 2023 08:16:51 +0000 (16:16 +0800)]
media: ttpci: remove unnecessary (void*) conversions

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: ttusb-dec: remove unnecessary (void*) conversions
Yu Zhe [Mon, 20 Mar 2023 06:52:22 +0000 (14:52 +0800)]
media: ttusb-dec: remove unnecessary (void*) conversions

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agodrivers: usb: smsusb: fix error handling code in smsusb_init_device
Dongliang Mu [Mon, 27 Feb 2023 10:24:08 +0000 (18:24 +0800)]
drivers: usb: smsusb: fix error handling code in smsusb_init_device

The previous commit 4b208f8b561f ("[media] siano: register media controller
earlier")moves siano_media_device_register before smscore_register_device,
and adds corresponding error handling code if smscore_register_device
fails. However, it misses the following error handling code of
smsusb_init_device.

Fix this by moving error handling code at the end of smsusb_init_device
and adding a goto statement in the following error handling parts.

Fixes: 4b208f8b561f ("[media] siano: register media controller earlier")
Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agodrivers/media/common/siano/smsendian.c : eliminate unnecessary type conversions
Dong Chuanjian [Mon, 26 Dec 2022 03:10:05 +0000 (11:10 +0800)]
drivers/media/common/siano/smsendian.c : eliminate unnecessary type conversions

remove unnecessary void* type casting.

Signed-off-by: Dong Chuanjian <chuanjian@nfschina.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: siano: Convert to use sysfs_emit_at() API
ye xingchen [Thu, 8 Dec 2022 03:40:06 +0000 (11:40 +0800)]
media: siano: Convert to use sysfs_emit_at() API

Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: pvrusb2: use sysfs_emit() to instead of scnprintf()
ye xingchen [Thu, 1 Dec 2022 11:27:59 +0000 (19:27 +0800)]
media: pvrusb2: use sysfs_emit() to instead of scnprintf()

Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Reviewed-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 months agomedia: v4l2-core: Fix a potential resource leak in v4l2_fwnode_parse_link()
Christophe JAILLET [Wed, 14 Jun 2023 18:31:05 +0000 (20:31 +0200)]
media: v4l2-core: Fix a potential resource leak in v4l2_fwnode_parse_link()

If fwnode_graph_get_remote_endpoint() fails, 'fwnode' is known to be NULL,
so fwnode_handle_put() is a no-op.

Release the reference taken from a previous fwnode_graph_get_port_parent()
call instead.

Also handle fwnode_graph_get_port_parent() failures.

In order to fix these issues, add an error handling path to the function
and the needed gotos.

Fixes: ca50c197bd96 ("[media] v4l: fwnode: Support generic fwnode for parsing standardised properties")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: add DS90UB953 driver
Tomi Valkeinen [Mon, 19 Jun 2023 12:22:12 +0000 (14:22 +0200)]
media: i2c: add DS90UB953 driver

Add driver for TI DS90UB953 FPD-Link III Serializer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: add DS90UB913 driver
Tomi Valkeinen [Mon, 19 Jun 2023 12:22:11 +0000 (14:22 +0200)]
media: i2c: add DS90UB913 driver

Add driver for TI DS90UB913 FPD-Link III Serializer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: add DS90UB960 driver
Tomi Valkeinen [Mon, 19 Jun 2023 12:22:10 +0000 (14:22 +0200)]
media: i2c: add DS90UB960 driver

Add driver for TI DS90UB960 FPD-Link III Deserializer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: dt-bindings: media: add TI DS90UB960 FPD-Link III Deserializer
Tomi Valkeinen [Mon, 19 Jun 2023 12:22:09 +0000 (14:22 +0200)]
media: dt-bindings: media: add TI DS90UB960 FPD-Link III Deserializer

Add DT bindings for TI DS90UB960 FPD-Link III Deserializer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: dt-bindings: media: add TI DS90UB953 FPD-Link III Serializer
Tomi Valkeinen [Mon, 19 Jun 2023 12:22:08 +0000 (14:22 +0200)]
media: dt-bindings: media: add TI DS90UB953 FPD-Link III Serializer

Add DT bindings for TI DS90UB953 FPD-Link III Serializer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: dt-bindings: media: add TI DS90UB913 FPD-Link III Serializer
Tomi Valkeinen [Mon, 19 Jun 2023 12:22:07 +0000 (14:22 +0200)]
media: dt-bindings: media: add TI DS90UB913 FPD-Link III Serializer

Add DT bindings for TI DS90UB913 FPD-Link III Serializer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: add I2C Address Translator (ATR) support
Luca Ceresoli [Mon, 19 Jun 2023 12:22:06 +0000 (14:22 +0200)]
media: i2c: add I2C Address Translator (ATR) support

An ATR is a device that looks similar to an i2c-mux: it has an I2C
slave "upstream" port and N master "downstream" ports, and forwards
transactions from upstream to the appropriate downstream port. But it
is different in that the forwarded transaction has a different slave
address. The address used on the upstream bus is called the "alias"
and is (potentially) different from the physical slave address of the
downstream chip.

Add a helper file (just like i2c-mux.c for a mux or switch) to allow
implementing ATR features in a device driver. The helper takes care of
adapter creation/destruction and translates addresses at each transaction.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: dt-bindings: i2c: Add I2C Address Translator (ATR)
Tomi Valkeinen [Mon, 19 Jun 2023 12:22:05 +0000 (14:22 +0200)]
media: dt-bindings: i2c: Add I2C Address Translator (ATR)

Add bindings for I2C Address Translator. Only one property is added,
'i2c-alias-pool', which can be used in the bindings for the device that
supports ATR.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Acked-by: Wolfram Sang <wsa@kernel.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: tvp5150: check return value of devm_kasprintf()
Claudiu Beznea [Thu, 15 Jun 2023 10:30:30 +0000 (12:30 +0200)]
media: i2c: tvp5150: check return value of devm_kasprintf()

devm_kasprintf() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).

Fixes: 0556f1d580d4 ("media: tvp5150: add input source selection of_graph support")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ov13b10: add PM control support based on power resources
Bingbu Cao [Thu, 15 Jun 2023 05:54:16 +0000 (07:54 +0200)]
media: ov13b10: add PM control support based on power resources

On ACPI based platforms, the ov13b10 camera sensor need to be powered
up by acquire the PM resource from INT3472. INT3472 will register one
regulator 'avdd', one reset gpio and clock source for ov13b10.
Add 2 power interfaces that are registered as runtime PM callbacks.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Hao Yao <hao.yao@intel.com>
Suggested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ad5820: Drop unsupported ad5823 from i2c_ and of_device_id tables
Hans de Goede [Sun, 18 Jun 2023 18:17:40 +0000 (20:17 +0200)]
media: ad5820: Drop unsupported ad5823 from i2c_ and of_device_id tables

The supported ad5820 and ad5821 VCMs both use a single 16 bit register
which is written by sending 2 bytes with the data directly after sending
the i2c-client address.

The ad5823 OTOH has a more typical i2c / smbus device setup with multiple
8 bit registers where the first byte send after the i2c-client address is
the register address and the actual data only starts from the second byte
after the i2c-client address.

The ad5823 i2c_ and of_device_id-s was added at the same time as
the ad5821 ids with as rationale:

"""
Some camera modules also refer that AD5823 is a replacement of AD5820:
https://download.kamami.com/p564094-OV8865_DS.pdf
"""

The AD5823 may be an electrical and functional replacement of the AD5820,
but from a software pov it is not compatible at all and it is going to
need its own driver, drop its id from the ad5820 driver.

Fixes: b8bf73136bae ("media: ad5820: Add support for ad5821 and ad5823")
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ricardo Ribalda Delgado <ribalda@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: imx290: drop format param from imx290_ctrl_update
Tommaso Merciai [Tue, 13 Jun 2023 08:07:34 +0000 (10:07 +0200)]
media: i2c: imx290: drop format param from imx290_ctrl_update

The format param actually is not used in imx290_ctrl_update
function, let's drop this

Fixes: bc35f9a21a55 ("media: i2c: imx290: Fix the pixel rate at 148.5Mpix/s")
Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ov13b10: support new ACPI HID 'OVTI13B1'
Bingbu Cao [Fri, 26 May 2023 10:07:23 +0000 (12:07 +0200)]
media: ov13b10: support new ACPI HID 'OVTI13B1'

On ACPI systems, the HID of ov13b10 is 'OVTI13B1', add this new
HID in acpi IDs table to make driver support it.

Signed-off-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: MAINTAINERS: Orphan the OV7740 driver
Nicolas Ferre [Mon, 22 May 2023 13:47:51 +0000 (15:47 +0200)]
media: MAINTAINERS: Orphan the OV7740 driver

Wenyou's email is bouncing, remove him from this camera driver's entry
and mark it as orphan.

Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ov13b10: Defer probe if no endpoint found
Bingbu Cao [Tue, 13 Jun 2023 04:55:43 +0000 (06:55 +0200)]
media: ov13b10: Defer probe if no endpoint found

The ov13b10 need be connected to a CIO2 or IPU device by bridge, sometimes
the bridge driver was not probed before ov13b10 driver, then the absence
of the fwnode endpoint for this device is expected, so driver return
-EPROBE_DEFER in this case to let the probe occur after bridge driver.

Signed-off-by: Hao Yao <hao.yao@intel.com>
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ov5640: fix low resolution image abnormal issue
Guoniu.zhou [Mon, 12 Jun 2023 02:43:40 +0000 (04:43 +0200)]
media: ov5640: fix low resolution image abnormal issue

OV5640 will output abnormal image data when work at low resolution
(320x240, 176x144 and 160x120) after switching from high resolution,
such as 1080P, the time interval between high and low switching must
be less than 1000ms in order to OV5640 don't enter suspend state during
the time.

The reason is by 0x3824 value don't restore to initialize value when
do resolution switching. In high resolution setting array, 0x3824 is
set to 0x04, but low resolution setting array remove 0x3824 in commit
db15c1957a2d ("media: ov5640: Remove duplicated mode settings"). So
when do resolution switching from high to low, such as 1080P to 320x240,
and the time interval is less than auto suspend delay time which means
global initialize setting array will not be loaded, the output image
data are abnormal. Hence move 0x3824 from ov5640_init_setting[] table
to ov5640_setting_low_res[] table and also move 0x4407 0x460b, 0x460c
to avoid same issue.

Fixes: db15c1957a2d ("media: ov5640: Remove duplicated mode settings")
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ov08x40: Fix hblank out of range issue
Jason Chen [Mon, 29 May 2023 11:10:41 +0000 (13:10 +0200)]
media: ov08x40: Fix hblank out of range issue

The HTS value cannot be directly compared to the sensor's output
size. It needs to be converted to an absolute time unit.
Additionally, the hblank value need to be modified as it was
previous invalid.

Signed-off-by: Jason Chen <jason.z.chen@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: Remove Shawn's and Chiranjeevi's e-mail addresses
Sakari Ailus [Fri, 9 Jun 2023 09:19:28 +0000 (11:19 +0200)]
media: i2c: Remove Shawn's and Chiranjeevi's e-mail addresses

Remove Shawn Tu's and Chiranjeevi Rapolu's e-mail addresses as they are no
longer function.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: MAINTAINERS: Pick ov5670 maintenance
Sakari Ailus [Thu, 8 Jun 2023 11:13:07 +0000 (13:13 +0200)]
media: MAINTAINERS: Pick ov5670 maintenance

Chiranjeevi's e-mail is bouncing:

   chiranjeevi.rapolu@intel.com
   DM3NAM02FT041.mail.protection.outlook.com
   Remote Server returned '550 5.4.1 Recipient address rejected: Access
   denied. AS(201806281)'

Assign the driver to myself.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: MAINTAINERS: Orphan dw9768 and ov02a10 drivers
Sakari Ailus [Thu, 8 Jun 2023 11:10:00 +0000 (13:10 +0200)]
media: MAINTAINERS: Orphan dw9768 and ov02a10 drivers

Dongchun's e-mail is no longer active and he hasn't given a new one:

The following message to <dongchun.zhu@mediatek.com> was
undeliverable.
The reason for the problem:
5.1.0 - Unknown address error 550-'Relaying mail to
dongchun.zhu@mediatek.com is not allowed'

Mark the drivers as orphaned.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: MAINTAINERS: Add an entry for V4L2 sensor and lens drivers
Sakari Ailus [Thu, 8 Jun 2023 09:35:22 +0000 (11:35 +0200)]
media: MAINTAINERS: Add an entry for V4L2 sensor and lens drivers

I maintain V4L2 sensor and lens drivers but there hasn't been a specific
MAINTAINERS entry for them. Add it now.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: MAINTAINERS: Assign Shawn Tu's sensor drivers to myself
Sakari Ailus [Thu, 8 Jun 2023 09:01:38 +0000 (11:01 +0200)]
media: MAINTAINERS: Assign Shawn Tu's sensor drivers to myself

Shawn Tu's e-mail address is bouncing:

   shawnx.tu@intel.com
   Remote Server returned '550 5.1.10 RESOLVER.ADR.RecipientNotFound;
   Recipient not found by SMTP address lookup'

Assign the sensor drivers Shawn maintained to myself.

Reported-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ipu3-cio2: rename ipu3-cio2-main.c back to ipu3-cio2.c
Bingbu Cao [Thu, 18 May 2023 10:05:23 +0000 (12:05 +0200)]
media: ipu3-cio2: rename ipu3-cio2-main.c back to ipu3-cio2.c

cio2 bridge driver is moved out of ipu3, current ipu3 cio2 driver only has
1 source file, then we can rename the source file back to ipu3-cio2.c.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ipu-bridge: use IPU_MAX_PORTS for bridge instead of CIO2_NUM_PORTS
Bingbu Cao [Thu, 18 May 2023 10:05:22 +0000 (12:05 +0200)]
media: ipu-bridge: use IPU_MAX_PORTS for bridge instead of CIO2_NUM_PORTS

Before bridge driver use CIO2_NUM_PORTS as the maximum supported CSI2 port
number. Current bridge driver is moved out of ipu3, so define a new macro
in ipu bridge for all IPUs instead of including CIO2 definition.
This patch also removes the ipu3-cio2.h inclusion in ipu-bridge.h.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: ipu3-cio2: rename cio2 bridge to ipu bridge and move out of ipu3
Bingbu Cao [Thu, 18 May 2023 10:05:21 +0000 (12:05 +0200)]
media: ipu3-cio2: rename cio2 bridge to ipu bridge and move out of ipu3

cio2 bridge was involved along with IPU3. However, in fact all Intel IPUs
besides IPU3 CIO2 need this bridge driver. This patch move bridge driver
out of ipu3 directory and rename as ipu-bridge. Then it can be worked with
IPU3 and other Intel IPUs.

Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: cadence: Add support for JH7110 SoC
Jack Zhu [Tue, 23 May 2023 08:56:26 +0000 (10:56 +0200)]
media: cadence: Add support for JH7110 SoC

Add support for Starfive JH7110 SoC which has the cadence csi2 receiver.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: cadence: Add support for external dphy
Jack Zhu [Tue, 23 May 2023 08:56:25 +0000 (10:56 +0200)]
media: cadence: Add support for external dphy

Add support for external MIPI D-PHY.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: cadence: Add operation on reset
Jack Zhu [Tue, 23 May 2023 08:56:24 +0000 (10:56 +0200)]
media: cadence: Add operation on reset

Add operation on reset for Cadence MIPI-CSI2 RX Controller.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: dt-bindings: cadence-csi2rx: Add resets property
Jack Zhu [Tue, 23 May 2023 08:56:23 +0000 (10:56 +0200)]
media: dt-bindings: cadence-csi2rx: Add resets property

Add resets property for Cadence MIPI-CSI2 RX controller

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: dt-bindings: cadence-csi2rx: Convert to DT schema
Jack Zhu [Tue, 23 May 2023 08:56:22 +0000 (10:56 +0200)]
media: dt-bindings: cadence-csi2rx: Convert to DT schema

Convert DT bindings document for Cadence MIPI-CSI2 RX controller to
DT schema format.

For compatible, new compatibles should not be messed with conversion,
but the original binding did not specify any SoC-specific compatible
string, so add the StarFive compatible string.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jack Zhu <jack.zhu@starfivetech.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: max9286: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:17 +0000 (14:13 +0100)]
media: i2c: max9286: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/i2c/max9286.c:1707:34: error: ‘max9286_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: ov7740: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:15 +0000 (14:13 +0100)]
media: i2c: ov7740: drop of_match_ptr for ID table

The driver will match mostly by DT table (even thought there is regular
ID table) so there is little benefit in of_match_ptr (this also allows
ACPI matching via PRP0001, even though it might not be relevant here).
This also fixes !CONFIG_OF error:

  drivers/media/i2c/ov7740.c:1203:34: error: ‘ov7740_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: ov2680: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:14 +0000 (14:13 +0100)]
media: i2c: ov2680: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/i2c/ov2680.c:1149:34: error: ‘ov2680_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: ov2640: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:13 +0000 (14:13 +0100)]
media: i2c: ov2640: drop of_match_ptr for ID table

The driver will match mostly by DT table (even thought there is regular
ID table) so there is little benefit in of_match_ptr (this also allows
ACPI matching via PRP0001, even though it might not be relevant here).
This also fixes !CONFIG_OF error:

  drivers/media/i2c/ov2640.c:1290:34: error: ‘ov2640_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: mt9m111: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:12 +0000 (14:13 +0100)]
media: i2c: mt9m111: drop of_match_ptr for ID table

The driver will match mostly by DT table (even thought there is regular
ID table) so there is little benefit in of_match_ptr (this also allows
ACPI matching via PRP0001, even though it might not be relevant here).
This also fixes !CONFIG_OF error:

  drivers/media/i2c/mt9m111.c:1370:34: error: ‘mt9m111_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: i2c: isl7998x: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:11 +0000 (14:13 +0100)]
media: i2c: isl7998x: drop of_match_ptr for ID table

The driver will match mostly by DT table (even thought there is regular
ID table) so there is little benefit in of_match_ptr (this also allows
ACPI matching via PRP0001, even though it might not be relevant here).
This also fixes !CONFIG_OF error:

  drivers/media/i2c/isl7998x.c:1557:34: error: ‘isl7998x_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: mdp: mark OF related data as maybe unused
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:09 +0000 (14:13 +0100)]
media: platform: mdp: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  drivers/media/platform/mediatek/mdp/mtk_mdp_core.c:31:34: error: ‘mtk_mdp_comp_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: sun8i-a83t-mipi-csi2: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:08 +0000 (14:13 +0100)]
media: platform: sun8i-a83t-mipi-csi2: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c:818:34: error: ‘sun8i_a83t_mipi_csi2_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: sun6i-mipi-csi2: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:07 +0000 (14:13 +0100)]
media: platform: sun6i-mipi-csi2: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c:751:34: error: ‘sun6i_mipi_csi2_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: sun6i-csi: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:06 +0000 (14:13 +0100)]
media: platform: sun6i-csi: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c:401:34: error: ‘sun6i_csi_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: mdp3: mark OF related data as maybe unused
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:05 +0000 (14:13 +0100)]
media: platform: mdp3: mark OF related data as maybe unused

The driver can be compile tested with !CONFIG_OF making certain data
unused:

  drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:627:34: error: ‘mdp_sub_comp_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: mdp3: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:04 +0000 (14:13 +0100)]
media: platform: mdp3: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c:49:34: error: ‘mdp_of_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: marvell: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:03 +0000 (14:13 +0100)]
media: platform: marvell: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/marvell/mmp-driver.c:364:34: error: ‘mmpcam_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: verisilicon: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:02 +0000 (14:13 +0100)]
media: platform: verisilicon: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/verisilicon/hantro_drv.c:622:34: error: ‘of_hantro_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: ti: am437x: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:13:01 +0000 (14:13 +0100)]
media: platform: ti: am437x: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/ti/am437x/am437x-vpfe.c:2620:34: error: ‘vpfe_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: samsung: s5p-jpeg: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:59 +0000 (14:12 +0100)]
media: platform: samsung: s5p-jpeg: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c:3124:34: error: ‘samsung_jpeg_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: intel: pxa: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:58 +0000 (14:12 +0100)]
media: platform: intel: pxa: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/intel/pxa_camera.c:2449:34: error: ‘pxa_camera_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: platform: allegro-dvt: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:57 +0000 (14:12 +0100)]
media: platform: allegro-dvt: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/platform/allegro-dvt/allegro-core.c:3995:34: error: ‘allegro_dt_ids’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: rc: ir-rx51: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:56 +0000 (14:12 +0100)]
media: rc: ir-rx51: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/rc/ir-rx51.c:264:34: error: ‘ir_rx51_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Sean Young <sean@mess.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: rc: gpio-ir-tx: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:55 +0000 (14:12 +0100)]
media: rc: gpio-ir-tx: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/rc/gpio-ir-tx.c:24:34: error: ‘gpio_ir_tx_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Sean Young <sean@mess.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: rc: gpio-ir-recv: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:54 +0000 (14:12 +0100)]
media: rc: gpio-ir-recv: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/rc/gpio-ir-recv.c:197:34: error: ‘gpio_ir_recv_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Sean Young <sean@mess.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: cec: tegra: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:53 +0000 (14:12 +0100)]
media: cec: tegra: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).  This
also fixes !CONFIG_OF error:

  drivers/media/cec/platform/tegra/tegra_cec.c:457:34: error: ‘tegra_cec_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: cec: meson: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:52 +0000 (14:12 +0100)]
media: cec: meson: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).

  drivers/media/cec/platform/meson/ao-cec.c:711:34: error: ‘meson_ao_cec_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: cec: ch7322: drop of_match_ptr for ID table
Krzysztof Kozlowski [Sun, 12 Mar 2023 13:12:51 +0000 (14:12 +0100)]
media: cec: ch7322: drop of_match_ptr for ID table

The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might not be relevant here).

  drivers/media/cec/i2c/ch7322.c:583:34: error: ‘ch7322_of_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: rc: meson-ir: support MMIO regmaps to access registers
Zelong Dong [Thu, 1 Jun 2023 11:54:33 +0000 (13:54 +0200)]
media: rc: meson-ir: support MMIO regmaps to access registers

Supports MMIO regmaps to access controller registers in Meson IR driver.

Signed-off-by: Zelong Dong <zelong.dong@amlogic.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: rc: meson-ir: rename Meson IR Controller register macros
Zelong Dong [Thu, 1 Jun 2023 11:54:32 +0000 (13:54 +0200)]
media: rc: meson-ir: rename Meson IR Controller register macros

There are more registers to come in the next Meson IR Controller.
For defining clearly, rename register macros.

Signed-off-by: Zelong Dong <zelong.dong@amlogic.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: rc: meson-ir: sort Meson IR Controller register macros
Zelong Dong [Thu, 1 Jun 2023 11:54:31 +0000 (13:54 +0200)]
media: rc: meson-ir: sort Meson IR Controller register macros

There are more registers to come in the next Meson IR Controller.
For defining clearly, sort register macros and let address and bit
macros as a set.

Signed-off-by: Zelong Dong <zelong.dong@amlogic.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: verisilicon: change confusingly named relaxed register access
Arnd Bergmann [Fri, 16 Jun 2023 14:48:48 +0000 (16:48 +0200)]
media: verisilicon: change confusingly named relaxed register access

The register abstraction has wrappers around both the normal writel()
and its writel_relaxed() counterpart, but this has led to a lot of users
ending up with the relaxed version.

There is sometimes a need to intentionally pick the relaxed accessor for
performance critical functions, but I noticed that each hantro_reg_write()
call also contains a non-relaxed readl(), which is typically much more
expensive than a writel, so there is little benefit here but an added
risk of missing a serialization against DMA.

To make this behave like other interfaces, use the normal accessor by
default and only provide the relaxed version as an alternative for
performance critical code. hantro_postproc.c is the only place that
used both the relaxed and normal writel, but this does not seem
cricital either, so change it all to the normal ones.

[hverkuil: fix function prototype alignment]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: verisilicon: fix excessive stack usage
Arnd Bergmann [Fri, 16 Jun 2023 14:48:47 +0000 (16:48 +0200)]
media: verisilicon: fix excessive stack usage

In some configurations, gcc decides not to inline the register accessor
functions, which in turn leads to lots of temporary hantro_reg structures
on the stack that cannot be eliminated because they escape into an
uninlined function:

drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c:1022:1: warning: the frame size of 1112 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Mark all of these as __always_inline so the compiler is able to completely
eliminate the temporary structures instead, which brings the stack usage
back down to just the normal local variables.

Closes: https://lore.kernel.org/oe-kbuild-all/202306151506.goHEegOd-lkp@intel.com/
[hverkuil: fix function prototype alignment, wrap commit log]

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 727a400686a2 ("media: verisilicon: Add Rockchip AV1 decoder")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: mediatek: vcodec: fix cancel_work_sync fail with fluster test
Yunfei Dong [Mon, 12 Jun 2023 03:15:57 +0000 (05:15 +0200)]
media: mediatek: vcodec: fix cancel_work_sync fail with fluster test

Will cause below warning then reboot when exercising the decoder with
fluster on mt8192-asurada-spherion.

This deinit function is called on the v4l2 release callback, even though
the work might not have been initialized as that only happens if/when the
codec specific 'decode' callback is called (as a result of device_run m2m
callback).

CPU: 5 PID: 2338 Comm: gst-launch-1.0 Tainted: G        W          6.4.0-rc5-next-20230607+ #475
Hardware name: Google Spherion (rev0 - 3) (DT)
pstate: 00400009 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __flush_work.isra.0+0x23c/0x258
lr : __cancel_work_timer+0x14c/0x1c8
sp : ffff8000896e3b00
x29: ffff8000896e3b00 x28: ffff57c3d4079f80 x27: 0000000000000000
x26: ffff57c3d4079f80 x25: ffffb76395b59dc8 x24: 0000000000000001
x23: ffffb763928daab8 x22: ffff57c3d4079f80 x21: 0000000000000000
x20: ffffb763955f6778 x19: ffff57c3cf06f4a0 x18: 0000000000000000
x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000
x14: ffff57c3c03a1f80 x13: ffffa0616a2fc000 x12: 000000003464d91d
x11: 0000000000000000 x10: 0000000000001b10 x9 : ffffb763928de61c
x8 : ffff57c3d407baf0 x7 : 0000000000000000 x6 : ffff57c3d4079f80
x5 : ffff57c3d4079f80 x4 : 0000000000000000 x3 : 0000000000000000
x2 : ffff8000896e3bf0 x1 : 0000000000000011 x0 : 0000000000000000
Call trace:
 __flush_work.isra.0+0x23c/0x258
 __cancel_work_timer+0x14c/0x1c8
 cancel_work_sync+0x1c/0x30
 vdec_msg_queue_deinit+0xac/0xc8
 vdec_h264_slice_deinit+0x64/0xb8
 vdec_if_deinit+0x3c/0x68
 mtk_vcodec_dec_release+0x20/0x40
 fops_vcodec_release+0x50/0xd8
 v4l2_release+0x7c/0x100
 __fput+0x80/0x270
 ____fput+0x18/0x30
 task_work_run+0x78/0xe0
 do_notify_resume+0x29c/0x7f8
 el0_svc+0xa4/0xb8
 el0t_64_sync_handler+0xc0/0xc8
 el0t_64_sync+0x1a8/0x1b0
---[ end trace 0000000000000000 ]---

Fixes: 297160d411e3 ("media: mediatek: vcodec: move core context from device to each instance")
Reported-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: pci: cx23885: fix error handling for cx23885 ATSC boards
Nikolay Burykin [Tue, 10 Jan 2023 09:09:00 +0000 (10:09 +0100)]
media: pci: cx23885: fix error handling for cx23885 ATSC boards

After having been assigned to NULL value at cx23885-dvb.c:1202,
pointer '0' is dereferenced at cx23885-dvb.c:2469.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Nikolay Burykin <burikin@ivk.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: pulse8-cec: handle possible ping error
Dmitry Antipov [Tue, 6 Jun 2023 04:38:15 +0000 (06:38 +0200)]
media: pulse8-cec: handle possible ping error

Handle (and warn about) possible error waiting for MSGCODE_PING result.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: mtk_jpeg_core: avoid unused-variable warning
Arnd Bergmann [Thu, 1 Jun 2023 21:37:22 +0000 (23:37 +0200)]
media: mtk_jpeg_core: avoid unused-variable warning

The mtk8195_jpegenc_drvdata object was added outside of an #ifdef causing
a harmless build warning.

drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c:1879:32: error: 'mtk8195_jpegenc_drvdata' defined but not used [-Werror=unused-variable]
 1879 | static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
      |                                ^~~~~~~~~~~~~~~~~~~~~~~

A follow-up patch moved it inside of an #ifdef, which caused more
warnings, and a third patch ended up adding even more #ifdefs. These
were all bogus, since the actual problem here is the incorrect use
of of_ptr(). Since the driver (like any other modern platform driver)
only works in combination with CONFIG_OF, there is no point in hiding
the reference, so just remove that along with all the pointless #ifdef
checks in the driver.

This improves build coverage and avoids running into the same problem
again when another part of the driver gets changed that relies on
the #ifdef blocks to be completely matched.

Fixes: 934e8bccac95 ("mtk-jpegenc: support jpegenc multi-hardware")
Fixes: 4ae47770d57b ("media: mtk-jpegenc: Fix a compilation issue")
Fixes: da4ede4b7fd6 ("media: mtk-jpeg: move data/code inside CONFIG_OF blocks")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: imx-jpeg: Support to assign slot for encoder/decoder
Ming Qian [Tue, 30 May 2023 07:16:30 +0000 (09:16 +0200)]
media: imx-jpeg: Support to assign slot for encoder/decoder

imx jpeg encoder and decoder support 4 slots each,
aim to support some virtualization scenarios.

driver should only enable one slot one time.

but due to some hardware issue,
only slot 0 can be enabled in imx8q platform,
and they may be fixed in imx9 platform.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: amphion: Fix firmware path to match linux-firmware
Nicolas Dufresne [Thu, 25 May 2023 20:10:15 +0000 (22:10 +0200)]
media: amphion: Fix firmware path to match linux-firmware

The path did not match the one it was submitted into linux-firmware
which prevented generic distribution from having working CODEC.

Fixes: 9f599f351e86 ("media: amphion: add vpu core driver")
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: amphion: use dev_err_probe
Alexander Stein [Tue, 31 Jan 2023 10:32:44 +0000 (11:32 +0100)]
media: amphion: use dev_err_probe

This simplifies the code and silences -517 error messages. Also
the reason is listed in /sys/kernel/debug/devices_deferred.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: staging: atomisp: select V4L2_FWNODE
Sakari Ailus [Tue, 13 Jun 2023 16:47:53 +0000 (18:47 +0200)]
media: staging: atomisp: select V4L2_FWNODE

Select V4L2_FWNODE as the driver depends on it.

Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: aa31f6514047 ("media: atomisp: allow building the driver again")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agomedia: tc358746: Address compiler warnings
Sakari Ailus [Tue, 30 May 2023 10:16:39 +0000 (12:16 +0200)]
media: tc358746: Address compiler warnings

Address these compiler warnings by initialising the m_best and p_best
values to 0 and 1 respectively (as latter is used as a divisor):

   drivers/media/i2c/tc358746.c: In function 'tc358746_find_pll_settings':
>> drivers/media/i2c/tc358746.c:817:13: warning: 'p_best' is used uninitialized
[-Wuninitialized]
     817 |         u16 p_best, p;
         |             ^~~~~~
>> drivers/media/i2c/tc358746.c:816:13: warning: 'm_best' is used uninitialized
[-Wuninitialized]
     816 |         u16 m_best, mul;
         |             ^~~~~~

The warnings may well be a false positive but it is difficult for a
compiler to find out whether that truly is the case.

Closes: https://lore.kernel.org/oe-kbuild-all/202305301627.fLT3Bkds-lkp@intel.com/

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 80a21da3605 ("media: tc358746: add Toshiba TC358746 Parallel to CSI-2 bridge driver")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
12 months agoLinux 6.5-rc1
Linus Torvalds [Sun, 9 Jul 2023 20:53:13 +0000 (13:53 -0700)]
Linux 6.5-rc1