]> git.hungrycats.org Git - linux/commitdiff
ASoC: tas2552: sort the register default table
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 5 Aug 2026 10:41:46 +0000 (13:41 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 7 Aug 2026 14:51:39 +0000 (15:51 +0100)
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").

TAS2552_OUTPUT_DATA (0x07), TAS2552_PDM_CFG (0x11), TAS2552_PGA_GAIN
(0x12) and TAS2552_BOOST_APT_CTRL (0x14) are listed before
TAS2552_RESERVED_0D (0x0d), TAS2552_LIMIT_RATE_HYS (0x0e) and
TAS2552_CFG_2 (0x02), which leaves 7 of the 21 entries unreachable.
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.

Fixes: 5df7f71d5cdf ("ASoC: tas2552: Support TI TAS2552 Amplifier")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20260805104149.9795-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tas2552.c

index 1a7650b9b2a7bb33014995a2fd542eddae5f4fad..ea083d1cec2b42481c94854b6bcc2a8ce157453d 100644 (file)
 
 static const struct reg_default tas2552_reg_defs[] = {
        {TAS2552_CFG_1, 0x22},
+       {TAS2552_CFG_2, 0xef},
        {TAS2552_CFG_3, 0x80},
        {TAS2552_DOUT, 0x00},
-       {TAS2552_OUTPUT_DATA, 0xc0},
-       {TAS2552_PDM_CFG, 0x01},
-       {TAS2552_PGA_GAIN, 0x00},
-       {TAS2552_BOOST_APT_CTRL, 0x0f},
-       {TAS2552_RESERVED_0D, 0xbe},
-       {TAS2552_LIMIT_RATE_HYS, 0x08},
-       {TAS2552_CFG_2, 0xef},
        {TAS2552_SER_CTRL_1, 0x00},
        {TAS2552_SER_CTRL_2, 0x00},
+       {TAS2552_OUTPUT_DATA, 0xc0},
        {TAS2552_PLL_CTRL_1, 0x10},
        {TAS2552_PLL_CTRL_2, 0x00},
        {TAS2552_PLL_CTRL_3, 0x00},
        {TAS2552_BTIP, 0x8f},
        {TAS2552_BTS_CTRL, 0x80},
+       {TAS2552_RESERVED_0D, 0xbe},
+       {TAS2552_LIMIT_RATE_HYS, 0x08},
        {TAS2552_LIMIT_RELEASE, 0x04},
        {TAS2552_LIMIT_INT_COUNT, 0x00},
+       {TAS2552_PDM_CFG, 0x01},
+       {TAS2552_PGA_GAIN, 0x00},
        {TAS2552_EDGE_RATE_CTRL, 0x40},
+       {TAS2552_BOOST_APT_CTRL, 0x0f},
        {TAS2552_VBAT_DATA, 0x00},
 };