Commit b50a9997 authored by Lucas Tanure's avatar Lucas Tanure Committed by Takashi Iwai

ALSA: hda: cs35l41: Reorganize log for playback actions

For each case, only log the last regmap access, so it doesn't get
overwritten, and as all regmap access should show the same issues
logging the last one should be enough.
Change to dev_err to log this error.

Also, differentiate between a regmap access failure and invalid
playback action.
Signed-off-by: default avatarLucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220413083728.10730-13-tanureal@opensource.cirrus.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent fabcf7f1
...@@ -144,10 +144,9 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action) ...@@ -144,10 +144,9 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action)
switch (action) { switch (action) {
case HDA_GEN_PCM_ACT_OPEN: case HDA_GEN_PCM_ACT_OPEN:
ret = regmap_multi_reg_write(reg, cs35l41_hda_config, regmap_multi_reg_write(reg, cs35l41_hda_config, ARRAY_SIZE(cs35l41_hda_config));
ARRAY_SIZE(cs35l41_hda_config)); ret = regmap_update_bits(reg, CS35L41_PWR_CTRL2,
regmap_update_bits(reg, CS35L41_PWR_CTRL2, CS35L41_AMP_EN_MASK, 1 << CS35L41_AMP_EN_SHIFT);
CS35L41_AMP_EN_MASK, 1 << CS35L41_AMP_EN_SHIFT);
break; break;
case HDA_GEN_PCM_ACT_PREPARE: case HDA_GEN_PCM_ACT_PREPARE:
ret = cs35l41_hda_global_enable(cs35l41, 1); ret = cs35l41_hda_global_enable(cs35l41, 1);
...@@ -157,16 +156,16 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action) ...@@ -157,16 +156,16 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action)
ret = cs35l41_hda_global_enable(cs35l41, 0); ret = cs35l41_hda_global_enable(cs35l41, 0);
break; break;
case HDA_GEN_PCM_ACT_CLOSE: case HDA_GEN_PCM_ACT_CLOSE:
regmap_update_bits(reg, CS35L41_PWR_CTRL2, ret = regmap_update_bits(reg, CS35L41_PWR_CTRL2,
CS35L41_AMP_EN_MASK, 0 << CS35L41_AMP_EN_SHIFT); CS35L41_AMP_EN_MASK, 0 << CS35L41_AMP_EN_SHIFT);
break; break;
default: default:
ret = -EINVAL; dev_warn(cs35l41->dev, "Playback action not supported: %d\n", action);
break; break;
} }
if (ret) if (ret)
dev_warn(cs35l41->dev, "Failed to apply multi reg write: %d\n", ret); dev_err(cs35l41->dev, "Regmap access fail: %d\n", ret);
} }
static int cs35l41_hda_channel_map(struct device *dev, unsigned int tx_num, unsigned int *tx_slot, static int cs35l41_hda_channel_map(struct device *dev, unsigned int tx_num, unsigned int *tx_slot,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment