Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: hda/tas2781: Fix incorrect bit update for non-book-zero or book 0 pages >1

In TAS2781 SPI mode, when accessing non-book-zero or page numbers greater
than 1 in book 0, an additional byte must be read. The first byte in such
cases is a dummy byte and should be ignored.

Fixes: 9fa6a693ad8d ("ALSA: hda/tas2781: Remove tas2781_spi_fwlib.c and leverage SND_SOC_TAS2781_FMWLIB")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20260429054206.429-1-shenghao-ding@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Shenghao Ding and committed by
Takashi Iwai
e052a1f7 90df4957

+11 -3
+11 -3
sound/hda/codecs/side-codecs/tas2781_hda_spi.c
··· 132 132 int ret, val; 133 133 134 134 /* 135 - * In our TAS2781 SPI mode, read/write was masked in last bit of 136 - * address, it cause regmap_update_bits() not work as expected. 135 + * In TAS2781 SPI mode, when accessing non-book-zero or page numbers 136 + * greater than 1 in book 0, an additional byte must be read. The 137 + * first byte in such cases is a dummy byte and should be ignored. 137 138 */ 138 - ret = tasdevice_dev_read(tas_priv, chn, reg, &val); 139 + if ((TASDEVICE_BOOK_ID(reg) > 0) || (TASDEVICE_PAGE_ID(reg) > 1)) { 140 + unsigned char buf[2]; 141 + 142 + ret = tasdevice_dev_bulk_read(tas_priv, chn, reg, buf, 2); 143 + val = buf[1]; 144 + } else { 145 + ret = tasdevice_dev_read(tas_priv, chn, reg, &val); 146 + } 139 147 if (ret < 0) { 140 148 dev_err(tas_priv->dev, "%s, E=%d\n", __func__, ret); 141 149 return ret;