<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/media/i2c/et8ek8, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>media: i2c: Add note to prevent buggy code re-use</title>
<updated>2026-01-16T13:08:52+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@oss.qualcomm.com</email>
</author>
<published>2025-12-30T08:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5152437f7610eb522fd233ab548a19d4601cbc2a'/>
<id>5152437f7610eb522fd233ab548a19d4601cbc2a</id>
<content type='text'>
adv7604 and et8ek8 sensor drivers have mixed up logical and line level
for reset/powerdown signal.  They call it a reset signal (it indeed
behaves like that), but drivers assert the reset to operate which is
clearly incorrect and relies on wrong ACTIVE_HIGH flag in the DTS.

People in discussions copy existing poor code and claim they can repeat
same mistake, so add a note to prevent that.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@oss.qualcomm.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
adv7604 and et8ek8 sensor drivers have mixed up logical and line level
for reset/powerdown signal.  They call it a reset signal (it indeed
behaves like that), but drivers assert the reset to operate which is
clearly incorrect and relies on wrong ACTIVE_HIGH flag in the DTS.

People in discussions copy existing poor code and claim they can repeat
same mistake, so add a note to prevent that.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@oss.qualcomm.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: i2c: et8ek8: Use V4L2 legacy sensor clock helper</title>
<updated>2025-09-09T13:59:19+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart@ideasonboard.com</email>
</author>
<published>2025-08-12T21:45:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fdee212433d2311d324f81d1af3ef3e02ade6c7a'/>
<id>fdee212433d2311d324f81d1af3ef3e02ade6c7a</id>
<content type='text'>
Several camera sensor drivers access the "clock-frequency" property
directly to retrieve the external clock rate, or modify the clock rate
of the external clock programmatically. Both behaviours are valid on a
subset of ACPI platforms, but are considered deprecated on OF platforms,
and do not support ACPI platforms that implement MIPI DisCo for Imaging.
Implementing them manually in drivers is deprecated, as that can
encourage copying deprecated behaviour for OF platforms in new drivers,
and lead to differences in behaviour between drivers. Instead, drivers
that need to preserve the deprecated OF behaviour should use the
devm_v4l2_sensor_clk_get_legacy() helper.

This driver supports OF platforms only. The "clocks" and
"clock-frequency" properties were initially mandatory in the DT bindings
and were both set in the upstream DT sources. The driver retrieves the
clock, retrieves and ignores the clock rate from the clock-frequency
property, and sets the clock rate to a fixed value. This is deprecated
behaviour for OF.

Switch to using the devm_v4l2_sensor_clk_get_legacy() helper. This
preserves setting the clock rate on OF platforms. Should support for OF
platforms that set the clock rate through clock-frequency be considered
unneeded in the future, the driver will only need to switch to
devm_v4l2_sensor_clk_get() without any other change.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Mehdi Djait &lt;mehdi.djait@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Several camera sensor drivers access the "clock-frequency" property
directly to retrieve the external clock rate, or modify the clock rate
of the external clock programmatically. Both behaviours are valid on a
subset of ACPI platforms, but are considered deprecated on OF platforms,
and do not support ACPI platforms that implement MIPI DisCo for Imaging.
Implementing them manually in drivers is deprecated, as that can
encourage copying deprecated behaviour for OF platforms in new drivers,
and lead to differences in behaviour between drivers. Instead, drivers
that need to preserve the deprecated OF behaviour should use the
devm_v4l2_sensor_clk_get_legacy() helper.

This driver supports OF platforms only. The "clocks" and
"clock-frequency" properties were initially mandatory in the DT bindings
and were both set in the upstream DT sources. The driver retrieves the
clock, retrieves and ignores the clock rate from the clock-frequency
property, and sets the clock rate to a fixed value. This is deprecated
behaviour for OF.

Switch to using the devm_v4l2_sensor_clk_get_legacy() helper. This
preserves setting the clock rate on OF platforms. Should support for OF
platforms that set the clock rate through clock-frequency be considered
unneeded in the future, the driver will only need to switch to
devm_v4l2_sensor_clk_get() without any other change.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Mehdi Djait &lt;mehdi.djait@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: i2c: et8ek8: Drop support for per-mode external clock frequency</title>
<updated>2025-09-09T13:59:19+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart@ideasonboard.com</email>
</author>
<published>2025-08-12T21:45:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf7ea1d6e563d9a250ccccba26e4189ab1e6b6c4'/>
<id>cf7ea1d6e563d9a250ccccba26e4189ab1e6b6c4</id>
<content type='text'>
The et8ek8 driver supports programming different external clock
frequencies for different modes, but in practice all modes use a 9.6MHz
external clock. Drop support for this feature and use a hardcoded
frequency, in preparation for further refactoring of external clock
handling.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Mehdi Djait &lt;mehdi.djait@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The et8ek8 driver supports programming different external clock
frequencies for different modes, but in practice all modes use a 9.6MHz
external clock. Drop support for this feature and use a hardcoded
frequency, in preparation for further refactoring of external clock
handling.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Mehdi Djait &lt;mehdi.djait@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: i2c: et8ek8: Use the v4l2 helper for obtaining the clock</title>
<updated>2025-08-13T13:10:19+00:00</updated>
<author>
<name>Mehdi Djait</name>
<email>mehdi.djait@linux.intel.com</email>
</author>
<published>2025-06-26T13:33:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2e47c27270e9b6deae90808930d3f71c9b270441'/>
<id>2e47c27270e9b6deae90808930d3f71c9b270441</id>
<content type='text'>
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.

Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.

Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mehdi Djait &lt;mehdi.djait@linux.intel.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.

Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.

Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mehdi Djait &lt;mehdi.djait@linux.intel.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil+cisco@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: Drop explicit initialization of struct i2c_device_id::driver_data to 0</title>
<updated>2024-08-09T05:56:37+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2024-05-08T13:20:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cc4cbd4b4f97a968203530ef73598ad2eaf70dee'/>
<id>cc4cbd4b4f97a968203530ef73598ad2eaf70dee</id>
<content type='text'>
These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

While add it, also remove commas after the sentinel entries.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

While add it, also remove commas after the sentinel entries.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: i2c: et8ek8: Don't strip remove function when driver is builtin</title>
<updated>2024-04-10T13:15:31+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2024-03-24T16:00:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=545b215736c5c4b354e182d99c578a472ac9bfce'/>
<id>545b215736c5c4b354e182d99c578a472ac9bfce</id>
<content type='text'>
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) -&gt; et8ek8_remove (section: .exit.text)

Fixes: c5254e72b8ed ("[media] media: Driver for Toshiba et8ek8 5MP sensor")
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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) -&gt; et8ek8_remove (section: .exit.text)

Fixes: c5254e72b8ed ("[media] media: Driver for Toshiba et8ek8 5MP sensor")
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: v4l2-subdev: Add which field to struct v4l2_subdev_frame_interval</title>
<updated>2023-12-13T15:52:35+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart@ideasonboard.com</email>
</author>
<published>2023-12-13T15:00:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=805d4311a54a25d7347684fdf778c6239b190864'/>
<id>805d4311a54a25d7347684fdf778c6239b190864</id>
<content type='text'>
Due to a historical mishap, the v4l2_subdev_frame_interval structure
is the only part of the V4L2 subdev userspace API that doesn't contain a
'which' field. This prevents trying frame intervals using the subdev
'TRY' state mechanism.

Adding a 'which' field is simple as the structure has 8 reserved fields.
This would however break userspace as the field is currently set to 0,
corresponding to V4L2_SUBDEV_FORMAT_TRY, while the corresponding ioctls
currently operate on the 'ACTIVE' state. We thus need to add a new
subdev client cap, V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH, to
indicate that userspace is aware of this new field.

All drivers that implement the subdev .get_frame_interval() and
.set_frame_interval() operations are updated to return -EINVAL when
operating on the TRY state, preserving the current behaviour.

While at it, fix a bad copy&amp;paste in the documentation of the struct
v4l2_subdev_frame_interval_enum 'which' field.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt; # for imx-media
Reviewed-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Reviewed-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt; # for tegra-video
Reviewed-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Due to a historical mishap, the v4l2_subdev_frame_interval structure
is the only part of the V4L2 subdev userspace API that doesn't contain a
'which' field. This prevents trying frame intervals using the subdev
'TRY' state mechanism.

Adding a 'which' field is simple as the structure has 8 reserved fields.
This would however break userspace as the field is currently set to 0,
corresponding to V4L2_SUBDEV_FORMAT_TRY, while the corresponding ioctls
currently operate on the 'ACTIVE' state. We thus need to add a new
subdev client cap, V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH, to
indicate that userspace is aware of this new field.

All drivers that implement the subdev .get_frame_interval() and
.set_frame_interval() operations are updated to return -EINVAL when
operating on the TRY state, preserving the current behaviour.

While at it, fix a bad copy&amp;paste in the documentation of the struct
v4l2_subdev_frame_interval_enum 'which' field.

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt; # for imx-media
Reviewed-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Reviewed-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt; # for tegra-video
Reviewed-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: v4l2-subdev: Turn .[gs]_frame_interval into pad operations</title>
<updated>2023-12-13T15:52:35+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart@ideasonboard.com</email>
</author>
<published>2023-12-13T15:00:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=287fe160834acdf9c44e5b73676180c6dbdedf76'/>
<id>287fe160834acdf9c44e5b73676180c6dbdedf76</id>
<content type='text'>
The subdev .[gs]_frame_interval are video operations, but they operate
on pads (and even on streams). Not only is this confusing, it causes
practical issues for drivers as the operations don't receive a subdev
state pointer, requiring manual state handling.

To improve the situation, turn the operations into pad operations, and
extend them to receive a state pointer like other pad operations.

While at it, rename the operations to .[gs]et_frame_interval at the same
time to match the naming scheme of other pad operations. This isn't
strictly necessary, but given that all drivers using those operations
need to be modified, handling the rename separately would generate more
churn for very little gain (if at all).

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt; # for imx-media
Reviewed-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt; # for tegra-video
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The subdev .[gs]_frame_interval are video operations, but they operate
on pads (and even on streams). Not only is this confusing, it causes
practical issues for drivers as the operations don't receive a subdev
state pointer, requiring manual state handling.

To improve the situation, turn the operations into pad operations, and
extend them to receive a state pointer like other pad operations.

While at it, rename the operations to .[gs]et_frame_interval at the same
time to match the naming scheme of other pad operations. This isn't
strictly necessary, but given that all drivers using those operations
need to be modified, handling the rename separately would generate more
churn for very little gain (if at all).

Signed-off-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Reviewed-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Reviewed-by: Philipp Zabel &lt;p.zabel@pengutronix.de&gt; # for imx-media
Reviewed-by: Luca Ceresoli &lt;luca.ceresoli@bootlin.com&gt; # for tegra-video
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: v4l: subdev: Switch to stream-aware state functions</title>
<updated>2023-11-23T17:57:47+00:00</updated>
<author>
<name>Sakari Ailus</name>
<email>sakari.ailus@linux.intel.com</email>
</author>
<published>2023-10-13T07:37:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bc0e8d91feec72b19199298dca470c5816a52105'/>
<id>bc0e8d91feec72b19199298dca470c5816a52105</id>
<content type='text'>
Switch all drivers accessing sub-device state to use the stream-aware
functions. We will soon remove the old ones.

This patch has been generated using the following Coccinelle script:

---------8&lt;------------
@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_pad_format(E1, E2, E3)
+ v4l2_subdev_state_get_format(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_pad_crop(E1, E2, E3)
+ v4l2_subdev_state_get_crop(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_pad_compose(E1, E2, E3)
+ v4l2_subdev_state_get_compose(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_try_format(E1, E2, E3)
+ v4l2_subdev_state_get_format(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_try_crop(E1, E2, E3)
+ v4l2_subdev_state_get_crop(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_try_compose(E1, E2, E3)
+ v4l2_subdev_state_get_compose(E2, E3)
---------8&lt;------------

Additionally drivers/media/i2c/s5k5baf.c and
drivers/media/platform/samsung/s3c-camif/camif-capture.c have been
manually changed as Coccinelle didn't. Further local variables have been
removed as they became unused as a result of the other changes.

Also Coccinelle introduced indentation by space in files
drivers/media/i2c/st-mipid02.c and
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c. This has been also
corrected.

The diff from Coccinelle-generated changes are:

&gt; diff --git b/drivers/media/i2c/imx319.c a/drivers/media/i2c/imx319.c
&gt; index e549692ff478..420984382173 100644
&gt; --- b/drivers/media/i2c/imx319.c
&gt; +++ a/drivers/media/i2c/imx319.c
&gt; @@ -2001,7 +2001,6 @@ static int imx319_do_get_pad_format(struct imx319 *imx319,
&gt;  				    struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;imx319-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/imx355.c a/drivers/media/i2c/imx355.c
&gt; index 96bdde685d65..e1b1d2fc79dd 100644
&gt; --- b/drivers/media/i2c/imx355.c
&gt; +++ a/drivers/media/i2c/imx355.c
&gt; @@ -1299,7 +1299,6 @@ static int imx355_do_get_pad_format(struct imx355 *imx355,
&gt;  				    struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;imx355-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/ov08x40.c a/drivers/media/i2c/ov08x40.c
&gt; index ca799bbcfdb7..abbb0b774d43 100644
&gt; --- b/drivers/media/i2c/ov08x40.c
&gt; +++ a/drivers/media/i2c/ov08x40.c
&gt; @@ -2774,7 +2774,6 @@ static int ov08x40_do_get_pad_format(struct ov08x40 *ov08x,
&gt;  				     struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;ov08x-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/ov13858.c a/drivers/media/i2c/ov13858.c
&gt; index 7816d9787c61..09387e335d80 100644
&gt; --- b/drivers/media/i2c/ov13858.c
&gt; +++ a/drivers/media/i2c/ov13858.c
&gt; @@ -1316,7 +1316,6 @@ static int ov13858_do_get_pad_format(struct ov13858 *ov13858,
&gt;  				     struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;ov13858-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/ov13b10.c a/drivers/media/i2c/ov13b10.c
&gt; index 268cd4b03f9c..c06411d5ee2b 100644
&gt; --- b/drivers/media/i2c/ov13b10.c
&gt; +++ a/drivers/media/i2c/ov13b10.c
&gt; @@ -1001,7 +1001,6 @@ static int ov13b10_do_get_pad_format(struct ov13b10 *ov13b,
&gt;  				     struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;ov13b-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/s5c73m3/s5c73m3-core.c a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
&gt; index 47605e36bc60..8f9b5713daf7 100644
&gt; --- b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
&gt; +++ a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
&gt; @@ -819,7 +819,6 @@ static void s5c73m3_oif_try_format(struct s5c73m3 *state,
&gt;  				   struct v4l2_subdev_format *fmt,
&gt;  				   const struct s5c73m3_frame_size **fs)
&gt;  {
&gt; -	struct v4l2_subdev *sd = &amp;state-&gt;sensor_sd;
&gt;  	u32 code;
&gt;
&gt;  	switch (fmt-&gt;pad) {
&gt; diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
&gt; index 67da2045f543..03ccfb0e1e11 100644
&gt; --- a/drivers/media/i2c/s5k5baf.c
&gt; +++ b/drivers/media/i2c/s5k5baf.c
&gt; @@ -1472,14 +1472,11 @@ static int s5k5baf_set_selection(struct v4l2_subdev *sd,
&gt;
&gt;  	if (sel-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		rects = (struct v4l2_rect * []) {
&gt; -				&amp;s5k5baf_cis_rect,
&gt; -				v4l2_subdev_get_try_crop(sd, sd_state,
&gt; -							 PAD_CIS),
&gt; -				v4l2_subdev_get_try_compose(sd, sd_state,
&gt; -							    PAD_CIS),
&gt; -				v4l2_subdev_get_try_crop(sd, sd_state,
&gt; -							 PAD_OUT)
&gt; -			};
&gt; +			&amp;s5k5baf_cis_rect,
&gt; +			v4l2_subdev_state_get_crop(sd_state, PAD_CIS),
&gt; +			v4l2_subdev_state_get_compose(sd_state, PAD_CIS),
&gt; +			v4l2_subdev_state_get_crop(sd_state, PAD_OUT)
&gt; +		};
&gt;  		s5k5baf_set_rect_and_adjust(rects, rtype, &amp;sel-&gt;r);
&gt;  		return 0;
&gt;  	}
&gt; diff --git b/drivers/media/platform/samsung/s3c-camif/camif-capture.c a/drivers/media/platform/samsung/s3c-camif/camif-capture.c
&gt; index 295e083f38e8..be58260ea67e 100644
&gt; --- b/drivers/media/platform/samsung/s3c-camif/camif-capture.c
&gt; +++ a/drivers/media/platform/samsung/s3c-camif/camif-capture.c
&gt; @@ -1216,7 +1216,7 @@ static int s3c_camif_subdev_get_fmt(struct v4l2_subdev *sd,
&gt;  	struct v4l2_mbus_framefmt *mf = &amp;fmt-&gt;format;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt; -		mf = v4l2_subdev_get_try_format(sd, sd_state, fmt-&gt;pad);
&gt; +		mf = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt;  		fmt-&gt;format = *mf;
&gt;  		return 0;
&gt;  	}
&gt; @@ -1305,7 +1305,7 @@ static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd,
&gt;  	__camif_subdev_try_format(camif, mf, fmt-&gt;pad);
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt; -		mf = v4l2_subdev_get_try_format(sd, sd_state, fmt-&gt;pad);
&gt; +		mf = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt;  		*mf = fmt-&gt;format;
&gt;  		mutex_unlock(&amp;camif-&gt;lock);
&gt;  		return 0;
&gt; diff --git b/drivers/media/platform/ti/cal/cal-camerarx.c a/drivers/media/platform/ti/cal/cal-camerarx.c
&gt; index cea454ed9c20..61433744c6c4 100644
&gt; --- b/drivers/media/platform/ti/cal/cal-camerarx.c
&gt; +++ a/drivers/media/platform/ti/cal/cal-camerarx.c
&gt; @@ -621,8 +621,6 @@ static int cal_camerarx_sd_enum_mbus_code(struct v4l2_subdev *sd,
&gt;  					  struct v4l2_subdev_state *state,
&gt;  					  struct v4l2_subdev_mbus_code_enum *code)
&gt;  {
&gt; -	struct cal_camerarx *phy = to_cal_camerarx(sd);
&gt; -
&gt;  	/* No transcoding, source and sink codes must match. */
&gt;  	if (cal_rx_pad_is_source(code-&gt;pad)) {
&gt;  		struct v4l2_mbus_framefmt *fmt;
&gt; diff --git b/drivers/staging/media/imx/imx-ic-prp.c a/drivers/staging/media/imx/imx-ic-prp.c
&gt; index dd558fac6477..61d69f19657e 100644
&gt; --- b/drivers/staging/media/imx/imx-ic-prp.c
&gt; +++ a/drivers/staging/media/imx/imx-ic-prp.c
&gt; @@ -82,8 +82,6 @@ static struct v4l2_mbus_framefmt *
&gt;  __prp_get_fmt(struct prp_priv *priv, struct v4l2_subdev_state *sd_state,
&gt;  	      unsigned int pad, enum v4l2_subdev_format_whence which)
&gt;  {
&gt; -	struct imx_ic_priv *ic_priv = priv-&gt;ic_priv;
&gt; -
&gt;  	if (which == V4L2_SUBDEV_FORMAT_TRY)
&gt;  		return v4l2_subdev_state_get_format(sd_state, pad);
&gt;  	else
&gt; diff --git b/drivers/staging/media/imx/imx-ic-prpencvf.c a/drivers/staging/media/imx/imx-ic-prpencvf.c
&gt; index 02db7dbb884b..ec73c901079e 100644
&gt; --- b/drivers/staging/media/imx/imx-ic-prpencvf.c
&gt; +++ a/drivers/staging/media/imx/imx-ic-prpencvf.c
&gt; @@ -790,8 +790,6 @@ static struct v4l2_mbus_framefmt *
&gt;  __prp_get_fmt(struct prp_priv *priv, struct v4l2_subdev_state *sd_state,
&gt;  	      unsigned int pad, enum v4l2_subdev_format_whence which)
&gt;  {
&gt; -	struct imx_ic_priv *ic_priv = priv-&gt;ic_priv;
&gt; -
&gt;  	if (which == V4L2_SUBDEV_FORMAT_TRY)
&gt;  		return v4l2_subdev_state_get_format(sd_state, pad);
&gt;  	else
&gt; diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
&gt; index 9c9361354c00..b08a249b5fdd 100644
&gt; --- a/drivers/media/i2c/st-mipid02.c
&gt; +++ b/drivers/media/i2c/st-mipid02.c
&gt; @@ -751,7 +751,7 @@ static void mipid02_set_fmt_source(struct v4l2_subdev *sd,
&gt;  		format-&gt;format = bridge-&gt;fmt;
&gt;  	else
&gt;  		format-&gt;format = *v4l2_subdev_state_get_format(sd_state,
&gt; -						               MIPID02_SINK_0);
&gt; +							       MIPID02_SINK_0);
&gt;
&gt;  	/* but code may need to be converted */
&gt;  	format-&gt;format.code = serial_to_parallel_code(format-&gt;format.code);
&gt; diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
&gt; index 117912d3bfbd..96353648c032 100644
&gt; --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
&gt; +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
&gt; @@ -319,7 +319,7 @@ static void rkisp1_isp_start(struct rkisp1_isp *isp,
&gt;  	rkisp1_write(rkisp1, RKISP1_CIF_ISP_CTRL, val);
&gt;
&gt;  	src_fmt = v4l2_subdev_state_get_format(sd_state,
&gt; -				               RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt; +					       RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt;  	src_info = rkisp1_mbus_info_get_by_code(src_fmt-&gt;code);
&gt;
&gt;  	if (src_info-&gt;pixel_enc != V4L2_PIXEL_ENC_BAYER)
&gt; @@ -475,9 +475,9 @@ static void rkisp1_isp_set_src_fmt(struct rkisp1_isp *isp,
&gt;  	sink_fmt = v4l2_subdev_state_get_format(sd_state,
&gt;  						RKISP1_ISP_PAD_SINK_VIDEO);
&gt;  	src_fmt = v4l2_subdev_state_get_format(sd_state,
&gt; -				               RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt; +					       RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt;  	src_crop = v4l2_subdev_state_get_crop(sd_state,
&gt; -				              RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt; +					      RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt;
&gt;  	/*
&gt;  	 * Media bus code. The ISP can operate in pass-through mode (Bayer in,

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Switch all drivers accessing sub-device state to use the stream-aware
functions. We will soon remove the old ones.

This patch has been generated using the following Coccinelle script:

---------8&lt;------------
@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_pad_format(E1, E2, E3)
+ v4l2_subdev_state_get_format(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_pad_crop(E1, E2, E3)
+ v4l2_subdev_state_get_crop(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_pad_compose(E1, E2, E3)
+ v4l2_subdev_state_get_compose(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_try_format(E1, E2, E3)
+ v4l2_subdev_state_get_format(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_try_crop(E1, E2, E3)
+ v4l2_subdev_state_get_crop(E2, E3)

@@
expression E1, E2, E3;

@@

- v4l2_subdev_get_try_compose(E1, E2, E3)
+ v4l2_subdev_state_get_compose(E2, E3)
---------8&lt;------------

Additionally drivers/media/i2c/s5k5baf.c and
drivers/media/platform/samsung/s3c-camif/camif-capture.c have been
manually changed as Coccinelle didn't. Further local variables have been
removed as they became unused as a result of the other changes.

Also Coccinelle introduced indentation by space in files
drivers/media/i2c/st-mipid02.c and
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c. This has been also
corrected.

The diff from Coccinelle-generated changes are:

&gt; diff --git b/drivers/media/i2c/imx319.c a/drivers/media/i2c/imx319.c
&gt; index e549692ff478..420984382173 100644
&gt; --- b/drivers/media/i2c/imx319.c
&gt; +++ a/drivers/media/i2c/imx319.c
&gt; @@ -2001,7 +2001,6 @@ static int imx319_do_get_pad_format(struct imx319 *imx319,
&gt;  				    struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;imx319-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/imx355.c a/drivers/media/i2c/imx355.c
&gt; index 96bdde685d65..e1b1d2fc79dd 100644
&gt; --- b/drivers/media/i2c/imx355.c
&gt; +++ a/drivers/media/i2c/imx355.c
&gt; @@ -1299,7 +1299,6 @@ static int imx355_do_get_pad_format(struct imx355 *imx355,
&gt;  				    struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;imx355-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/ov08x40.c a/drivers/media/i2c/ov08x40.c
&gt; index ca799bbcfdb7..abbb0b774d43 100644
&gt; --- b/drivers/media/i2c/ov08x40.c
&gt; +++ a/drivers/media/i2c/ov08x40.c
&gt; @@ -2774,7 +2774,6 @@ static int ov08x40_do_get_pad_format(struct ov08x40 *ov08x,
&gt;  				     struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;ov08x-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/ov13858.c a/drivers/media/i2c/ov13858.c
&gt; index 7816d9787c61..09387e335d80 100644
&gt; --- b/drivers/media/i2c/ov13858.c
&gt; +++ a/drivers/media/i2c/ov13858.c
&gt; @@ -1316,7 +1316,6 @@ static int ov13858_do_get_pad_format(struct ov13858 *ov13858,
&gt;  				     struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;ov13858-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/ov13b10.c a/drivers/media/i2c/ov13b10.c
&gt; index 268cd4b03f9c..c06411d5ee2b 100644
&gt; --- b/drivers/media/i2c/ov13b10.c
&gt; +++ a/drivers/media/i2c/ov13b10.c
&gt; @@ -1001,7 +1001,6 @@ static int ov13b10_do_get_pad_format(struct ov13b10 *ov13b,
&gt;  				     struct v4l2_subdev_format *fmt)
&gt;  {
&gt;  	struct v4l2_mbus_framefmt *framefmt;
&gt; -	struct v4l2_subdev *sd = &amp;ov13b-&gt;sd;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		framefmt = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt; diff --git b/drivers/media/i2c/s5c73m3/s5c73m3-core.c a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
&gt; index 47605e36bc60..8f9b5713daf7 100644
&gt; --- b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
&gt; +++ a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
&gt; @@ -819,7 +819,6 @@ static void s5c73m3_oif_try_format(struct s5c73m3 *state,
&gt;  				   struct v4l2_subdev_format *fmt,
&gt;  				   const struct s5c73m3_frame_size **fs)
&gt;  {
&gt; -	struct v4l2_subdev *sd = &amp;state-&gt;sensor_sd;
&gt;  	u32 code;
&gt;
&gt;  	switch (fmt-&gt;pad) {
&gt; diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
&gt; index 67da2045f543..03ccfb0e1e11 100644
&gt; --- a/drivers/media/i2c/s5k5baf.c
&gt; +++ b/drivers/media/i2c/s5k5baf.c
&gt; @@ -1472,14 +1472,11 @@ static int s5k5baf_set_selection(struct v4l2_subdev *sd,
&gt;
&gt;  	if (sel-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt;  		rects = (struct v4l2_rect * []) {
&gt; -				&amp;s5k5baf_cis_rect,
&gt; -				v4l2_subdev_get_try_crop(sd, sd_state,
&gt; -							 PAD_CIS),
&gt; -				v4l2_subdev_get_try_compose(sd, sd_state,
&gt; -							    PAD_CIS),
&gt; -				v4l2_subdev_get_try_crop(sd, sd_state,
&gt; -							 PAD_OUT)
&gt; -			};
&gt; +			&amp;s5k5baf_cis_rect,
&gt; +			v4l2_subdev_state_get_crop(sd_state, PAD_CIS),
&gt; +			v4l2_subdev_state_get_compose(sd_state, PAD_CIS),
&gt; +			v4l2_subdev_state_get_crop(sd_state, PAD_OUT)
&gt; +		};
&gt;  		s5k5baf_set_rect_and_adjust(rects, rtype, &amp;sel-&gt;r);
&gt;  		return 0;
&gt;  	}
&gt; diff --git b/drivers/media/platform/samsung/s3c-camif/camif-capture.c a/drivers/media/platform/samsung/s3c-camif/camif-capture.c
&gt; index 295e083f38e8..be58260ea67e 100644
&gt; --- b/drivers/media/platform/samsung/s3c-camif/camif-capture.c
&gt; +++ a/drivers/media/platform/samsung/s3c-camif/camif-capture.c
&gt; @@ -1216,7 +1216,7 @@ static int s3c_camif_subdev_get_fmt(struct v4l2_subdev *sd,
&gt;  	struct v4l2_mbus_framefmt *mf = &amp;fmt-&gt;format;
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt; -		mf = v4l2_subdev_get_try_format(sd, sd_state, fmt-&gt;pad);
&gt; +		mf = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt;  		fmt-&gt;format = *mf;
&gt;  		return 0;
&gt;  	}
&gt; @@ -1305,7 +1305,7 @@ static int s3c_camif_subdev_set_fmt(struct v4l2_subdev *sd,
&gt;  	__camif_subdev_try_format(camif, mf, fmt-&gt;pad);
&gt;
&gt;  	if (fmt-&gt;which == V4L2_SUBDEV_FORMAT_TRY) {
&gt; -		mf = v4l2_subdev_get_try_format(sd, sd_state, fmt-&gt;pad);
&gt; +		mf = v4l2_subdev_state_get_format(sd_state, fmt-&gt;pad);
&gt;  		*mf = fmt-&gt;format;
&gt;  		mutex_unlock(&amp;camif-&gt;lock);
&gt;  		return 0;
&gt; diff --git b/drivers/media/platform/ti/cal/cal-camerarx.c a/drivers/media/platform/ti/cal/cal-camerarx.c
&gt; index cea454ed9c20..61433744c6c4 100644
&gt; --- b/drivers/media/platform/ti/cal/cal-camerarx.c
&gt; +++ a/drivers/media/platform/ti/cal/cal-camerarx.c
&gt; @@ -621,8 +621,6 @@ static int cal_camerarx_sd_enum_mbus_code(struct v4l2_subdev *sd,
&gt;  					  struct v4l2_subdev_state *state,
&gt;  					  struct v4l2_subdev_mbus_code_enum *code)
&gt;  {
&gt; -	struct cal_camerarx *phy = to_cal_camerarx(sd);
&gt; -
&gt;  	/* No transcoding, source and sink codes must match. */
&gt;  	if (cal_rx_pad_is_source(code-&gt;pad)) {
&gt;  		struct v4l2_mbus_framefmt *fmt;
&gt; diff --git b/drivers/staging/media/imx/imx-ic-prp.c a/drivers/staging/media/imx/imx-ic-prp.c
&gt; index dd558fac6477..61d69f19657e 100644
&gt; --- b/drivers/staging/media/imx/imx-ic-prp.c
&gt; +++ a/drivers/staging/media/imx/imx-ic-prp.c
&gt; @@ -82,8 +82,6 @@ static struct v4l2_mbus_framefmt *
&gt;  __prp_get_fmt(struct prp_priv *priv, struct v4l2_subdev_state *sd_state,
&gt;  	      unsigned int pad, enum v4l2_subdev_format_whence which)
&gt;  {
&gt; -	struct imx_ic_priv *ic_priv = priv-&gt;ic_priv;
&gt; -
&gt;  	if (which == V4L2_SUBDEV_FORMAT_TRY)
&gt;  		return v4l2_subdev_state_get_format(sd_state, pad);
&gt;  	else
&gt; diff --git b/drivers/staging/media/imx/imx-ic-prpencvf.c a/drivers/staging/media/imx/imx-ic-prpencvf.c
&gt; index 02db7dbb884b..ec73c901079e 100644
&gt; --- b/drivers/staging/media/imx/imx-ic-prpencvf.c
&gt; +++ a/drivers/staging/media/imx/imx-ic-prpencvf.c
&gt; @@ -790,8 +790,6 @@ static struct v4l2_mbus_framefmt *
&gt;  __prp_get_fmt(struct prp_priv *priv, struct v4l2_subdev_state *sd_state,
&gt;  	      unsigned int pad, enum v4l2_subdev_format_whence which)
&gt;  {
&gt; -	struct imx_ic_priv *ic_priv = priv-&gt;ic_priv;
&gt; -
&gt;  	if (which == V4L2_SUBDEV_FORMAT_TRY)
&gt;  		return v4l2_subdev_state_get_format(sd_state, pad);
&gt;  	else
&gt; diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
&gt; index 9c9361354c00..b08a249b5fdd 100644
&gt; --- a/drivers/media/i2c/st-mipid02.c
&gt; +++ b/drivers/media/i2c/st-mipid02.c
&gt; @@ -751,7 +751,7 @@ static void mipid02_set_fmt_source(struct v4l2_subdev *sd,
&gt;  		format-&gt;format = bridge-&gt;fmt;
&gt;  	else
&gt;  		format-&gt;format = *v4l2_subdev_state_get_format(sd_state,
&gt; -						               MIPID02_SINK_0);
&gt; +							       MIPID02_SINK_0);
&gt;
&gt;  	/* but code may need to be converted */
&gt;  	format-&gt;format.code = serial_to_parallel_code(format-&gt;format.code);
&gt; diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
&gt; index 117912d3bfbd..96353648c032 100644
&gt; --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
&gt; +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
&gt; @@ -319,7 +319,7 @@ static void rkisp1_isp_start(struct rkisp1_isp *isp,
&gt;  	rkisp1_write(rkisp1, RKISP1_CIF_ISP_CTRL, val);
&gt;
&gt;  	src_fmt = v4l2_subdev_state_get_format(sd_state,
&gt; -				               RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt; +					       RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt;  	src_info = rkisp1_mbus_info_get_by_code(src_fmt-&gt;code);
&gt;
&gt;  	if (src_info-&gt;pixel_enc != V4L2_PIXEL_ENC_BAYER)
&gt; @@ -475,9 +475,9 @@ static void rkisp1_isp_set_src_fmt(struct rkisp1_isp *isp,
&gt;  	sink_fmt = v4l2_subdev_state_get_format(sd_state,
&gt;  						RKISP1_ISP_PAD_SINK_VIDEO);
&gt;  	src_fmt = v4l2_subdev_state_get_format(sd_state,
&gt; -				               RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt; +					       RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt;  	src_crop = v4l2_subdev_state_get_crop(sd_state,
&gt; -				              RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt; +					      RKISP1_ISP_PAD_SOURCE_VIDEO);
&gt;
&gt;  	/*
&gt;  	 * Media bus code. The ISP can operate in pass-through mode (Bayer in,

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>media: i2c: Remove common dependencies from sensor drivers</title>
<updated>2023-08-10T05:58:38+00:00</updated>
<author>
<name>Sakari Ailus</name>
<email>sakari.ailus@linux.intel.com</email>
</author>
<published>2023-06-30T13:58:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=11ec2c45b55493b8d06a27eb40c9ec5c572f332e'/>
<id>11ec2c45b55493b8d06a27eb40c9ec5c572f332e</id>
<content type='text'>
As selecting V4L2_FWNODE, MEDIA_CONTROLLER and VIDEO_V4L2_SUBDEV_API are
now selected by the top level menu, they can be dropped from the
individual drivers. Also dropped selecting V4L2_ASYNC for a single driver
as this is already implied by V4L2_FWNODE.

Similarly, the I2C dependency is now also in the top level menu, so remove
it, as well as VIDEO_DEV which isn't needed by camera sensor drivers.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As selecting V4L2_FWNODE, MEDIA_CONTROLLER and VIDEO_V4L2_SUBDEV_API are
now selected by the top level menu, they can be dropped from the
individual drivers. Also dropped selecting V4L2_ASYNC for a single driver
as this is already implied by V4L2_FWNODE.

Similarly, the I2C dependency is now also in the top level menu, so remove
it, as well as VIDEO_DEV which isn't needed by camera sensor drivers.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Reviewed-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
