Files
kernel-agent/patches/board/coolpi-cm5-genbook/0004-arm64-dts-rockchip-rk3588-coolpi-cm5-genbook-Enable-speaker-output-via-audio-graph-card.patch
claude-noether a6549605f0 phase 2 ask #1: bootstrap ampere kernel-agent recipe (CoolPi GenBook RK3588)
Brings the second customized fleet host into kernel-agent's
scope-tagged tree. Sibling PR coming in marfrit-packages with the
arch/linux-ampere-fourier/ PKGBUILD + flat patch + config + extlinux
hook (build-tree-ready form).

Issue #6 ask #1 only — VP9 enablement (ask #2) and AV1 dec integration
(ask #3) are explicitly deferred to a separate session per the user's
direction. The ampere.yaml manifest documents what's excluded and why.

## Patches promoted

Six patches from boltzmann:~/src/misc_patches/genbook/kernel/ get
scope-tagged into kernel-agent's tree:

  soc/rockchip/rk3588/
    0001-...Add-pwm15-pinctrl-entries.patch         (prereq for 0002)
  module/coolpi-cm5/
    0003-...Fix-power-off-by-enabling-RK806-as-system-power-controller.patch
  board/coolpi-cm5-genbook/
    0002-...Add-pwm-fan.patch
    0004-...Enable-speaker-output-via-audio-graph-card.patch
    0005-...Enable-USB-C-PD-charging-via-FUSB302.patch
    0008-...Add-lid-switch-and-USB3-PHY-lane-config.patch

Each new scope dir gets a README.md documenting what it carries and
why the scope-level granularity makes sense (pwm15 is SoC-wide,
RK806 power-off is SoM-level not board-level, the rest are
board-specific GenBook quirks).

Note on uncommitted-modifications flag in issue body: patches 0001-0004
have working-tree-only changes in misc_patches that fix malformed
'From: PATCH 000X/000Y' headers (placeholder text instead of an
RFC-2822 author identity). The working-tree versions with proper
'From: Markus Fritsche <mfritsche@localhost>' headers are what we ship
here — the unfixed-on-disk variants would fail patch -i header parsing
on stricter implementations and are user-side cleanup that hasn't been
committed back to misc_patches yet. Markus can commit the cleanup
to that personal repo separately; this PR's ingestion does not depend
on it.

Patches 0006 (HAVE_GCC_PLUGINS Kconfig), 0009 (Bluetooth btrtl),
0010 (multi-driver suspend/wakeup) from the misc_patches series are
intentionally NOT promoted here — they need different scope tags
(arch/arm64/, driver/bluetooth/, soc/rockchip/rk3588/ + driver/ split)
and will follow when their respective campaigns demand them. The
ampere.yaml manifest documents the explicit-defer for each.

## fleet/ampere.yaml manifest

Same shape as fleet/fresnel.yaml. Baseline pinned at marfrit/linux-rockchip
branch linux-rk3588-marfrit @ f8f3ad934433 (the working tree on
boltzmann; 18 commits ahead of v7.0-rc3, current 2026-05-15 tip).
Six scope-tagged patch includes per the apply-order in the package
(pwm15 pinctrl must precede the pwm-fan node consumer).

## ampere-specific bootloader path

Documented in manifest. ampere boots from /boot/firmware/ (vfat
partition on mmcblk0p1), not /boot/ (root partition) like fresnel.
The marfrit-packages PKGBUILD's extlinux-add hook needs to write to
/boot/firmware/extlinux/extlinux.conf, not /boot/extlinux/.

## ampere as 2nd aarch64 build host

Per the README update in PR #7, ampere is now a secondary aarch64
build host. The manifest's build_host: section pins ampere as
self-hosting primary for its own kernel, with boltzmann as secondary
and fermi as fallback. This is the first manifest that has its own
host listed as the primary build target — not ideologically pretty,
but pragmatic: native arch, same uarch, full RAM, no cross-compile
step, no need to wake another host.
2026-05-15 16:03:00 +00:00

105 lines
3.8 KiB
Diff

From: Markus Fritsche <mfritsche@localhost>
Subject: [PATCH 4/4] arm64: dts: rockchip: rk3588-coolpi-cm5-genbook: enable speaker output
The GenBook carrier board routes the ES8316 HPOL/HPOR outputs to both a
headphone jack and an external speaker amplifier. The amplifier is
enabled by GPIO1_A6 (active-high) and headphone insertion is detected by
GPIO1_B5 (active-high, pull-up).
Add a label to the shared analog-sound node in the CM5 DTSI so the
GenBook DTS can extend it, then override the node to:
- add pa-gpios for the speaker amplifier enable line (GPIO1_A6)
- add hp-det-gpios for headphone jack detection (GPIO1_B5)
- extend widgets/routing to include the Speaker path through the
audio-graph-card built-in "Amplifier" DAPM output-driver widget,
which gates the pa-gpios GPIO on widget power-up/down
- add the hp-det pinctrl group for GPIO1_B5
The "Amplifier" DAPM widget (snd_soc_dapm_out_drv) is provided by
audio-graph-card.c and registered at card level. Its event handler
drives pa-gpios high on SND_SOC_DAPM_POST_PMU and low on
SND_SOC_DAPM_PRE_PMD, giving automatic speaker enable/disable in step
with DAPM power management.
DAPM path for speaker output:
ES8316 AIF1RX (DAI) -> Left/Right DAC -> Left/Right Headphone Mixer
-> Left/Right Headphone Driver -> HPOL/HPOR [codec OUTPUT pins]
-> Amplifier [card OUT_DRV, fires pa-gpios] -> Speaker [SPK terminal]
The Left/Right Headphone Mixer Left/Right DAC Switch controls, which
gate the DAC-to-mixer connections in the DAPM graph, are set on by the
UCM BootSequence in the rk3588-es8316 ALSA UCM profile and must remain
enabled for the path to be traversable.
The HPOL/HPOR codec output pins also feed the Headphones HP widget:
HPOL/HPOR -> Headphones [HP terminal, jack-controlled via hp-det-gpios]
Both the Speaker and Headphones paths are active whenever a PCM stream
is running. Speaker-muting when headphones are inserted is handled at
the userspace (UCM) level via JackHWMute on the Speaker UCM device: when
PipeWire routes audio away from the Speaker sink on headphone insertion,
the absence of an active PCM consumer causes DAPM to power down the
Amplifier widget and drive GPIO1_A6 low.
Note: full speaker output also requires a Speaker SectionDevice in the
rk3588-es8316 ALSA UCM HiFi.conf. Without it the HiFi profile's only
playback port is Headphones (jack-controlled), causing the profile to be
reported as "not available" when no headphones are inserted, and
PipeWire falls back to the pro-audio profile with no speaker sub-device.
A separate patch to alsa-ucm-conf adds the missing Speaker device.
Generated-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Markus Fritsche <mfritsche@reauktion.de>
---
2 files changed, 25 insertions(+), 1 deletion(-)
--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5-genbook.dts
@@ -283,7 +283,31 @@
status = "okay";
};
+&analog_sound {
+ pa-gpios = <&gpio1 RK_PA6 GPIO_ACTIVE_HIGH>;
+ hp-det-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&hp_det>;
+
+ widgets = "Microphone", "Mic Jack",
+ "Headphone", "Headphones",
+ "Speaker", "Speaker";
+
+ routing = "MIC2", "Mic Jack",
+ "Headphones", "HPOL",
+ "Headphones", "HPOR",
+ "Amplifier", "HPOL",
+ "Amplifier", "HPOR",
+ "Speaker", "Amplifier";
+};
+
&pinctrl {
+ headphone {
+ hp_det: hp-det {
+ rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
lcd {
lcdpwr_en: lcdpwr-en {
rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
--- a/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-coolpi-cm5.dtsi
@@ -21,7 +21,7 @@
serial2 = &uart2;
};
- analog-sound {
+ analog_sound: analog-sound {
compatible = "audio-graph-card";
dais = <&i2s0_8ch_p0>;
label = "rk3588-es8316";