diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/uda134x.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index bf9182cedb82..1c8784503c4f 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -12,6 +12,7 @@ #include <linux/module.h> #include <linux/delay.h> +#include <linux/gpio/consumer.h> #include <linux/slab.h> #include <sound/pcm.h> #include <sound/pcm_params.h> @@ -37,6 +38,8 @@ struct uda134x_priv { struct regmap *regmap; struct uda134x_platform_data *pd; + + struct gpio_desc *qmute; }; static const struct reg_default uda134x_reg_defaults[] = { @@ -125,6 +128,9 @@ static int uda134x_mute(struct snd_soc_dai *dai, int mute, int direction) pr_debug("%s mute: %d\n", __func__, mute); + if (uda134x->qmute) + gpiod_set_value_cansleep(uda134x->qmute, mute); + if (mute) val = mask; else @@ -304,6 +310,8 @@ static int uda134x_set_bias_level(struct snd_soc_component *component, case SND_SOC_BIAS_PREPARE: /* power on */ if (pd->power) { + if (uda134x->qmute) + gpiod_set_value_cansleep(uda134x->qmute, 1); pd->power(1); regcache_sync(uda134x->regmap); } @@ -315,6 +323,8 @@ static int uda134x_set_bias_level(struct snd_soc_component *component, if (pd->power) { pd->power(0); regcache_mark_dirty(uda134x->regmap); + if (uda134x->qmute) + gpiod_set_value_cansleep(uda134x->qmute, 0); } break; } @@ -524,7 +534,7 @@ static const struct snd_soc_component_driver soc_component_dev_uda134x = { .dapm_routes = uda134x_dapm_routes, .num_dapm_routes = ARRAY_SIZE(uda134x_dapm_routes), .suspend_bias_off = 1, - .idle_bias_on = 1, + .idle_bias_on = 0, .use_pmdown_time = 1, .endianness = 1, .non_legacy_dai_naming = 1, @@ -570,6 +580,11 @@ static int uda134x_codec_probe(struct platform_device *pdev) if (IS_ERR(uda134x->regmap)) return PTR_ERR(uda134x->regmap); + uda134x->qmute = devm_gpiod_get_optional(&pdev->dev, "qmute", + GPIOD_OUT_LOW); + if (IS_ERR(uda134x->qmute)) + return PTR_ERR(uda134x->qmute); + return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_uda134x, &uda134x_dai, 1); } |