mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Afonso Figuinha <afonso.figuinha@gmail.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Bingbu Cao <bingbu.cao@amd.com>,
	Dan Scally <dan.scally@ideasonboard.com>,
	Hans de Goede <hansg@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Tianshu Qiu <tian.shu.qiu@intel.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/4] media: ov9734: Support the Microsoft Surface Laptop 1 front camera
Date: Thu,  5 Nov 2026 23:03:23 +0000	[thread overview]
Message-ID: <20261105230327.10852-1-afonso.figuinha@gmail.com> (raw)

The front camera of the Microsoft Surface Laptop 1 is an OmniVision
OV9734 connected to the IPU3 CIO2. It does not work today for two
reasons. The ipu-bridge does not know the OVTI9734 HID, so no fwnode
graph is built for the sensor. The ov9734 driver relies on ACPI to
power the sensor, while on this laptop an INT3472 discrete device
(SKC1 in the DSDT) controls the clock and the reset line.

Patch 1 adds the sensor to ipu-bridge. Patch 2 makes the driver wait
for the endpoint that the bridge creates. Patch 3 adds the reset GPIO,
the supplies and the PM callbacks. Patch 4 adds control event support,
so v4l2-compliance passes.

The series is based on media-committers next (v7.4-rc1).
ov9734.o and ipu-bridge.o build there with W=1 and C=1 (sparse from
git) with no warnings.

Hardware tests ran on a Surface Laptop 1 with 6.19.8-surface-3, the
linux-surface kernel. Patches 2 to 4 apply to 6.19.8 with offsets
only, apart from the v4l2_subdev_client_info API change, which they do
not touch. That kernel also carries the linux-surface camera patches,
and I did not check which of them this result depends on. Patch 1 does
not apply there because the sensor list differs, so the same entry was
added by hand.
Results:
- the sensor probes and the chip ID reads back as 0x9734;
- libcamera (IPU3 pipeline) streams 1280x704 at 30 fps;
- the sensor is runtime suspended when idle and active while
  streaming;
- unloading and reloading the module works with no warnings;
- v4l2-compliance 1.32.0 on the sensor subdev: 46 tests, 46 passed,
  0 warnings. Without patch 4, the event subscription test fails.

Not tested:
- a boot of the posted base;
- probe deferral at boot with this exact revision of patch 2. The
  sensor binds at boot, but a deferred probe is no longer logged, so I
  could not confirm the sensor driver probed before ipu3-cio2 on that
  boot. An earlier revision with the same logic logged the deferral
  and then bound;
- platforms that power the sensor through ACPI, which the driver
  supported before this series. Where no reset GPIO is described, the
  callbacks only enable and disable the clock, and the supplies fall
  back to dummy regulators;
- system suspend while streaming.

libcamera also needs changes for this sensor. I am sending them to
libcamera-devel at the same time.

Tool disclosure: this series was developed with an AI coding
assistant (Claude Code, model Claude Opus 5.5) in an interactive
session on the laptop. I asked it to get the front camera working. It
read the DSDT, the driver sources and the kernel logs, wrote the
patches, drafted the commit messages and this cover letter, and ran
the builds and tests listed above on the laptop. I reviewed every
change and can answer review comments on it.

Afonso Figuinha (4):
  media: ipu-bridge: Add OV9734 to the supported sensors list
  media: i2c: ov9734: Defer probe until the fwnode graph endpoint exists
  media: i2c: ov9734: Add reset GPIO, supplies and PM callbacks
  media: i2c: ov9734: Support control events

 drivers/media/i2c/ov9734.c           | 115 ++++++++++++++++++++++++---
 drivers/media/pci/intel/ipu-bridge.c |   2 +
 2 files changed, 107 insertions(+), 10 deletions(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.53.0


             reply	other threads:[~2026-11-05 23:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05 23:03 Afonso Figuinha [this message]
2026-11-05 23:03 ` [PATCH 1/4] media: ipu-bridge: Add OV9734 to the supported sensors list Afonso Figuinha
2026-11-05 23:03 ` [PATCH 2/4] media: i2c: ov9734: Defer probe until the fwnode graph endpoint exists Afonso Figuinha
2026-11-05 23:04 ` [PATCH 3/4] media: i2c: ov9734: Add reset GPIO, supplies and PM callbacks Afonso Figuinha
2026-11-05 23:05 ` [PATCH 4/4] media: i2c: ov9734: Support control events Afonso Figuinha

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=20261105230327.10852-1-afonso.figuinha@gmail.com \
    --to=afonso.figuinha@gmail.com \
    --cc=bingbu.cao@amd.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tian.shu.qiu@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

all inboxes | Powered by JetHome®