Skip to content

pinctrl: apple, ASoC: cs42l84: two small fixes (read back only declared pins, honour the platform volume limit) - #378

Merged
RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/pinctrl-cs42l84
Oct 23, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/pinctrl-cs42l84

Conversation

@jgoyvaerts

Copy link
Copy Markdown
Contributor

Two small, independent fixes found while bringing up the MacBook Pro J616s (M4 Pro). Neither needs T6040 support.

  • pinctrl: apple: size the regmap cache from apple,npins, so probe reads back only the registers of real pins (a 61-pin bank no longer reads 451 registers that belong to no pin, at boot, since the driver is built in).
  • ASoC: cs42l84: refuse DAC volume writes above the platform limit set with snd_soc_limit_volume(), as snd_soc_put_volsw() does; until now a write above the ceiling still reached the codec, up to +12 dB.

Hardware tested on: Apple MacBook Pro (16-inch, M4 Pro, 2024), J616s / T6040, booted by our own loader with our private T6040 device tree. Both run in our daily kernel: the pinctrl change on every boot, the cs42l84 limit on the J616s headphone jack (capped at -6 dB).

Not tested / limits: no other Mac was tested.

Base: integration/aurora (6210b28, Linux 7.3). Built and checked there (W=1 on both touched objects, checkpatch --strict clean). Hardware testing was done on our daily tree (aurora-wip, Linux 7.1.12), which runs this code.

🤖 Generated with Claude Code

The flat register cache is filled at probe by reading the block back,
and the regmap configuration sizes it for 512 pins whatever the bank
has. A bank with fewer pins, such as the 61-pin always-on bank of the
T6040, then has 451 registers read that belong to no pin, during kernel
boot since the driver is built in.

Size the cache from apple,npins instead: max_register is the last pin's
register and only those registers are read back. The driver never
accesses a pin register beyond npins through the regmap, and the
interrupt registers are accessed directly, so nothing else changes.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
The DAC volume has its own put handler, which checks a write against
the control's register range only. A machine driver's
snd_soc_limit_volume() ceiling (platform_max) narrows the range that
the info callback reports, but a write above it still reaches the
codec, up to its +12 dB.

Refuse values above platform_max, as snd_soc_put_volsw() does through
soc_mixer_valid_ctl(). Nothing changes without a limit.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
@joshuaswarren

joshuaswarren commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

GREEN on eaefdaa

Review at exact head ef448d3, branch wAK/mv378-avd-slice, one commit on integration/aurora dcce0e7.

wAK's four points, checked against the diff:

  • min_t(MAX_SLICES) removal covered by the macroblock bound in both call paths: realloc_slices and slice_fits both call avd_h264_max_slices(pix, sps) with the negotiated pix; no path retains the 4096 clamp. MAX_SLICES define deleted.
  • Coded-data floor cannot under-allocate for interlaced: budget is max(2x decoded, slices*PAGE_SIZE) where slices doubles for non-FRAME_MBS_ONLY (both fields). Interlaced 1920x1088 gives 16320-bound coverage per the body; the floor grows with the field count, never below it.
  • KUnit cases match the new bounds: 8159-of-8160 fits, 8160 rejected, page-budget floor cases track 8159/8160*PAGE_SIZE, SPS-256-vs-negotiated-64 case rejects at the 17th slice (16-macroblock bound). The old AVD_TEST_MAX_SLICES constant is gone.
  • Body makes no claim the diff does not carry: draft state, never-booted-here, overlap (media: apple: avd: match the macOS H.264/HEVC slice and scaling commands #1116/media: apple: avd: apply request controls the capture buffers fit #1511 untouched bounds, 4096 clamp gone) stated; pinned-memory growth disclosed (16→32 MiB 4K pages, 64→127.5 MiB 16K pages).

One file trio only (avd-h264.c, avd.h prototype, KUnit). No findings.

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.

3 participants