All of lore.kernel.org
 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
  2026-11-19 18:09 ` [PATCH 1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property Mark Brown
  0 siblings, 2 replies; 4+ 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] 4+ 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
  2026-11-19 18:09   ` Mark Brown
  2026-11-19 18:09 ` [PATCH 1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property Mark Brown
  1 sibling, 1 reply; 4+ 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] 4+ messages in thread

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

> 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.

Do we need to do both, one of the reasons you'd use a GPIO is to have a
lower overhead mechanism?

-- 
Mark Brown <broonie@kernel.org>

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

* Re: [PATCH 1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property
  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
@ 2026-11-19 18:09 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-11-19 18:09 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: robh, krzk+dt, conor+dt, shenghao-ding, kevin-lu, baojun.xu, sen,
	linux-sound, devicetree, Fabio Estevam

On Wed, 18 Nov 2026 18:17:59 -0300, Fabio Estevam wrote:
> ASoC: dt-bindings: pcm512x: Add mute-gpios property

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5

Thanks!

[1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property
      https://git.kernel.org/broonie/sound/c/a6ff2055fdbb
[2/2] ASoC: pcm512x: Support external mute GPIO
      https://git.kernel.org/broonie/sound/c/35aa7b7f8501

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2026-11-20 12:19 UTC | newest]

Thread overview: 4+ 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
2026-11-19 18:09   ` Mark Brown
2026-11-19 18:09 ` [PATCH 1/2] ASoC: dt-bindings: pcm512x: Add mute-gpios property Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.