Unverified Commit 3d521f9f authored by Shenghao Ding's avatar Shenghao Ding Committed by Mark Brown
Browse files

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: default avatarShenghao Ding <shenghao-ding@ti.com>
Link: https://lore.kernel.org/r/20230817093257.951-1-shenghao-ding@ti.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2d218b45
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -57,17 +57,18 @@ 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);
			/* 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) {
			ret = regmap_write(map, TASDEVICE_BOOKCTL_REG, book);