Commit 879142be authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Mark Brown

ASoC: codecs: tas5720: split a tas5720_mute_soc_component() function

This is to be re-used in tas5720_mute() (which is part of the dai_ops) and
also in the tas5720_fault_check_work() hook.

The benefit here isn't too great (now).
It's only when we add support for a new device with a slightly different
regmap that this becomes more useful.
Signed-off-by: default avatarAlexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230128082744.41849-1-alex@shruggie.roSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 21d64f6f
...@@ -199,9 +199,8 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai, ...@@ -199,9 +199,8 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai,
return ret; return ret;
} }
static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction) static int tas5720_mute_soc_component(struct snd_soc_component *component, int mute)
{ {
struct snd_soc_component *component = dai->component;
int ret; int ret;
ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG, ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG,
...@@ -214,6 +213,11 @@ static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction) ...@@ -214,6 +213,11 @@ static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction)
return 0; return 0;
} }
static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction)
{
return tas5720_mute_soc_component(dai->component, mute);
}
static void tas5720_fault_check_work(struct work_struct *work) static void tas5720_fault_check_work(struct work_struct *work)
{ {
struct tas5720_data *tas5720 = container_of(work, struct tas5720_data, struct tas5720_data *tas5720 = container_of(work, struct tas5720_data,
...@@ -318,8 +322,7 @@ static int tas5720_codec_probe(struct snd_soc_component *component) ...@@ -318,8 +322,7 @@ static int tas5720_codec_probe(struct snd_soc_component *component)
expected_device_id, device_id); expected_device_id, device_id);
/* Set device to mute */ /* Set device to mute */
ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG, ret = tas5720_mute_soc_component(component, 1);
TAS5720_MUTE, TAS5720_MUTE);
if (ret < 0) if (ret < 0)
goto error_snd_soc_component_update_bits; goto error_snd_soc_component_update_bits;
......
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