Skip to content

media: i2c: ov7251: add SC8180X MIPI clock gate, autosuspend, and Surface Pro X IR strobe - #208

Open
robertijtsma wants to merge 1 commit into
linux-surface:spx/v7.3from
robertijtsma:spx-media-i2c-ov7251
Open

robertijtsma wants to merge 1 commit into
linux-surface:spx/v7.3from
robertijtsma:spx-media-i2c-ov7251

Conversation

@robertijtsma

Copy link
Copy Markdown

Summary

Companion sensor PR to #206 enabling reliable front Windows Hello IR camera capture and automatic 850 nm IR illumination on Microsoft Surface Pro X (SC8180X / SQ2):

  • Runtime PM autosuspend: switch ov7251_s_ctrl() and ov7251_s_stream() from synchronous pm_runtime_put() to pm_runtime_mark_last_busy() + pm_runtime_put_autosuspend() (matching the 1000 ms autosuspend timer already configured in ov7251_probe()), plus a 5 ms post-init settle delay to avoid reset glitches across back-to-back streams.
  • SC8180X MIPI clock gating: write OV7251_MIPI_CTRL00 (0x4800 = 0x24) on qcom,sc8180x platforms for clean LP→HS transitions on CSIPHY3 without affecting non-SC8180X boards.
  • Automatic hardware IR strobe: drive the OV7251 hardware STROBE pad (0x3b81, 0x3b8e..0x3b8f, 0x3027, 0x3005) while streaming on microsoft,surface-pro-x (or when opted in via ovti,ir-strobe / ir_strobe=1) and explicitly disable it on stream stop so the 850 nm IR illuminator turns on only during active capture.

Verification

  • ov7251.ko compiled cleanly with W=1 against Linux 7.3.1-1-surface (0 errors, 0 warnings).
  • ./scripts/checkpatch.pl --no-tree: 0 errors, 0 warnings.
  • Live-tested on Microsoft Surface Pro X SQ2 (SC8180X, front VGA IR camera on CCI0 bus 0 @ 0x60, 1-lane CSIPHY3 → CSID_LITE1 → VFE_LITE1 RDI0) with OpenCV and Howdy IR face authentication.

…face Pro X IR strobe

Enable reliable streaming and automatic 850 nm Windows Hello IR
illumination for the front OV7251 IR camera on Microsoft Surface Pro X
(SC8180X / SQ2):

- Use pm_runtime_mark_last_busy() + pm_runtime_put_autosuspend() in
  ov7251_s_ctrl() and ov7251_s_stream() (matching the autosuspend timer
  already configured in probe) and add a 5 ms post-init settle delay to
  prevent reset glitches across back-to-back streams.
- Program MIPI_CTRL00 (0x4800 = 0x24) on SC8180X for clean LP->HS
  transitions on CSIPHY3 without affecting non-SC8180X platforms.
- Drive the sensor's hardware STROBE pad (0x3b81, 0x3b8e..0x3b8f,
  0x3027, 0x3005) while streaming on microsoft,surface-pro-x (or when
  enabled via ovti,ir-strobe / ir_strobe=1), and turn it off on stream
  stop so the 850 nm IR illuminator activates only while streaming.

Tested on Microsoft Surface Pro X SQ2 (SC8180X, Linux 7.3.1-1-surface)
with OpenCV and Howdy IR face authentication.

Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant