Skip to content

Commit 3d521f9

Browse files
Shenghao-Dingbroonie
authored andcommitted
ASoC: tas2781: fixed register access error when switching to other chips
fixed register access error when switching to other tas2781 -- refresh the page inside regmap on the switched tas2781 Signed-off-by: Shenghao Ding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2d218b4 commit 3d521f9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

sound/soc/codecs/tas2781-comlib.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,17 @@ static int tasdevice_change_chn_book(struct tasdevice_priv *tas_priv,
5757

5858
if (client->addr != tasdev->dev_addr) {
5959
client->addr = tasdev->dev_addr;
60-
if (tasdev->cur_book == book) {
61-
ret = regmap_write(map,
62-
TASDEVICE_PAGE_SELECT, 0);
63-
if (ret < 0) {
64-
dev_err(tas_priv->dev, "%s, E=%d\n",
65-
__func__, ret);
66-
goto out;
67-
}
60+
/* All tas2781s share the same regmap, clear the page
61+
* inside regmap once switching to another tas2781.
62+
* Register 0 at any pages and any books inside tas2781
63+
* is the same one for page-switching.
64+
*/
65+
ret = regmap_write(map, TASDEVICE_PAGE_SELECT, 0);
66+
if (ret < 0) {
67+
dev_err(tas_priv->dev, "%s, E=%d\n",
68+
__func__, ret);
69+
goto out;
6870
}
69-
goto out;
7071
}
7172

7273
if (tasdev->cur_book != book) {

0 commit comments

Comments
 (0)