From: Saikiran <bjsaikiran@gmail.com>
To: linux-media@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org, rfoss@kernel.org,
todor.too@gmail.com, bryan.odonoghue@linaro.org, bod@kernel.org,
vladimir.zapolskiy@linaro.org, hansg@kernel.org,
sakari.ailus@linux.intel.com, mchehab@kernel.org,
stable@vger.kernel.org, Saikiran <bjsaikiran@gmail.com>
Subject: [PATCH v3 3/3] media: i2c: ov02c10: Use runtime PM autosuspend to avoid brownouts
Date: Mon, 26 Jan 2026 23:04:44 +0530 [thread overview]
Message-ID: <20260126173444.10228-4-bjsaikiran@gmail.com> (raw)
In-Reply-To: <20260126173444.10228-1-bjsaikiran@gmail.com>
On Qualcomm X1E80100 platforms, the OV02C10 sensor experiences brownouts
if power-cycled too quickly (< 2.3s) due to slow passive discharge of
regulator rails.
Implement Runtime PM Autosuspend with a delay of 1000ms. This keeps the
regulators enabled for a short duration after the device is closed,
preventing costly power-off/power-on cycles during rapid user
interactions (e.g., browser permission checks).
This aligns the driver with standard power management practices used in
other sensor drivers (e.g., ov2680) to handle platform latency
constraints.
Tested-on: Lenovo Yoga Slim 7x (Snapdragon X Elite)
Fixes: 44f8901 ("media: i2c: add OmniVision OV02C10 sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Saikiran <bjsaikiran@gmail.com>
---
drivers/media/i2c/ov02c10.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
index ba8bbb4f433a..9f6c4e8b06cc 100644
--- a/drivers/media/i2c/ov02c10.c
+++ b/drivers/media/i2c/ov02c10.c
@@ -628,7 +628,7 @@ static int ov02c10_enable_streams(struct v4l2_subdev *sd,
ret = cci_write(ov02c10->regmap, OV02C10_REG_STREAM_CONTROL, 1, NULL);
out:
if (ret)
- pm_runtime_put(ov02c10->dev);
+ pm_runtime_put_autosuspend(ov02c10->dev);
return ret;
}
@@ -640,7 +640,7 @@ static int ov02c10_disable_streams(struct v4l2_subdev *sd,
struct ov02c10 *ov02c10 = to_ov02c10(sd);
cci_write(ov02c10->regmap, OV02C10_REG_STREAM_CONTROL, 0, NULL);
- pm_runtime_put(ov02c10->dev);
+ pm_runtime_put_autosuspend(ov02c10->dev);
return 0;
}
@@ -900,6 +900,7 @@ static void ov02c10_remove(struct i2c_client *client)
v4l2_async_unregister_subdev(sd);
pm_runtime_disable(ov02c10->dev);
+ pm_runtime_dont_use_autosuspend(ov02c10->dev);
if (!pm_runtime_status_suspended(ov02c10->dev)) {
ov02c10_power_off(ov02c10->dev);
pm_runtime_set_suspended(ov02c10->dev);
@@ -983,6 +984,8 @@ static int ov02c10_probe(struct i2c_client *client)
goto probe_error_media_entity_cleanup;
}
+ pm_runtime_set_autosuspend_delay(ov02c10->dev, 1000);
+ pm_runtime_use_autosuspend(ov02c10->dev);
pm_runtime_set_active(ov02c10->dev);
pm_runtime_enable(ov02c10->dev);
--
2.51.0
next prev parent reply other threads:[~2026-01-26 17:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 17:34 [PATCH v3 0/3] media: i2c: ov02c10: Fix brownouts and power sequence Saikiran
2026-01-26 17:34 ` [PATCH v3 1/3] media: i2c: ov02c10: Fix use-after-free in remove function Saikiran
2026-01-27 10:30 ` Hans de Goede
2026-01-26 17:34 ` [PATCH v3 2/3] media: i2c: ov02c10: Correct power-on sequence and timing Saikiran
2026-01-27 10:40 ` Hans de Goede
2026-01-27 10:47 ` Bryan O'Donoghue
2026-01-27 10:50 ` Hans de Goede
2026-01-26 17:34 ` Saikiran [this message]
2026-01-27 9:46 ` [PATCH v3 3/3] media: i2c: ov02c10: Use runtime PM autosuspend to avoid brownouts Bryan O'Donoghue
2026-01-27 10:43 ` Hans de Goede
2026-01-27 10:44 ` Hans de Goede
[not found] ` <CAAFDt1tsyvtAa84bFK2Hq5yG_F15SUUseBd5Xi-DB8GnUj7+7A@mail.gmail.com>
2026-01-27 10:50 ` Bryan O'Donoghue
[not found] ` <CAAFDt1vKn5ssoTQZduGKb5eOeN74P=FVk9f01go1d-JS71Zt0A@mail.gmail.com>
2026-01-27 11:06 ` Bryan O'Donoghue
2026-01-27 11:11 ` Bryan O'Donoghue
2026-01-27 16:20 ` Saikiran B
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=20260126173444.10228-4-bjsaikiran@gmail.com \
--to=bjsaikiran@gmail.com \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=hansg@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rfoss@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=todor.too@gmail.com \
--cc=vladimir.zapolskiy@linaro.org \
/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