mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE
@ 2026-11-27 20:30 Robert Ijtsma via B4 Relay
  2026-11-27 20:30 ` [PATCH 1/4] media: i2c: ov7251: wait for software reset settle in power-on Robert Ijtsma via B4 Relay
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Robert Ijtsma via B4 Relay @ 2026-11-27 20:30 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, Jacopo Mondi, Todor Tomov
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Robert Ijtsma

This series adds four cleanups and hardware enablement features to the
OmniVision OV7251 sensor driver needed for reliable operation on
Qualcomm SC8180X / Microsoft Surface Pro X:

1. Wait 5-10 ms after global initialization (software reset 0x0103)
   in ov7251_set_power_on().
2. Use pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend()
   in ov7251_s_ctrl() and ov7251_s_stream() to match the autosuspend
   configuration in probe.
3. Support V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK by setting
   CLOCK_LANE_GATE (BIT(5)) in OV7251_MIPI_CTRL00 (0x4800).
4. Expose V4L2_CID_FLASH_STROBE_OE to control the sensor's hardware
   STROBE output pin for synchronized IR illumination.

Signed-off-by: Robert Ijtsma <robertijtsma@gmail.com>
---
Robert Ijtsma (4):
      media: i2c: ov7251: wait for software reset settle in power-on
      media: i2c: ov7251: use pm_runtime_put_autosuspend()
      media: i2c: ov7251: support non-continuous MIPI clock mode
      media: i2c: ov7251: add V4L2_CID_FLASH_STROBE_OE control

 drivers/media/i2c/ov7251.c | 79 +++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 74 insertions(+), 5 deletions(-)
---
base-commit: 10c156a0a06c0a255cbd13cabad649fd8d604b47
change-id: 20261127-ov7251-strobe-ncont-188241b553be

Best regards,
-- 
Robert Ijtsma <robertijtsma@gmail.com>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] media: i2c: ov7251: wait for software reset settle in power-on
  2026-11-27 20:30 [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Robert Ijtsma via B4 Relay
@ 2026-11-27 20:30 ` Robert Ijtsma via B4 Relay
  2026-11-27 20:30 ` [PATCH 2/4] media: i2c: ov7251: use pm_runtime_put_autosuspend() Robert Ijtsma via B4 Relay
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Ijtsma via B4 Relay @ 2026-11-27 20:30 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, Jacopo Mondi, Todor Tomov
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Robert Ijtsma

From: Robert Ijtsma <robertijtsma@gmail.com>

ov7251_global_init_setting[] issues a software reset (0x0103 = 0x01) as
part of ov7251_set_power_on(), after which callers immediately issue
further I2C register accesses. Give the sensor 5-10 ms to settle after
global initialization to prevent intermittent I2C errors on rapid power
cycles.

Fixes: d30bb512da3d ("media: Add a driver for the ov7251 camera sensor")
Signed-off-by: Robert Ijtsma <robertijtsma@gmail.com>
---
 drivers/media/i2c/ov7251.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 5b03343a0350c926a34a391af6a338ddf6c3e0bd..77ac60fad62209eda0444015196e52564a0e947d 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -941,7 +941,9 @@ static int ov7251_set_power_on(struct device *dev)
 		return ret;
 	}
 
-	return ret;
+	usleep_range(5000, 10000);
+
+	return 0;
 }
 
 static int ov7251_set_power_off(struct device *dev)

-- 
2.47.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/4] media: i2c: ov7251: use pm_runtime_put_autosuspend()
  2026-11-27 20:30 [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Robert Ijtsma via B4 Relay
  2026-11-27 20:30 ` [PATCH 1/4] media: i2c: ov7251: wait for software reset settle in power-on Robert Ijtsma via B4 Relay
@ 2026-11-27 20:30 ` Robert Ijtsma via B4 Relay
  2026-11-27 20:30 ` [PATCH 3/4] media: i2c: ov7251: support non-continuous MIPI clock mode Robert Ijtsma via B4 Relay
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Ijtsma via B4 Relay @ 2026-11-27 20:30 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, Jacopo Mondi, Todor Tomov
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Robert Ijtsma

From: Robert Ijtsma <robertijtsma@gmail.com>

ov7251_probe() configures runtime PM autosuspend with a 1000 ms delay,
but ov7251_s_ctrl() and ov7251_s_stream() call pm_runtime_put() without
updating last_busy or using autosuspend, immediately powering down the
sensor on stream stop or control writes.

Use pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend() in
ov7251_s_ctrl() and ov7251_s_stream() so the configured autosuspend
window is honored across back-to-back captures.

Fixes: d30bb512da3d ("media: Add a driver for the ov7251 camera sensor")
Signed-off-by: Robert Ijtsma <robertijtsma@gmail.com>
---
 drivers/media/i2c/ov7251.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 77ac60fad62209eda0444015196e52564a0e947d..5a50a5100c1e995714201fb509fb207fa03c5f39 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -1074,7 +1074,8 @@ static int ov7251_s_ctrl(struct v4l2_ctrl *ctrl)
 		break;
 	}
 
-	pm_runtime_put(ov7251->dev);
+	pm_runtime_mark_last_busy(ov7251->dev);
+	pm_runtime_put_autosuspend(ov7251->dev);
 
 	return ret;
 }
@@ -1378,14 +1379,16 @@ static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable)
 	} else {
 		ret = ov7251_write_reg(ov7251, OV7251_SC_MODE_SELECT,
 				       OV7251_SC_MODE_SELECT_SW_STANDBY);
-		pm_runtime_put(ov7251->dev);
+		pm_runtime_mark_last_busy(ov7251->dev);
+		pm_runtime_put_autosuspend(ov7251->dev);
 	}
 
 	mutex_unlock(&ov7251->lock);
 	return ret;
 
 err_power_down:
-	pm_runtime_put(ov7251->dev);
+	pm_runtime_mark_last_busy(ov7251->dev);
+	pm_runtime_put_autosuspend(ov7251->dev);
 	mutex_unlock(&ov7251->lock);
 	return ret;
 }

-- 
2.47.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/4] media: i2c: ov7251: support non-continuous MIPI clock mode
  2026-11-27 20:30 [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Robert Ijtsma via B4 Relay
  2026-11-27 20:30 ` [PATCH 1/4] media: i2c: ov7251: wait for software reset settle in power-on Robert Ijtsma via B4 Relay
  2026-11-27 20:30 ` [PATCH 2/4] media: i2c: ov7251: use pm_runtime_put_autosuspend() Robert Ijtsma via B4 Relay
@ 2026-11-27 20:30 ` Robert Ijtsma via B4 Relay
  2026-11-27 20:30 ` [PATCH 4/4] media: i2c: ov7251: add V4L2_CID_FLASH_STROBE_OE control Robert Ijtsma via B4 Relay
  2026-11-27 21:16 ` [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Antoine Pichot
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Ijtsma via B4 Relay @ 2026-11-27 20:30 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, Jacopo Mondi, Todor Tomov
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Robert Ijtsma

From: Robert Ijtsma <robertijtsma@gmail.com>

Check V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK from the parsed CSI-2 endpoint
in ov7251_check_hwcfg() and set BIT(5) (CLOCK_LANE_GATE) in
OV7251_MIPI_CTRL00 (0x4800) when starting streaming in non-continuous
clock mode, allowing the sensor to gate the MIPI clock lane in LP-11
idle periods.

Signed-off-by: Robert Ijtsma <robertijtsma@gmail.com>
---
 drivers/media/i2c/ov7251.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 5a50a5100c1e995714201fb509fb207fa03c5f39..13fcc4cdb31a5e7350bcc0b15d186f4912b074be 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -64,6 +64,8 @@
 #define OV7251_TIMING_VTS_REG		0x380e
 #define OV7251_TIMING_MIN_VTS		1
 #define OV7251_TIMING_MAX_VTS		0xffff
+#define OV7251_MIPI_CTRL00		0x4800
+#define OV7251_MIPI_CTRL00_CLOCK_LANE_GATE	BIT(5)
 #define OV7251_INTEGRATION_MARGIN	20
 
 struct reg_value {
@@ -156,6 +158,7 @@ struct ov7251 {
 
 	struct mutex lock; /* lock to protect power state, ctrls and mode */
 	bool power_on;
+	bool clock_ncont;
 
 	struct gpio_desc *enable_gpio;
 };
@@ -1372,6 +1375,20 @@ static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable)
 			dev_err(ov7251->dev, "could not sync v4l2 controls\n");
 			goto err_power_down;
 		}
+
+		if (ov7251->clock_ncont) {
+			u8 val;
+
+			ret = ov7251_read_reg(ov7251, OV7251_MIPI_CTRL00, &val);
+			if (ret)
+				goto err_power_down;
+
+			ret = ov7251_write_reg(ov7251, OV7251_MIPI_CTRL00,
+					       val | OV7251_MIPI_CTRL00_CLOCK_LANE_GATE);
+			if (ret)
+				goto err_power_down;
+		}
+
 		ret = ov7251_write_reg(ov7251, OV7251_SC_MODE_SELECT,
 				       OV7251_SC_MODE_SELECT_STREAMING);
 		if (ret)
@@ -1529,6 +1546,8 @@ static int ov7251_check_hwcfg(struct ov7251 *ov7251)
 	}
 
 	ov7251->link_freq_idx = i;
+	ov7251->clock_ncont = bus_cfg.bus.mipi_csi2.flags &
+			      V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK;
 
 out_free_bus_cfg:
 	v4l2_fwnode_endpoint_free(&bus_cfg);

-- 
2.47.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/4] media: i2c: ov7251: add V4L2_CID_FLASH_STROBE_OE control
  2026-11-27 20:30 [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Robert Ijtsma via B4 Relay
                   ` (2 preceding siblings ...)
  2026-11-27 20:30 ` [PATCH 3/4] media: i2c: ov7251: support non-continuous MIPI clock mode Robert Ijtsma via B4 Relay
@ 2026-11-27 20:30 ` Robert Ijtsma via B4 Relay
  2026-11-27 21:16 ` [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Antoine Pichot
  4 siblings, 0 replies; 8+ messages in thread
From: Robert Ijtsma via B4 Relay @ 2026-11-27 20:30 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, Jacopo Mondi, Todor Tomov
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Robert Ijtsma

From: Robert Ijtsma <robertijtsma@gmail.com>

Devices such as the Microsoft Surface Pro X wire the OV7251 sensor's
hardware STROBE output pin to an 850 nm IR illuminator for synchronized
frame-exposure illumination.

Expose V4L2_CID_FLASH_STROBE_OE (default disabled) to drive the sensor's
STROBE pin (0x3005, 0x3027, 0x3b81, 0x3b8e..0x3b8f) while streaming, and
disable the strobe output when stopping the stream.

Signed-off-by: Robert Ijtsma <robertijtsma@gmail.com>
---
 drivers/media/i2c/ov7251.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 13fcc4cdb31a5e7350bcc0b15d186f4912b074be..e6007708139964c423c68dae86e7c07c26349fea 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -30,7 +30,15 @@
 #define OV7251_CHIP_ID_HIGH_BYTE	0x77
 #define OV7251_CHIP_ID_LOW		0x300b
 #define OV7251_CHIP_ID_LOW_BYTE		0x50
+#define OV7251_SC_IO_CTRL1		0x3005
+#define OV7251_IO_CTRL1_STROBE_EN	BIT(3)
+#define OV7251_SC_GP_IO_SEL1		0x3027
 #define OV7251_SC_GP_IO_IN1		0x3029
+#define OV7251_STROBE_PATTERN		0x3b81
+#define OV7251_STROBE_PATTERN_ALL	0xff
+#define OV7251_STROBE_SPAN_H		0x3b8e
+#define OV7251_STROBE_SPAN_L		0x3b8f
+#define OV7251_STROBE_SPAN_DEFAULT	0x0200
 #define OV7251_AEC_EXPO_0		0x3500
 #define OV7251_AEC_EXPO_1		0x3501
 #define OV7251_AEC_EXPO_2		0x3502
@@ -979,6 +987,37 @@ static int ov7251_set_hflip(struct ov7251 *ov7251, s32 value)
 	return ret;
 }
 
+static int ov7251_set_strobe(struct ov7251 *ov7251, bool enable)
+{
+	int ret;
+
+	if (enable) {
+		ret = ov7251_write_reg(ov7251, OV7251_STROBE_PATTERN,
+				       OV7251_STROBE_PATTERN_ALL);
+		if (ret)
+			return ret;
+
+		ret = ov7251_write_reg(ov7251, OV7251_STROBE_SPAN_H,
+				       OV7251_STROBE_SPAN_DEFAULT >> 8);
+		if (ret)
+			return ret;
+
+		ret = ov7251_write_reg(ov7251, OV7251_STROBE_SPAN_L,
+				       OV7251_STROBE_SPAN_DEFAULT & 0xff);
+		if (ret)
+			return ret;
+
+		ret = ov7251_write_reg(ov7251, OV7251_SC_GP_IO_SEL1, 0x00);
+		if (ret)
+			return ret;
+
+		return ov7251_write_reg(ov7251, OV7251_SC_IO_CTRL1,
+					OV7251_IO_CTRL1_STROBE_EN);
+	}
+
+	return ov7251_write_reg(ov7251, OV7251_SC_IO_CTRL1, 0x00);
+}
+
 static int ov7251_set_vflip(struct ov7251 *ov7251, s32 value)
 {
 	u8 val = ov7251->timing_format1;
@@ -1072,6 +1111,9 @@ static int ov7251_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_VBLANK:
 		ret = ov7251_vts_configure(ov7251, ctrl->val);
 		break;
+	case V4L2_CID_FLASH_STROBE_OE:
+		ret = ov7251_set_strobe(ov7251, ctrl->val);
+		break;
 	default:
 		ret = -EINVAL;
 		break;
@@ -1394,6 +1436,7 @@ static int ov7251_s_stream(struct v4l2_subdev *subdev, int enable)
 		if (ret)
 			goto err_power_down;
 	} else {
+		ov7251_set_strobe(ov7251, false);
 		ret = ov7251_write_reg(ov7251, OV7251_SC_MODE_SELECT,
 				       OV7251_SC_MODE_SELECT_SW_STANDBY);
 		pm_runtime_mark_last_busy(ov7251->dev);
@@ -1594,7 +1637,7 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251)
 	s64 pixel_rate;
 	int hblank;
 
-	v4l2_ctrl_handler_init(&ov7251->ctrls, 7);
+	v4l2_ctrl_handler_init(&ov7251->ctrls, 8);
 	ov7251->ctrls.lock = &ov7251->lock;
 
 	v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
@@ -1609,6 +1652,8 @@ static int ov7251_init_ctrls(struct ov7251 *ov7251)
 				     V4L2_CID_TEST_PATTERN,
 				     ARRAY_SIZE(ov7251_test_pattern_menu) - 1,
 				     0, 0, ov7251_test_pattern_menu);
+	v4l2_ctrl_new_std(&ov7251->ctrls, &ov7251_ctrl_ops,
+			  V4L2_CID_FLASH_STROBE_OE, 0, 1, 1, 0);
 
 	pixel_rate = pixel_rates[ov7251->link_freq_idx];
 	ov7251->pixel_clock = v4l2_ctrl_new_std(&ov7251->ctrls,

-- 
2.47.3



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE
  2026-11-27 20:30 [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Robert Ijtsma via B4 Relay
                   ` (3 preceding siblings ...)
  2026-11-27 20:30 ` [PATCH 4/4] media: i2c: ov7251: add V4L2_CID_FLASH_STROBE_OE control Robert Ijtsma via B4 Relay
@ 2026-11-27 21:16 ` Antoine Pichot
  2026-11-27 21:55   ` Robert IJtsma
  4 siblings, 1 reply; 8+ messages in thread
From: Antoine Pichot @ 2026-11-27 21:16 UTC (permalink / raw)
  To: Robert Ijtsma
  Cc: Sakari Ailus, Mauro Carvalho Chehab, Mauro Carvalho Chehab,
	Jacopo Mondi, Todor Tomov, linux-media, linux-kernel

Hi Robert,

Your patch 4 adds the same control as patch 8 of my ov7251 series, whose
v3 went to this list on 13 Nov:
https://lore.kernel.org/linux-media/20261113024059.1087031-1-antoine.pichot@gmail.com/

Mine drives the same STROBE pin, for the infrared emitter of the
Surface Book 2 and Surface Pro 7 and 7+, and its
V4L2_CID_FLASH_STROBE_OE is off by default too. The main differences:

- The pulse follows the exposure, from 52 to 776 lines as the Windows
  driver clamps it, and never more than 45% of the frame. A fixed
  512-line pulse lights about 60% of each frame at 60 fps and 90% at
  90 fps.
- It lights alternate frames (pattern 0xaa), as Windows Hello does, so
  the dark frames give the ambient light reference.

Could you please try my series on the Surface Pro X? It has only been
tested on Intel camera interfaces (IPU3, IPU4 and IPU6), so a Tested-by
from your Qualcomm SC8180X would show that it does not depend on the
platform. If the Pro X needs every frame lit, I can add a control for
it. Patch 8 depends on patches 5 to 7.

Your patches 2 to 4 conflict with mine, mostly because my patch 5
converts ov7251_s_stream() and the driver's lock to the sub-device
active state, so one of the two series will need a rebase. Your patch
1 applies on top of mine, but my patch 7 moves the common registers
into the global init table, right after the software reset, so your
wait would then come after those writes instead of before them.

Kind regards,
Antoine

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE
  2026-11-27 21:16 ` [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Antoine Pichot
@ 2026-11-27 21:55   ` Robert IJtsma
  2026-11-27 22:45     ` Antoine Pichot
  0 siblings, 1 reply; 8+ messages in thread
From: Robert IJtsma @ 2026-11-27 21:55 UTC (permalink / raw)
  To: Antoine Pichot, Robert Ijtsma
  Cc: Sakari Ailus, Mauro Carvalho Chehab, Mauro Carvalho Chehab,
	Jacopo Mondi, Todor Tomov, linux-media, linux-kernel

Hi Antoine,

On Sat, Nov 28, 2026 at 06:16:53AM +0900, Antoine Pichot wrote:
> Your patch 4 adds the same control as patch 8 of my ov7251 series, whose
> v3 went to this list on 13 Nov:
> https://lore.kernel.org/linux-media/20261113024059.1087031-1-antoine.pichot@gmail.com/
>
> Mine drives the same STROBE pin, for the infrared emitter of the
> Surface Book 2 and Surface Pro 7 and 7+, and its
> V4L2_CID_FLASH_STROBE_OE is off by default too. The main differences:
>
> - The pulse follows the exposure, from 52 to 776 lines as the Windows
>   driver clamps it, and never more than 45% of the frame. A fixed
>   512-line pulse lights about 60% of each frame at 60 fps and 90% at
>   90 fps.
> - It lights alternate frames (pattern 0xaa), as Windows Hello does, so
>   the dark frames give the ambient light reference.
>
> Could you please try my series on the Surface Pro X? It has only been
> tested on Intel camera interfaces (IPU3, IPU4 and IPU6), so a Tested-by
> from your Qualcomm SC8180X would show that it does not depend on the
> platform. If the Pro X needs every frame lit, I can add a control for
> it. Patch 8 depends on patches 5 to 7.

Thanks for the pointer! I missed your v3 series on the list — your
exposure-clamped strobe span and 45% duty-cycle cap are much cleaner
than a fixed 512-line pulse.

I just built and tested patches 1-8 of your v3 series on the Microsoft
Surface Pro X SQ2 (Qualcomm SC8180X, CAMSS CSIPHY3 -> CSID3 -> VFE3 RDI0,
OV7251 rev 7 / 1F at 0x60, 19.2 MHz xclk, 240 MHz link frequency,
with non-continuous MIPI clock gating enabled on 0x4800 for Qualcomm
CSIPHY):

- orientation (Front) and rotation (0) parse cleanly from Devicetree.
- With strobe_output_enable=0 at 30 fps (640x480 Y10, exposure=550,
  gain=32), dark baseline mean is ~16.8 / 1023 across all frames.
- With strobe_output_enable=1, alternate frames (0xaa) light cleanly
  from frame 0 with zero bleed into dark frames across all three modes,
  including back-to-back stream restarts and mode switches:
  - 30.00 fps: lit ~193.5, dark ~16.8
  - 60.14 fps: lit ~80.3,  dark ~16.5 (45% duty cap active)
  - 90.43 fps: lit ~58.6,  dark ~16.7 (45% duty cap active)
- Howdy's dark_threshold skips the unlit frames automatically, so no
  extra all-frames control is needed for Surface Pro X.

Feel free to add for patches 1-8:

Tested-by: Robert Ijtsma <robertijtsma@gmail.com> # Surface Pro X SQ2 (SC8180X)

> Your patches 2 to 4 conflict with mine, mostly because my patch 5
> converts ov7251_s_stream() and the driver's lock to the sub-device
> active state, so one of the two series will need a rebase. Your patch
> 1 applies on top of mine, but my patch 7 moves the common registers
> into the global init table, right after the software reset, so your
> wait would then come after those writes instead of before them.

Agreed — I have dropped my patch 4 in favor of your patch 8 and rebased
the remaining three patches on top of your v3 series for my v2:

1. Issue 0x0103 = 0x01 explicitly in ov7251_set_power_on() and wait
   5-10 ms before writing ov7251_global_init_setting[] (good catch!).
2. Use pm_runtime_mark_last_busy() + pm_runtime_put_autosuspend() in
   ov7251_s_ctrl() and ov7251_s_stream() so the 1000 ms autosuspend
   window is actually honored across stream restarts (which also lets
   your patch 7 keep the common registers alive in software standby
   between streams).
3. Support V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK on 0x4800 during power-on.

I will post that 3-patch v2 with Based-on pointing to your v3 series.

Best regards,
Robert

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE
  2026-11-27 21:55   ` Robert IJtsma
@ 2026-11-27 22:45     ` Antoine Pichot
  0 siblings, 0 replies; 8+ messages in thread
From: Antoine Pichot @ 2026-11-27 22:45 UTC (permalink / raw)
  To: Robert Ijtsma
  Cc: Sakari Ailus, Mauro Carvalho Chehab, Mauro Carvalho Chehab,
	Jacopo Mondi, Todor Tomov, linux-media, linux-kernel

Hi Robert,

On Fri, Nov 27, 2026 at 04:55:02PM -0500, Robert IJtsma wrote:
> Feel free to add for patches 1-8:
>
> Tested-by: Robert Ijtsma <robertijtsma@gmail.com> # Surface Pro X SQ2 (SC8180X)

Thank you for testing on the Surface Pro X, and for dropping your strobe
patch. I will add your Tested-by to patches 1 to 8 if a v4 of my series
turns out to be needed.

> 2. Use pm_runtime_mark_last_busy() + pm_runtime_put_autosuspend() in
>    ov7251_s_ctrl() and ov7251_s_stream() so the 1000 ms autosuspend
>    window is actually honored across stream restarts (which also lets
>    your patch 7 keep the common registers alive in software standby
>    between streams).

Two small points on this one:

- pm_runtime_put_autosuspend() calls pm_runtime_mark_last_busy() itself
  since commit b3db492e8335 ("PM: runtime: Mark last busy stamp in
  pm_runtime_put_autosuspend()"), so calling both is redundant.
- The Fixes tag's d30bb512da3d predates runtime PM in this driver, which
  came with commit 207f4162f1c9 ("media: i2c: Add pm_runtime support to
  ov7251").

Kind regards,
Antoine

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-27 22:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27 20:30 [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Robert Ijtsma via B4 Relay
2026-11-27 20:30 ` [PATCH 1/4] media: i2c: ov7251: wait for software reset settle in power-on Robert Ijtsma via B4 Relay
2026-11-27 20:30 ` [PATCH 2/4] media: i2c: ov7251: use pm_runtime_put_autosuspend() Robert Ijtsma via B4 Relay
2026-11-27 20:30 ` [PATCH 3/4] media: i2c: ov7251: support non-continuous MIPI clock mode Robert Ijtsma via B4 Relay
2026-11-27 20:30 ` [PATCH 4/4] media: i2c: ov7251: add V4L2_CID_FLASH_STROBE_OE control Robert Ijtsma via B4 Relay
2026-11-27 21:16 ` [PATCH 0/4] media: i2c: ov7251: runtime PM, non-continuous MIPI clock, and strobe OE Antoine Pichot
2026-11-27 21:55   ` Robert IJtsma
2026-11-27 22:45     ` Antoine Pichot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®