Devicetree
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property
@ 2026-11-18 21:17 Fabio Estevam
  2026-11-18 21:18 ` [PATCH 2/2] ASoC: pcm512x: Support external mute GPIO Fabio Estevam
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2026-11-18 21:17 UTC (permalink / raw)
  To: broonie
  Cc: robh, krzk+dt, conor+dt, shenghao-ding, kevin-lu, baojun.xu, sen,
	linux-sound, devicetree, Fabio Estevam

From: Fabio Estevam <festevam@nabladev.com>

Document the optional GPIO connected to the active-low XSMT soft-mute
input.

Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
 Documentation/devicetree/bindings/sound/ti,pcm512x.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/ti,pcm512x.yaml b/Documentation/devicetree/bindings/sound/ti,pcm512x.yaml
index 21ea9ff5a2bb..58ea52e79860 100644
--- a/Documentation/devicetree/bindings/sound/ti,pcm512x.yaml
+++ b/Documentation/devicetree/bindings/sound/ti,pcm512x.yaml
@@ -42,6 +42,10 @@ properties:
   '#sound-dai-cells':
     const: 0
 
+  mute-gpios:
+    description: GPIO connected to the active-low XSMT soft-mute input.
+    maxItems: 1
+
   pll-in:
     description: GPIO pin used to connect the pll using <1> through <6>. The
       device will be configured for clock input on the given pll-in pin.
-- 
2.43.0


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

* [PATCH 2/2] ASoC: pcm512x: Support external mute GPIO
  2026-11-18 21:17 [PATCH 1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property Fabio Estevam
@ 2026-11-18 21:18 ` Fabio Estevam
  0 siblings, 0 replies; 2+ messages in thread
From: Fabio Estevam @ 2026-11-18 21:18 UTC (permalink / raw)
  To: broonie
  Cc: robh, krzk+dt, conor+dt, shenghao-ding, kevin-lu, baojun.xu, sen,
	linux-sound, devicetree, Fabio Estevam

From: Fabio Estevam <festevam@nabladev.com>

Drive the optional XSMT mute GPIO alongside the PCM512x digital mute.
Assert it before muting the DAC and release it after the digital unmute
has completed.

Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
 sound/soc/codecs/pcm512x.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index b760561d0ef7..f6f07de133c4 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/cleanup.h>
+#include <linux/gpio/consumer.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/clk.h>
@@ -31,6 +32,7 @@ static const char * const pcm512x_supply_names[PCM512x_NUM_SUPPLIES] = {
 
 struct pcm512x_priv {
 	struct regmap *regmap;
+	struct gpio_desc *mute_gpio;
 	struct clk *sclk;
 	struct regulator_bulk_data supplies[PCM512x_NUM_SUPPLIES];
 	struct notifier_block supply_nb[PCM512x_NUM_SUPPLIES];
@@ -1463,6 +1465,7 @@ static int pcm512x_mute(struct snd_soc_dai *dai, int mute, int direction)
 	guard(mutex)(&pcm512x->mutex);
 
 	if (mute) {
+		gpiod_set_value_cansleep(pcm512x->mute_gpio, 1);
 		pcm512x->mute |= 0x1;
 		ret = regmap_update_bits(pcm512x->regmap, PCM512x_MUTE,
 					 PCM512x_RQML | PCM512x_RQMR,
@@ -1486,6 +1489,8 @@ static int pcm512x_mute(struct snd_soc_dai *dai, int mute, int direction)
 			return ret;
 		}
 
+		gpiod_set_value_cansleep(pcm512x->mute_gpio, 0);
+
 		regmap_read_poll_timeout(pcm512x->regmap,
 					 PCM512x_ANALOG_MUTE_DET,
 					 mute_det,
@@ -1581,6 +1586,10 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
 
 	dev_set_drvdata(dev, pcm512x);
 	pcm512x->regmap = regmap;
+	pcm512x->mute_gpio = devm_gpiod_get_optional(dev, "mute", GPIOD_OUT_HIGH);
+	if (IS_ERR(pcm512x->mute_gpio))
+		return dev_err_probe(dev, PTR_ERR(pcm512x->mute_gpio),
+				     "Failed to get mute GPIO\n");
 
 	for (i = 0; i < ARRAY_SIZE(pcm512x->supplies); i++)
 		pcm512x->supplies[i].supply = pcm512x_supply_names[i];
-- 
2.43.0


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

end of thread, other threads:[~2026-11-18 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 21:17 [PATCH 1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property Fabio Estevam
2026-11-18 21:18 ` [PATCH 2/2] ASoC: pcm512x: Support external mute GPIO Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox