Repository navigation
Input: cs40l25-vibra: add the Pixel 6 Pro's CS40L25A haptics - #114
Conversation
|
Thanks for this. A CS40L25A driver from scratch is a big piece of work, and the plan's H0 to H5 trail made it easy to follow. I checked the boost against stock's Two things before merging:
Smaller ones, take them or leave them:
As on the other PRs, a |
|
Smoke report from the build that runs this: #112 (comment). Kconfig now selects |
04a4e71 to
86fd0f1
Compare
|
Pushed. All five points are in:
Gate ( tools/phone-smoke reportphone-smoke: unknownKernel
Packages: hyprland 0.56.2-7, libcamera 0.7.2-4, mesa 1:26.2.4-1.2, omacam 0.1.9-1, omamessages 0.2.0-1, omamobile-apps 0.2.0-1, omamobile-audio 0.4.4-1, omamobile-device-raven 0.1.23.6-1, omamobile-firstboot 0.1.0-1, omamobile-gnss 0.2.1-1, omamobile-keyring 20261013-1, omamobile-mirror 0.1.1-1, omamobile-mmd 0.1.2-1, omamobile-modem 0.1.9-1, omamobile-modem-sit 0.3.57-1, omamobile-omarchy 0.1.1-1, omamobile-owl-widgets 0.1.1-1, omamobile-sensors 0.2.0-1, omamobile-shell 0.2.21-1, omaphone 0.2.0-1, omarchy 4.0.4-2, omatel-agent 0.2.0-1, quickshell 0.3.2.r7.g2b4501a-1 |
|
Thanks for turning all five points around so quickly, and with a test boot. I checked each one against the new head:
One small gap in point 4 of my earlier list, the register reads: Also, the booted kernel ( After that I'll merge it, after the battery (#112) and torch (#113) PRs, with device-raven's haptics PR right after. |
The kernel side is derekross/linux-omarchy-mobile#114 (cs40l25-vibra, its binding and raven's node). This is the rest: - device/raven/kernel.config builds cs40l25-vibra as a module. - extract-vendor-firmware -d raven stages the CS40L25A's files from the owner's factory image: the CLAB RAM firmware and the default wavetable, which the driver loads, and the CLAB configuration (braking), not loaded yet. - device-raven's 72-omamobile-feedbackd.rules makes the motor a feedbackd vibra, as cheetah's CS40L26. The motor's input device appears only once its firmware has loaded, about 5 s into the boot, and feedbackd (D-Bus activated) only looks for it when it starts, so on a boot where something asked for feedback first there were no haptics until feedbackd was restarted. The motor's arrival now starts omamobile-feedbackd-rescan.service, which stops a running feedbackd; the next request starts it again with the motor. HAPTICS-TORCH-PLAN records H5 and the boot race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CS40L25A is the boosted haptic driver with a Halo Core DSP in the Pixel 6 Pro, controlled over I2C. Describe what cs40l25-vibra uses: its address, its active-low reset line, the boost converter's peak current and voltage limits (as the CS40L26 binding names them, with cs40l2x's ranges and defaults) and, for later, its interrupt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
The CS40L25A in the Pixel 6 Pro boots into a ROM basic mode. This driver resets it, hands it over from basic mode, applies the B0 errata and the board's boost (with its short test), loads the RAM firmware and the default wavetable through cs_dsp and exposes force feedback (FF_RUMBLE) through ff-memless: the strength sets the firmware's trigger gain, a start plays the continuous effect (index 0) through the trigger mailbox and a stop writes ENDPLAYBACK. The sequence follows Cirrus Logic's GPL cs40l2x driver in Google's Pixel 6 kernels. On raven the firmware idles at HALO_STATE 201 with global enable dropped, not the 203 cs40l2x expects, and plays from there. Themes ask for 7-12 ms button clicks, shorter than the actuator takes to build up, so a stop is held back to min_on_ms (30 ms); the strength maps onto -8 to -18 dB (atten_strongest tunes the top). Tested on raven: probes at boot from the DT, feedbackd drives it, and key presses tick. The boost's peak current and voltage come from the DT; the debugfs registers file stays out of the DSP's memories and core registers (precious), which cs_dsp and the driver still read directly. Not yet: the IRQ, hibernation, the braking configuration, calibration and the codec path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
Raven's haptic driver sits on hsi2c_8 at 0x43 with its reset on gpp24-0 (active low) and stock's boost limits (4.5 A, 7.5 V), as Google's gs101-raviole-audio.dtsi describes it; its interrupt (gpa6-5) isn't used yet. Tested on raven (as an overlay): cs40l25-vibra probes at boot and feedbackd drives it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: saiththerobo <the.tom.sharp@gmail.com>
86fd0f1 to
5deed60
Compare
|
Rebased onto The kernel booted for testing ( |
|
Thanks for the quick rebase and the one-liner. I checked the new head against my last comment:
The gate passes here too, and CI ran One note for later, nothing to do now: if this goes upstream, the |
…#113) * device-raven, tools: haptics through feedbackd on the CS40L25A The kernel side is derekross/linux-omarchy-mobile#114 (cs40l25-vibra, its binding and raven's node). This is the rest: - device/raven/kernel.config builds cs40l25-vibra as a module. - extract-vendor-firmware -d raven stages the CS40L25A's files from the owner's factory image: the CLAB RAM firmware and the default wavetable, which the driver loads, and the CLAB configuration (braking), not loaded yet. - device-raven's 72-omamobile-feedbackd.rules makes the motor a feedbackd vibra, as cheetah's CS40L26. The motor's input device appears only once its firmware has loaded, about 5 s into the boot, and feedbackd (D-Bus activated) only looks for it when it starts, so on a boot where something asked for feedback first there were no haptics until feedbackd was restarted. The motor's arrival now starts omamobile-feedbackd-rescan.service, which stops a running feedbackd; the next request starts it again with the motor. HAPTICS-TORCH-PLAN records H5 and the boot race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * device-raven 0.1.27: the haptics version bump Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Derek Ross <derekross@gmail.com>
…derekross#113) * device-raven, tools: haptics through feedbackd on the CS40L25A The kernel side is derekross/linux-omarchy-mobile#114 (cs40l25-vibra, its binding and raven's node). This is the rest: - device/raven/kernel.config builds cs40l25-vibra as a module. - extract-vendor-firmware -d raven stages the CS40L25A's files from the owner's factory image: the CLAB RAM firmware and the default wavetable, which the driver loads, and the CLAB configuration (braking), not loaded yet. - device-raven's 72-omamobile-feedbackd.rules makes the motor a feedbackd vibra, as cheetah's CS40L26. The motor's input device appears only once its firmware has loaded, about 5 s into the boot, and feedbackd (D-Bus activated) only looks for it when it starts, so on a boot where something asked for feedback first there were no haptics until feedbackd was restarted. The motor's arrival now starts omamobile-feedbackd-rescan.service, which stops a running feedbackd; the next request starts it again with the motor. HAPTICS-TORCH-PLAN records H5 and the boot race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * device-raven 0.1.27: the haptics version bump Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Derek Ross <derekross@gmail.com>
The Pixel 6 Pro's haptics are a Cirrus Logic CS40L25A, an older part than the Pixel 7 Pro's CS40L26, with no mainline driver. This adds one, a binding and raven's node.
cs_dsp.FF_RUMBLEthrough ff-memless. The strength sets the firmware's trigger gain (−8 to −18 dB), a start plays the continuous effect through the trigger mailbox, and a stop writes ENDPLAYBACK. Themes ask for 7–12 ms clicks, shorter than the actuator needs to build up, so a stop is held back to 30 ms.cs40l2xdriver in Google's Pixel 6 kernels. On raven the firmware idles at HALO_STATE 201, not the 203cs40l2xexpects, and plays from there.hsi2c_8at 0x43, reset on gpp24-0, as stock'sgs101-raviole-audio.dtsi.The firmware is Google's (
cs40l25a_clab.wmfw,cs40l20.bin), from the owner's factory image (tools/extract-vendor-firmware -d raven), not in linux-firmware.Not yet: the IRQ, hibernation, braking, calibration, the codec path, and the boost from the DT.
Tested on raven (7.3.0-rc6): it probes at boot from the DT, and feedbackd drives it: key presses and notifications tick.
tools/kernel-pr-checkpasses with--build(W=1build clean); the binding passesdt-doc-validate, anddt-validatereports nothing new. Of the 8 checkpatch warnings, 6 are theCo-Authored-By:trailer, as in #8, and 2 ask about MAINTAINERS, which cs40l26-vibra doesn't have either.🤖 Generated with Claude Code