Skip to content

libcamera 0.7.2-4.23, kernel config: the Pixel 9a's main camera autofocus - #494

Merged
derekross merged 2 commits into
derekross:mainfrom
den-kloot:tegu-main-autofocus
Nov 8, 2026
Merged

derekross merged 2 commits into
derekross:mainfrom
den-kloot:tegu-main-autofocus

Conversation

@den-kloot

Copy link
Copy Markdown
Contributor

What and why

The Pixel 9a's main camera gets contrast autofocus, as the Pixel 7 Pro has (announced in #28). Its focus runs through an onsemi LC898129, and the lens driver for it is linux-omarchy-mobile#213. This PR is the repo side:

  • kernel/configs/omamobile.config: CONFIG_VIDEO_LC898129=m, next to the SEM1215SA.
  • libcamera 0.7.2-4.23, new patch 0057: Af in the S5KGN8 tuning file (coarse 8, fine 32, as on the 7 Pro's main camera), and the old "no autofocus until the lens has a driver" comment removed. README row added.
  • device/tegu/NOTES.md: what I measured on the phone. That covers the controller and its focus registers, the 12-bit target and its Hall read-back, which end is near, and the lens node the board needs.
  • docs/DEVICES.md: the autofocus in the 9a's Cameras cell, "in review" with the kernel PR, and noting that the far end is not checked yet.

The board's lens node (4 lines in zumapro-tegu.dts) isn't in either PR. It depends on the camera device tree in linux-omarchy-mobile#164 and is written out in the notes and in #213.

Device and build

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes
  • tests/packages passes (or the packages I touched: libcamera has no test/all)
  • Each changed package has its version bumped, and the new version is in the commit subject
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone, booted into this build
  • Runbook steps passed: the lens follows focus_absolute 0-4095 (Hall read-back); omacam's autofocus settles on a subject at about 25 cm in a little over a second; a full-size photo (3000x3992) is sharp
  • What I did not test: I didn't build or install the libcamera 0.7.2-4.23 package. The phone runs 4.22, with the same Af lines added by hand to its installed s5kgn8.yaml, which is exactly what 0057 changes. I also haven't checked the far end on a distant scene, the ultrawide or front cameras (no change), or continuous AF over a long session.
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1). The driver writes only the focus target register, from the kernel.
tools/phone-smoke report
Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-gd00d9fd2272f, slot b, up 4037s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 95G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg (0 known, 0 new)
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card1-DSI-1 connected, 1080x2424
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link up
Bluetooth ok hci0, powered true
battery ok 92% Full, 30 °C
sound cards skip none
sensors skip no sensor proxy
cameras skip no libcamera tools
thermal ok hottest zone 42 °C

Packages: hyprland 0.57.0-3.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.2-1, omamobile-device-tegu 0.2.9-1, omamobile-firstboot 0.1.3-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 0.1.32-1, omamobile-owl-widgets 0.1.2-1, omamobile-shell 0.2.100-1, omamobile-voice 0.1.0-1, omaphone 0.2.3-1, omarchy 4.0.6-1, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

(sound cards, sensors and cameras skip on this phone: no audio/AoC setup on this install, and no libcamera tools installed.)

The changes were written with an AI assistant (Claude). I tested them on my phone.

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thanks for this, and for being so clear in the description about what you
ran and what you didn't. I checked the parts I can check here: the new
patch's sha512 and b2 sums match, 0057 applies on top of 0056 with no fuzz
and gives exactly the Af lines you describe, and the kernel config change
adds CONFIG_VIDEO_LC898129=m and nothing else. It also leaves the Pixel 7
Pro's cameras alone: only s5kgn8.yaml changes, and the tuning file is
picked by the sensor model, which is S5KGN8 only on the 9a. And on a 9a
whose kernel has no lens yet, the autofocus finds no focus control and
stays off, so this is safe to ship before the node lands. CI is waiting for
my approval; I'll start it.

Two changes to the record, please:

One small addition I'd like in the notes as well: since stock puts the
module's calibration EEPROM at the same address as the LC898129, a line
saying which registers you wrote while working out the protocol (only the
focus target, I assume).

This merges after linux-omarchy-mobile#213, since the config line names
its symbol. The 9a row in DEVICES.md is also edited by a few older open PRs,
so whichever lands second will need that one line rebased; I'll take care
of it if it's this one.

…ocus

The 9a's main camera focuses through an onsemi LC898129, which now has
a lens driver (linux-omarchy-mobile#213). Build it as a module next to
the 7 Pro's SEM1215SA (CONFIG_VIDEO_LC898129=m), and turn on contrast
autofocus in the S5KGN8 tuning file (libcamera 0057), with the coarse
and fine steps of the 7 Pro's main camera.

device/tegu/NOTES.md records where the register map came from, which
registers were written while working it out (only the focus target),
and what was measured on the phone: the controller's registers, the
12-bit focus target and its Hall read-back, which end is near, and
omacam focusing on a subject at about 25 cm, on libcamera 4.22 with the
Af lines added by hand. DEVICES.md adds the autofocus to the 9a's camera
cell, in review with the kernel PR, and says the far end isn't checked
yet.

The board's lens node is in the notes; it waits for the 9a's camera
device tree (linux-omarchy-mobile#164) and isn't in a pull request yet,
as the camera cell says.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@den-kloot
den-kloot force-pushed the tegu-main-autofocus branch from b70c56f to dbc650a Compare November 8, 2026 07:04
@den-kloot

Copy link
Copy Markdown
Contributor Author

Thanks, and for checking the sums and the tuning file. Force-pushed (one commit, amended):

  • DEVICES.md: the Cameras cell now says the autofocus also needs a lens node on top of kernel device/tegu FINGERPRINT-PLAN: the LDO15S rule names SLEEP-PLAN S2's one exception #164, which isn't in a pull request yet.
  • NOTES, what ran: the omacam entry says the phone ran libcamera 0.7.2-4.22 with the Af lines added by hand, the same lines 4.23's 0057 adds.
  • NOTES, what was written: a new bullet. Only 0xf01a was written, always with 0x0002 in the upper half and lower halves from 0 to 32000, and the bullet lists every register that was only read. Finding the address took only read probes, and the calibration EEPROM was never written. Another bullet says where the register map came from (Google's camera HAL, disassembled, no code copied), as in the kernel commit.
  • NOTES, re-test: a 2026-11-08 line records the re-test of the driver as reviewed in linux-omarchy-mobile#213 (new supply names, lc898129.c blob 50cce3a5f4c0).

tools/pr-check origin/main is all ok, and the branch merges cleanly onto today's main.

@derekross

Copy link
Copy Markdown
Owner

Thanks, all three are done, and the list of every register you read and
wrote is more than I asked for. That's the record I want for a part that
shares its address with the module's calibration EEPROM. The notes now say
what actually ran (4.22 with the lines by hand), and the Cameras cell says
the lens node is still to come. I also checked that the lc898129.c blob in
your 11-08 re-test is linux-omarchy-mobile#213's head.

The re-push only touches the notes and DEVICES.md, so my earlier checks of
the package (the sums, 0057 applying with no fuzz, the one-line config
change) still hold.

Since yesterday another PR rewrote the Pixel 8 Pro row, the line just below
the 9a's, so GitHub now shows a conflict in DEVICES.md. It's only the
neighbouring line, and as promised I'll resolve it at merge, keeping your 9a
row as it is. If your zram PR (#515) lands first, I'll put both new sections
at the top of the 9a notes, newest first. This merges right after
linux-omarchy-mobile#213.

# Conflicts:
#	device/tegu/NOTES.md
#	docs/DEVICES.md
@derekross
derekross merged commit a997209 into derekross:main Nov 8, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…ocus (derekross#494)

The 9a's main camera focuses through an onsemi LC898129, which now has
a lens driver (linux-omarchy-mobile#213). Build it as a module next to
the 7 Pro's SEM1215SA (CONFIG_VIDEO_LC898129=m), and turn on contrast
autofocus in the S5KGN8 tuning file (libcamera 0057), with the coarse
and fine steps of the 7 Pro's main camera.

device/tegu/NOTES.md records where the register map came from, which
registers were written while working it out (only the focus target),
and what was measured on the phone: the controller's registers, the
12-bit focus target and its Hall read-back, which end is near, and
omacam focusing on a subject at about 25 cm, on libcamera 4.22 with the
Af lines added by hand. DEVICES.md adds the autofocus to the 9a's camera
cell, in review with the kernel PR, and says the far end isn't checked
yet.

The board's lens node is in the notes; it waits for the 9a's camera
device tree (linux-omarchy-mobile#164) and isn't in a pull request yet,
as the camera cell says.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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.

2 participants