Repository navigation
Conversation
|
Thanks, Nate. This is careful work, and it checks out where I could check it: the IMX787's power-up order is One thing the description doesn't account for: both drivers run on the Pixel 7 Pro at every boot. Its ultrawide is the IMX386 and both of its lens actuators are ak7375 nodes (enabled by overlays, loaded 40 s into the boot). So "nothing changes for existing boards" has to hold there, and for two lines it doesn't quite:
Everything else on the IMX386 path I walked through and it is what it was: the same five supplies in the same order with the same two optional, the GPIO reset, the name, the 480 gain cap. Smaller things, none of them blocking:
|
derekross
left a comment
There was a problem hiding this comment.
CI has run on this head and passes: clean merge onto today's omamobile, sign-offs, prefixes, checkpatch --strict, W=1 builds of imx386.c and ak7375.c, and dt_binding_check on sony,imx386.yaml. The one skipped line is "device trees: none touched", so CI didn't validate the 7 Pro's device tree against the changed binding; my hand run of that (the same two messages before and after) still stands in for it.
The two requests in my comment above are unchanged. I'll do the 7 Pro run once they are in, so that it tests the commits that will land.
The Pixel 9 Pro Fold's main camera is a Sony IMX787: the IMX386's register map behind a MIPI CSI-2 C-PHY output, in a module whose AF/OIS controller shares the sensor's XCLR line and adds its own supplies. Add the sony,imx787 compatible, its vaux, vaux2 and vana2 supplies (rejected for the IMX386), and a bus-type that allows C-PHY, with data-lanes then counting trios. The IMX386's properties and requirements are unchanged. Assisted-by: LLM Signed-off-by: Nate Crawford <nate@kdegeek.com>
The Pixel 9 Pro Fold's main camera is a Sony IMX787. It reports model 0x0787 at 0x0016 and has the IMX386's CCS-style register map, so the mode, exposure and gain registers this driver writes apply unchanged; its initialisation and readout tables come from the data file, as the IMX386's do. Three things differ: - the module has eight supplies, powered in the order of Google's GPL zuma-comet-camera.dtsi (rear_main_camera_power_seq): the board's vbb and vbuck, then vif, the AF/OIS controller's vaux and vaux2, vana, vana2 and vdig. The AF/OIS and board supplies are optional; - its XCLR reset line is shared with that AF/OIS controller, so it is taken through the reset framework as a shared reset, not as a GPIO; - it sends over a three-trio MIPI CSI-2 C-PHY link. Make the supplies, chip ID, reset sharing and subdev name per variant (libcamera picks its sensor helper by name, so the IMX787 registers as imx787), and check the data file against the matched chip ID. Pass the matched variant's bus type to the endpoint parser: D-PHY for IMX386 and C-PHY for IMX787. The parser rejects an explicitly mismatched type. Without a data file, power up the IMX787, read and log its model ID, power it down and fail the probe. A board can check its wiring with no data file and without writing to the sensor. The IMX386 keeps its existing D-PHY parse and missing-data behavior. Tested on a Pixel 9 Pro Fold with a v7.3-rc6 based kernel: without a data file the sensor identifies as 0x0787 and the probe stops there; with one it streams 4000x3000 RAW10 over the C-PHY link into the CSIS receiver, and libcamera's simple pipeline gives correct images (the gain range is fixed in the next patch). The explicit endpoint type is part of this revision. Assisted-by: LLM Signed-off-by: Nate Crawford <nate@kdegeek.com>
The driver caps the analogue gain control at code 480, the IMX386's 16x under its 512 / (512 - code) curve, and every variant shares that cap. The IMX787 follows another curve. On a Pixel 9 Pro Fold, raw frames of a fixed scene at fixed exposure, with the black level of 64 subtracted (it matched a minimum-exposure frame), measure 1.14x, 1.29x, 1.53x, 1.67x and 1.86x at codes 120, 240, 360, 420 and 480. Codes written to 0x0204 past the control's limit read back as written and give 3.2x, 5.3x and 15.1x at 720, 840 and 960. That is 1024 / (1024 - code): the register holds 10 bits and 960 is 16x. Capped at 480, the main camera never got more than 1.88x and stayed dark indoors. Let a variant set its own maximum code, and give the IMX787 960. The data file's again_max still bounds the control, as before. Tested on a Pixel 9 Pro Fold with a v7.3-rc6 based kernel, a data file allowing 960 and libcamera's gain helper on the same curve: the control runs 0-960, auto exposure in a dim room settles at a real 15.75x instead of the 1.88x it was held to, and the mean of the same scene rose from 28/34/31 to 91/94/95 (B/G/R) without clipping. Assisted-by: LLM Signed-off-by: Nate Crawford <nate@kdegeek.com>
On the Pixel 9 Pro Fold's ultrawide (an AK73xx-family actuator at 0x0c, driven as ak7375), every power-up logged "ak7375_vcm_resume I2C failure: -6": the mode write that leaves standby is accepted, but the position write that follows at once is refused, so the actuator kept its reset position (0xfffc) instead of the control's value until userspace moved it again. Later position writes land exactly (a set of 300 reads back as 0x12c0). Wait one control step (ctrl_delay_us, 1 ms) between the mode write and the first position write for every ak7375. On a Pixel 7 Pro, both lenses logged the same position-loop error on a resume on November 15, 2026, with a kernel that already retries the standby mode write. Tested on a Pixel 9 Pro Fold with a v7.3-rc6 based kernel: three power cycles with no I2C error, and after each power-up the position registers hold the control's last value (0x0000, 0x0c80, 0x1900). Assisted-by: LLM Signed-off-by: Nate Crawford <nate@kdegeek.com>
2e37587 to
2884aa5
Compare
|
Derek, I reworded the standby patch to say the 1 ms wait applies to every ak7375. I included your November 15 Pixel 7 Pro observation: both lenses logged The variant now passes its bus type to the endpoint parser. IMX386 supplies D-PHY as it did before the series. IMX787 supplies C-PHY, so an explicit D-PHY endpoint is rejected by the parser. I moved Google's Comet camera DTS calls the ultrawide actuator CORNERFOLK at 0x0c. The bring-up notes identify it as Ak73Family and record AK7375-format position readback. I have no chip ID or part-number evidence that would justify a new compatible. I added the three streaming prerequisites to the description: the Comet camera DT, an IMX787 extractor case emitting 0x0787, and |
Summary
open_powersto the S5K3LU series where the sensor's runtime PM reference can be tested with the driver policy.Evidence
On earlier Comet integration kernels, IMX787 reported model
0x0787without a mode data file. With the data file it streamed 4000×3000 RAW10 on the three-trio C-PHY link into CSIS. Libcamera's simple pipeline gave upright images.Raw fixed-exposure frames followed the IMX787 gain curve
1024 / (1024 - code), reaching measured gains of 3.2×, 5.3× and 15.1× at codes 720, 840 and 960. The 960 cap let auto exposure in the dim test scene settle at 15.75×. Frame means rose from 28/34/31 to 91/94/95 (B/G/R) without clipping.Comet's ultrawide actuator refused the first position write after standby with
ak7375_vcm_resume I2C failure: -6. With the 1 ms wait, three power cycles finished without an I2C error and the saved positions read back as0x0000,0x0c80and0x1900. Derek saw the same position-loop message on both Pixel 7 Pro lenses at wake on November 15, with a kernel that already retries the mode write.Checks
The local v2 merges cleanly.
checkpatch --strict, W=1 builds ofimx386.candak7375.c, and the Sony binding check passed. The Comet, Tegu and Cheetah DT checks showed no new diagnostics. The Pixel 7 Pro still needs Derek's probe, capture, focus moves on both lenses and two sleep cycles before merge.Before IMX787 can stream from the published tree
imx787case totools/extract-camera-datathat writes chip ID0x0787. The published extractor writes0x0386for the IMX386 data format.CONFIG_RESET_GPIOin the config fragment for shared XCLR.The mode data is generated from the owner's factory image.
🤖 Generated with Claude Code