summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorAlban Bedel <alban.bedel@avionic-design.de>2014-10-21 17:33:29 +0200
committerMark Brown <broonie@kernel.org>2014-10-21 22:23:37 +0100
commit469cda294dac1c4128e9adcb0a94636bc0cb280e (patch)
tree0da6b84637c4367bacdc3cf41c78698ab5003657 /sound/soc
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
downloadlinux-469cda294dac1c4128e9adcb0a94636bc0cb280e.tar.gz
linux-469cda294dac1c4128e9adcb0a94636bc0cb280e.tar.bz2
linux-469cda294dac1c4128e9adcb0a94636bc0cb280e.zip
ASoC: tegra: Read and use the GPIO flags of the headphone detect
The headphone detect was hardcoded to low-active, use the flags from DT to allow high-active as well. Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/tegra/tegra_rt5640.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index a6898831fb9f..4ebe3871e610 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -44,6 +44,7 @@
struct tegra_rt5640 {
struct tegra_asoc_utils_data util_data;
int gpio_hp_det;
+ enum of_gpio_flags gpio_hp_det_flags;
};
static int tegra_rt5640_asoc_hw_params(struct snd_pcm_substream *substream,
@@ -119,6 +120,8 @@ static int tegra_rt5640_asoc_init(struct snd_soc_pcm_runtime *rtd)
if (gpio_is_valid(machine->gpio_hp_det)) {
tegra_rt5640_hp_jack_gpio.gpio = machine->gpio_hp_det;
+ tegra_rt5640_hp_jack_gpio.invert =
+ !!(machine->gpio_hp_det_flags & OF_GPIO_ACTIVE_LOW);
snd_soc_jack_add_gpios(&tegra_rt5640_hp_jack,
1,
&tegra_rt5640_hp_jack_gpio);
@@ -180,7 +183,8 @@ static int tegra_rt5640_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
- machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
+ machine->gpio_hp_det = of_get_named_gpio_flags(
+ np, "nvidia,hp-det-gpios", 0, &machine->gpio_hp_det_flags);
if (machine->gpio_hp_det == -EPROBE_DEFER)
return -EPROBE_DEFER;