[alsa-devel] [PATCH] 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.
Signed-off-by: Daniel Mack zonque@gmail.com Cc: Alexander Sverdlin subaparts@yandex.ru --- Documentation/devicetree/bindings/sound/cs4271.txt | 2 ++ sound/soc/codecs/cs4271.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/cs4271.txt b/Documentation/devicetree/bindings/sound/cs4271.txt index c81b5fd..a850fb9 100644 --- a/Documentation/devicetree/bindings/sound/cs4271.txt +++ b/Documentation/devicetree/bindings/sound/cs4271.txt @@ -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:
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index f994af3..56ec8dd2 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c @@ -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)); }
On Thu, Oct 04, 2012 at 01:53:59PM +0200, Daniel Mack wrote:
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?
On 04.10.2012 13:56, Mark Brown wrote:
On Thu, Oct 04, 2012 at 01:53:59PM +0200, Daniel Mack wrote:
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
participants (2)
-
Daniel Mack
-
Mark Brown