Re: [PATCH 2/3] ASoC: cs35l45: sort the register default table

Richard Fitzgerald <[email protected]> Wed, 5 Aug 2026 12:35:34 +0100
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.stable
Message-ID <[email protected]>
On 05/08/2026 9:24 am, Peter Ujfalusi wrote:
> reg_defaults must be sorted by ascending register address, as
> regcache_lookup_reg() locates entries in it with bsearch().  See commit
> fd80df352ba1 ("regcache: Add support for sorting defaults arrays").
> 
> cs35l45_defaults[] lists the DSP1_RX*_RATE and DSP1_TX*_RATE registers
> (0x02b80080 - 0x02b802b8) in the middle of the table, ahead of entries with
> much lower addresses, so the binary search does not find 36 of its 73
> entries.  regcache_reg_needs_sync() then cannot compare those against their
> default and reports that a sync is needed, so they are written to the
> device on every regcache_sync() even when they were never touched.
> 
> Sort the table by register address.

Reviewed-by: Richard Fitzgerald <[email protected]>