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

Richard Fitzgerald <[email protected]>
Newsgroups org.kernel.vger.stable,org.kernel.vger.linux-sound
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").
> 
> cs4265_reg_defaults[] lists CS4265_INT_MASK (0x0e),
> CS4265_STATUS_MODE_MSB (0x0f) and CS4265_STATUS_MODE_LSB (0x10) after
> CS4265_SPDIF_CTL1 (0x11) and CS4265_SPDIF_CTL2 (0x12), so the binary search
> does not find those three entries.  regcache_reg_needs_sync() then cannot
> compare them 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]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.