Skip to contentSkip to conversation

ALSA: ASoC: cs4271: add DT property for AMUTEB=BMUTEC feature

PATCH Superseded Daniel Mack 2 participants 3 messages Oct 4, 2012

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: ASoC: cs4271: add DT property for AMUTEB=BMUTEC feature

The CS4271 has a feature to sync its analog mute flags, so one mute circuitry can be used for both channels.

Give DT uses access to this feature with a new property.

Cc Alexander Sverdlin <[email protected]>
---
 Documentation/devicetree/bindings/sound/cs4271.txt |  2 ++
 sound/soc/codecs/cs4271.c                          | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/sound/cs4271.txt +2 -0
index c81b5fd..a850fb9 100644
@@ -18,6 +18,8 @@ Optional properties:
 
  - reset-gpio: 	a GPIO spec to define which pin is connected to the chip's
 		!RESET pin
+ - cirrus,amuteb-eq-bmutec:	When given, the Codec's AMUTEB=BMUTEC flag
+				is enabled.
 
 Examples:
 
sound/soc/codecs/cs4271.c +12 -1
index f994af3..56ec8dd2 100644
@@ -474,11 +474,17 @@ static int cs4271_probe(struct snd_soc_codec *codec)
 	struct cs4271_platform_data *cs4271plat = codec->dev->platform_data;
 	int ret;
 	int gpio_nreset = -EINVAL;
+	int amutec_eq_bmutec = 0;
 
 #ifdef CONFIG_OF
-	if (of_match_device(cs4271_dt_ids, codec->dev))
+	if (of_match_device(cs4271_dt_ids, codec->dev)) {
 		gpio_nreset = of_get_named_gpio(codec->dev->of_node,
 						"reset-gpio", 0);
+
+		if (!of_get_property(codec->dev->of_node,
+				     "cirrus,amutec-eq-bmutec", NULL))
+			amutec_eq_bmutec = 1;
+	}
 #endif
 
 	if (cs4271plat && gpio_is_valid(cs4271plat->gpio_nreset))
@@ -528,6 +534,11 @@ static int cs4271_probe(struct snd_soc_codec *codec)
 	/* Power-up sequence requires 85 uS */
 	udelay(85);
 
+	if (amutec_eq_bmutec)
+		snd_soc_update_bits(codec, CS4271_MODE2,
+				    CS4271_MODE2_MUTECAEQUB,
+				    CS4271_MODE2_MUTECAEQUB);
+
 	return snd_soc_add_codec_controls(codec, cs4271_snd_controls,
 		ARRAY_SIZE(cs4271_snd_controls));
 }
Signature · 1 line
1.7.11.4
#1 lore raw
Quoted 4 lines · Daniel Mack

The CS4271 has a feature to sync its analog mute flags, so one mute circuitry can be used for both channels.

Give DT uses access to this feature with a new property.

Is there some reason not to add this to the platform data while we're at it?

#2 lore raw
Quoted 9 lines · Mark Brown
Quoted 4 lines · Daniel Mack

The CS4271 has a feature to sync its analog mute flags, so one mute circuitry can be used for both channels.

Give DT uses access to this feature with a new property.

Is there some reason not to add this to the platform data while we're at it?

Well, no :) Can do that, just a sec.

Daniel