devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] ASoC: codecs: tas5720: split a tas5720_mute_soc_component() function
@ 2023-01-15 19:33 Alexandru Ardelean
  2023-01-15 19:33 ` [PATCH 2/4] ASoC: codecs: tas5720: add support for TAS5720A-Q1 (automotive) variant Alexandru Ardelean
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexandru Ardelean @ 2023-01-15 19:33 UTC (permalink / raw)
  To: devicetree, alsa-devel
  Cc: broonie, lgirdwood, krzysztof.kozlowski+dt, perex, tiwai,
	steffen.aschbacher, Alexandru Ardelean

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: Alexandru Ardelean <alex@shruggie.ro>
---
 sound/soc/codecs/tas5720.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/tas5720.c b/sound/soc/codecs/tas5720.c
index 3885c0bf0b01..0587c9bb3c4e 100644
--- a/sound/soc/codecs/tas5720.c
+++ b/sound/soc/codecs/tas5720.c
@@ -199,9 +199,8 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai,
 	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;
 
 	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)
 	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)
 {
 	struct tas5720_data *tas5720 = container_of(work, struct tas5720_data,
@@ -318,8 +322,7 @@ static int tas5720_codec_probe(struct snd_soc_component *component)
 			 expected_device_id, device_id);
 
 	/* Set device to mute */
-	ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG,
-				  TAS5720_MUTE, TAS5720_MUTE);
+	ret = tas5720_mute_soc_component(component, 1);
 	if (ret < 0)
 		goto error_snd_soc_component_update_bits;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-28  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-15 19:33 [PATCH 1/4] ASoC: codecs: tas5720: split a tas5720_mute_soc_component() function Alexandru Ardelean
2023-01-15 19:33 ` [PATCH 2/4] ASoC: codecs: tas5720: add support for TAS5720A-Q1 (automotive) variant Alexandru Ardelean
2023-01-25 14:23   ` Mark Brown
2023-01-28  8:17     ` Alexandru Ardelean
2023-01-15 19:33 ` [PATCH 3/4] ASoC: tas5720: set bit 7 in ANALOG_CTRL_REG for TAS5720A-Q1 during probe Alexandru Ardelean
2023-01-15 19:33 ` [PATCH 4/4] ASoC: dt-bindings: add entry for TAS5720A-Q1 driver Alexandru Ardelean
2023-01-16  8:25   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).