diff options
Diffstat (limited to 'sound/soc/codecs/cs4271.c')
-rw-r--r-- | sound/soc/codecs/cs4271.c | 21 |
1 files changed, 18 insertions, 3 deletions
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 | } |