diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-01 23:35:00 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-01 23:35:00 -0500 |
commit | 0998deb561fd2fd0e8743643afdc3477750e21fa (patch) | |
tree | d92f8d2821c373e0cc6e04085cbcd56ce5162f6b | |
parent | 3bc324922663bda59af5cdc409e8df3ed217d296 (diff) | |
parent | 293750f9bcb3368d5298ed1a091b5402de359d3b (diff) |
Merge remote-tracking branch 'asoc/topic/cs4271' into asoc-next
-rw-r--r-- | Documentation/devicetree/bindings/sound/cs4271.txt | 2 | ||||
-rw-r--r-- | include/sound/cs4271.h | 1 | ||||
-rw-r--r-- | sound/soc/codecs/cs4271.c | 21 |
3 files changed, 21 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/sound/cs4271.txt b/Documentation/devicetree/bindings/sound/cs4271.txt index c81b5fd5a5bc..a850fb9c88ea 100644 --- a/Documentation/devicetree/bindings/sound/cs4271.txt +++ b/Documentation/devicetree/bindings/sound/cs4271.txt | |||
@@ -18,6 +18,8 @@ Optional properties: | |||
18 | 18 | ||
19 | - reset-gpio: a GPIO spec to define which pin is connected to the chip's | 19 | - reset-gpio: a GPIO spec to define which pin is connected to the chip's |
20 | !RESET pin | 20 | !RESET pin |
21 | - cirrus,amuteb-eq-bmutec: When given, the Codec's AMUTEB=BMUTEC flag | ||
22 | is enabled. | ||
21 | 23 | ||
22 | Examples: | 24 | Examples: |
23 | 25 | ||
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h index 50a059e7d116..6d9e15ed1dcf 100644 --- a/include/sound/cs4271.h +++ b/include/sound/cs4271.h | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | struct cs4271_platform_data { | 20 | struct cs4271_platform_data { |
21 | int gpio_nreset; /* GPIO driving Reset pin, if any */ | 21 | int gpio_nreset; /* GPIO driving Reset pin, if any */ |
22 | int amutec_eq_bmutec:1; /* flag to enable AMUTEC=BMUTEC */ | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | #endif /* __CS4271_H */ | 25 | #endif /* __CS4271_H */ |
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index e3f0a7f3131e..6ad3878db8fc 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c | |||
@@ -474,15 +474,25 @@ static int cs4271_probe(struct snd_soc_codec *codec) | |||
474 | struct cs4271_platform_data *cs4271plat = codec->dev->platform_data; | 474 | struct cs4271_platform_data *cs4271plat = codec->dev->platform_data; |
475 | int ret; | 475 | int ret; |
476 | int gpio_nreset = -EINVAL; | 476 | int gpio_nreset = -EINVAL; |
477 | int amutec_eq_bmutec = 0; | ||
477 | 478 | ||
478 | #ifdef CONFIG_OF | 479 | #ifdef CONFIG_OF |
479 | if (of_match_device(cs4271_dt_ids, codec->dev)) | 480 | if (of_match_device(cs4271_dt_ids, codec->dev)) { |
480 | gpio_nreset = of_get_named_gpio(codec->dev->of_node, | 481 | gpio_nreset = of_get_named_gpio(codec->dev->of_node, |
481 | "reset-gpio", 0); | 482 | "reset-gpio", 0); |
483 | |||
484 | if (!of_get_property(codec->dev->of_node, | ||
485 | "cirrus,amutec-eq-bmutec", NULL)) | ||
486 | amutec_eq_bmutec = 1; | ||
487 | } | ||
482 | #endif | 488 | #endif |
483 | 489 | ||
484 | if (cs4271plat && gpio_is_valid(cs4271plat->gpio_nreset)) | 490 | if (cs4271plat) { |
485 | gpio_nreset = cs4271plat->gpio_nreset; | 491 | if (gpio_is_valid(cs4271plat->gpio_nreset)) |
492 | gpio_nreset = cs4271plat->gpio_nreset; | ||
493 | |||
494 | amutec_eq_bmutec = cs4271plat->amutec_eq_bmutec; | ||
495 | } | ||
486 | 496 | ||
487 | if (gpio_nreset >= 0) | 497 | if (gpio_nreset >= 0) |
488 | if (devm_gpio_request(codec->dev, gpio_nreset, "CS4271 Reset")) | 498 | if (devm_gpio_request(codec->dev, gpio_nreset, "CS4271 Reset")) |
@@ -528,6 +538,11 @@ static int cs4271_probe(struct snd_soc_codec *codec) | |||
528 | /* Power-up sequence requires 85 uS */ | 538 | /* Power-up sequence requires 85 uS */ |
529 | udelay(85); | 539 | udelay(85); |
530 | 540 | ||
541 | if (amutec_eq_bmutec) | ||
542 | snd_soc_update_bits(codec, CS4271_MODE2, | ||
543 | CS4271_MODE2_MUTECAEQUB, | ||
544 | CS4271_MODE2_MUTECAEQUB); | ||
545 | |||
531 | return snd_soc_add_codec_controls(codec, cs4271_snd_controls, | 546 | return snd_soc_add_codec_controls(codec, cs4271_snd_controls, |
532 | ARRAY_SIZE(cs4271_snd_controls)); | 547 | ARRAY_SIZE(cs4271_snd_controls)); |
533 | } | 548 | } |