Skip to content

[RFC] cameras: ov8865: enable optional pwr1 supply on Surface Pro 7+ - #2201

Draft
Sevron88 wants to merge 2 commits into
linux-surface:masterfrom
Sevron88:sp7plus-ov8865-pwr1-rfc
Draft

Sevron88 wants to merge 2 commits into
linux-surface:masterfrom
Sevron88:sp7plus-ov8865-pwr1-rfc

Conversation

@Sevron88

Copy link
Copy Markdown

Surface Pro 7+ OV8865 pwr1 test evidence

This file accompanies the RFC patch in 0014-ov8865-pwr1.patch.

Tested hardware and software

  • Microsoft Surface Pro 7+
  • Intel Tiger Lake IPU6 (8086:9a19)
  • Rear sensor: OmniVision OV8865 (INT347A:00)
  • Kernel: 6.19.8-surface-3
  • libcamera: 0.7.0

Failure before the patch

The INT3472 layer exposed a regulator named INT3472:01-pwr1, but it had
zero users and remained disabled. The OV8865 runtime-resume path failed on
the first I2C software-reset write:

ov8865 i2c-INT347A:00: failed to perform sw reset
ov8865 i2c-INT347A:00: Error -121 runtime-resuming sensor, cannot instantiate VCM

Increasing the power-up delay and retrying the reset five times still
returned -121 on every attempt.

Result after the patch

int3472-discrete INT3472:01:   con_id=pwr1, flags=0x0
ov8865 i2c-INT347A:00: using optional pwr1 regulator
ov8865 i2c-INT347A:00: Instantiated dw9719 VCM

Raw capture:

3264x2448-SBGGR10/RAW
15.00 fps
10/10 frames captured
bytesused: 15980544

Processed capture:

1280x720-ABGR8888/sRGB
30.0 fps
30/30 frames captured
bytesused: 3686400

Front camera

The OV5693 front camera also works on this device after programming
MIPI register 0x4800 to 0x2d before stream-on, as proposed in
linux-surface PR #2171. On this Surface Pro 7+ it captures 1296x972
SBGGR10 at approximately 28.7 fps.

@luqqas96

Copy link
Copy Markdown

Surface Pro 7+ here (Fedora 44, kernel 6.19.8-3.surface.fc43, IPU6 8086:9a19). I hit
this exact failure and fixed it independently, from the firmware side rather than the
driver side, and I think the comparison is worth having on this thread before the patch
goes anywhere upstream.

Same fault, confirmed

ov8865 i2c-INT347A:00: supply dvdd not found, using dummy regulator
ov8865 i2c-INT347A:00: supply dovdd not found, using dummy regulator
int3472-discrete INT3472:01: GPIO type 0x08 detected on pin 0xaf
int3472-discrete INT3472:01:   con_id=pwr1, flags=0x0
ov8865 i2c-INT347A:00: failed to perform sw reset
ov8865 i2c-INT347A:00: Error -121 runtime-resuming sensor, cannot instantiate VCM
regulator.2  name=INT3472:01-avdd  state=disabled  users=0
regulator.3  name=INT3472:01-pwr1  state=disabled  users=0

I also pinned down which pin it is. Sweeping GPIO state across an unbind/bind cycle of
the ov8865 driver, so the whole power-up sequence runs from scratch:

Pin con_id Behaviour during power-up
75 avdd rises
85 reset released (active low)
175 (0xaf) pwr1 never rises

So the rail exists, is registered, and is never enabled — because it is registered under a
name nothing asks for. That matches your diagnosis exactly.

What pwr1 actually is

pwr1 is not a name that comes from anywhere authoritative. It is introduced by this
tree's 0013-cameras.patch:

case 0x08:  /* Surface Pro 9 - additional power rail */
    *con_id = "pwr1";

I checked what mainline does with type 0x08 by disassembling
int3472_get_con_id_and_polarity in both modules installed on this machine and following
the relocations into .rodata:

Kernel types with a case con_ids
6.19.8-3.surface 00 01 08 0b 0c 0d 10 12 13 reset powerdown clk-enable privacy-led avdd dvdd pwr1 pwr2 hpd
6.19.10-300.fc44 (stock Fedora) 00 01 0b 0c 0d 12 13 reset powerdown clk-enable privacy-led avdd dvdd

Mainline does not handle type 0x08 at all. The pwr1 name exists only here, and it
was introduced as an explicit guess for a type nobody had identified — the original comment
speculates it could be a focus motor or a flash.

That is why I think the patch as written cannot go upstream: it teaches a mainline sensor
driver to request a supply name that only exists in an out-of-tree patch. From mainline's
point of view ov8865 would be asking for a rail that never appears.

What the pin is

It is DVDD. I verified this by patching the DSDT so that INT3472:01's _DSM declares the
pin as type 0x12 instead of 0x08 — one byte, verified at ASL level — and booting with
the patched table:

int3472-discrete INT3472:01: GPIO type 0x12 detected on pin 0xaf
regulator name=INT3472:01-dvdd
ov8865 i2c-INT347A:00: Instantiated dw9719 VCM
3264x2448-SBGGR10/RAW   15 fps    10/10 frames
1280x720-ABGR8888/sRGB  30 fps    30/30 frames

Both original I2C errors are gone. The control is that the front ov5693 on the same
machine still complains about its own two supplies in that same boot, so this is not a
"something else changed" result. The front camera also needs the MIPI_CTRL00 write from
#2171 — same as you reported.

Suggested alternative: map it, don't rename it

Since the pin is DVDD, the smallest correct fix is to map the firmware's type to a type
the driver already understands, keyed on the sensor HID — which is exactly how the ov08x40
handshake pin is already handled in int3472_gpio_map[]:

{	/* Surface Pro 7+ declares the ov8865 dvdd pin as type 0x08 */
	.hid = "INT347A",
	.type_from = 0x08,
	.type_to = INT3472_GPIO_TYPE_HANDSHAKE,
	.con_id = "dvdd",
	.enable_time_us = GPIO_REGULATOR_ENABLE_TIME,
},

Advantages over renaming in the sensor driver:

  • No change to ov8865.c, so nothing depends on an out-of-tree supply name.
  • The map runs before the switch, so type becomes HANDSHAKE and the existing
    regulator path handles it — the case 0x08: additions in 0013-cameras.patch are not
    needed for this sensor.
  • HID-keyed, so the Pro 9 (OVTI5693 / OVTID858) is untouched.
  • There is precedent for both halves: OVTI08F4 maps a pin to dvdd, and INT347E
    remaps a reset GPIO's meaning per device.

What I have and have not tested, stated plainly: I have measured that giving this pin
to the sensor as dvdd makes the camera work — via the DSDT override, on this machine.
I have not yet booted without the override with only the map entry applied, so the map
entry itself is untested in that form. I'm working on that and will report back either way.

Related: on this machine INT3472:02 (the ov7251 IR sensor, INT347E:00) registers no
GPIOs at all
— not a mis-typed one, none. That is a different and earlier failure than
the rear camera's, in case anyone is looking at IR.

externalmirrors-syncer Bot pushed a commit to external-mirrors/linux-next that referenced this pull request Sep 3, 2026
INT3472 can describe a second sensor power rail as a GPIO of type
POWER1 (0x08), which the driver does not recognise, so the rail is left
unmapped and never enabled:

  int3472-discrete INT3472:01: GPIO type 0x08 unknown; the sensor may
  not work

On the Microsoft Surface Pro 7+ the rear camera's INT3472 (INT347A,
ov8865) has such a pin; without it the ov8865 "dvdd" supply resolves to
a dummy regulator and the sensor never probes.

Define the POWER0 (0x07) and POWER1 (0x08) GPIO types and map POWER1 to
a regulator with con_id "dvdd" for all devices, the supply the in-tree
ov8865 driver already requests. POWER0 is defined but left unmapped, as
no device that uses it is known.

With this change the Surface Pro 7+ rear camera probes and streams
reliably.

Link: linux-surface/linux-surface#1867
Link: linux-surface/linux-surface#2201
Suggested-by: Sakari Ailus <[email protected]>
Signed-off-by: Jakob Berg Jespersen <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
[Sakari Ailus: Sanitised the commit message a little.]
Signed-off-by: Sakari Ailus <[email protected]>

This branch has not been deployed

No deployments
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.

2 participants