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 <shenghao-ding@ti.com>
Link: https://lore.kernel.org/r/20230817093257.951-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Shenghao Ding 2023-08-17 17:32:56 +08:00 committed by Mark Brown
parent 2d218b4584
commit 3d521f9f36
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -57,16 +57,17 @@ static int tasdevice_change_chn_book(struct tasdevice_priv *tas_priv,
if (client->addr != tasdev->dev_addr) {
client->addr = tasdev->dev_addr;
if (tasdev->cur_book == book) {
ret = regmap_write(map,
TASDEVICE_PAGE_SELECT, 0);
if (ret < 0) {
dev_err(tas_priv->dev, "%s, E=%d\n",
__func__, ret);
goto out;
}
/* All tas2781s share the same regmap, clear the page
* inside regmap once switching to another tas2781.
* Register 0 at any pages and any books inside tas2781
* is the same one for page-switching.
*/
ret = regmap_write(map, TASDEVICE_PAGE_SELECT, 0);
if (ret < 0) {
dev_err(tas_priv->dev, "%s, E=%d\n",
__func__, ret);
goto out;
}
goto out;
}
if (tasdev->cur_book != book) {