From: Dave Stevenson <dave.stevenson@raspberrypi.com>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: andersson@kernel.org, konradybcio@kernel.org,
sakari.ailus@linux.intel.com, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-media@vger.kernel.org,
mchehab@kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 1/3] media: i2c: ov9282: Fix reset-gpio logical state
Date: Mon, 29 Sep 2025 16:18:26 +0100 [thread overview]
Message-ID: <CAPY8ntC-Or2ErudHmP0mQMY6Rb8yQ53wkB5fW3b+4DTeeytbdA@mail.gmail.com> (raw)
In-Reply-To: <20250926073421.17408-2-loic.poulain@oss.qualcomm.com>
Hi
On Fri, 26 Sept 2025 at 08:34, Loic Poulain
<loic.poulain@oss.qualcomm.com> wrote:
>
> Ensure reset state is low in the power-on state and high in the
> power-off state (assert reset). Note that the polarity is abstracted
> by the GPIO subsystem, so the logic level reflects the intended reset
> behavior.
>
> This breaks backward compatibility for any downstream dts using the
> wrong polarity.
Ouch. That'll be a nasty surprise to some if this lands, and
particularly with a Fixes: tag so it gets backported to stable
kernels.
There are a number of sensor drivers that have been in the tree for
multiple years that do indeed have the reset logic inverted as it
wasn't something being routinely picked up in code review. ov9282,
imx219, imx334, and imx274 for a start. Krzysztof sent [1] recently to
flag that they are wrong and shouldn't be copied, but changing the
behaviour feels unfriendly.
I'll defer to Sakari as to whether this change is acceptable.
Checking all my use cases, they use regulators instead of reset-gpio,
so it doesn't actually have an impact.
Dave
[1] https://lore.kernel.org/linux-media/20250818150025.247209-2-krzysztof.kozlowski@linaro.org/
> Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
> ---
> drivers/media/i2c/ov9282.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
> index c882a021cf18..fb6fcba503c8 100644
> --- a/drivers/media/i2c/ov9282.c
> +++ b/drivers/media/i2c/ov9282.c
> @@ -1127,7 +1127,7 @@ static int ov9282_parse_hw_config(struct ov9282 *ov9282)
>
> /* Request optional reset pin */
> ov9282->reset_gpio = devm_gpiod_get_optional(ov9282->dev, "reset",
> - GPIOD_OUT_LOW);
> + GPIOD_OUT_HIGH);
> if (IS_ERR(ov9282->reset_gpio)) {
> dev_err(ov9282->dev, "failed to get reset gpio %ld",
> PTR_ERR(ov9282->reset_gpio));
> @@ -1238,7 +1238,7 @@ static int ov9282_power_on(struct device *dev)
>
> usleep_range(400, 600);
>
> - gpiod_set_value_cansleep(ov9282->reset_gpio, 1);
> + gpiod_set_value_cansleep(ov9282->reset_gpio, 0);
>
> ret = clk_prepare_enable(ov9282->inclk);
> if (ret) {
> @@ -1261,7 +1261,7 @@ static int ov9282_power_on(struct device *dev)
> error_clk:
> clk_disable_unprepare(ov9282->inclk);
> error_reset:
> - gpiod_set_value_cansleep(ov9282->reset_gpio, 0);
> + gpiod_set_value_cansleep(ov9282->reset_gpio, 1);
>
> regulator_bulk_disable(OV9282_NUM_SUPPLIES, ov9282->supplies);
>
> @@ -1279,7 +1279,7 @@ static int ov9282_power_off(struct device *dev)
> struct v4l2_subdev *sd = dev_get_drvdata(dev);
> struct ov9282 *ov9282 = to_ov9282(sd);
>
> - gpiod_set_value_cansleep(ov9282->reset_gpio, 0);
> + gpiod_set_value_cansleep(ov9282->reset_gpio, 1);
>
> clk_disable_unprepare(ov9282->inclk);
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-09-29 15:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 7:34 arm64: dts: qcom: qrb2210-rb1: Add Qualcomm RB1 Vision kit Loic Poulain
2025-09-26 7:34 ` [PATCH v2 1/3] media: i2c: ov9282: Fix reset-gpio logical state Loic Poulain
2025-09-27 10:29 ` Bryan O'Donoghue
2025-09-29 8:46 ` Vladimir Zapolskiy
2025-09-29 8:53 ` Loic Poulain
2025-09-29 15:18 ` Dave Stevenson [this message]
2025-10-02 15:59 ` Loic Poulain
2025-09-26 7:34 ` [PATCH v2 2/3] arm64: dts: qcom: qrb2210-rb1: Add PM8008 node Loic Poulain
2025-09-26 11:10 ` Konrad Dybcio
2025-09-26 7:34 ` [PATCH v2 3/3] arm64: dts: qcom: qrb2210-rb1: Add overlay for vision mezzanine Loic Poulain
2025-09-26 11:11 ` Konrad Dybcio
2025-09-27 10:37 ` Bryan O'Donoghue
2025-09-29 7:52 ` Loic Poulain
2025-09-29 9:03 ` Vladimir Zapolskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPY8ntC-Or2ErudHmP0mQMY6Rb8yQ53wkB5fW3b+4DTeeytbdA@mail.gmail.com \
--to=dave.stevenson@raspberrypi.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mchehab@kernel.org \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).