Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: tegra+alc5632: move all GPIO setup into probe

Now that deferred probe exists, we can parse device tree and request
GPIOs from probe(), rather than deferring this to the DAI link's init().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Stephen Warren and committed by
Mark Brown
aef9a37c e44fbbd4

+6 -4
+6 -4
sound/soc/tegra/tegra_alc5632.c
··· 1 1 /* 2 - * tegra_alc5632.c -- Toshiba AC100(PAZ00) machine ASoC driver 2 + * tegra_alc5632.c -- Toshiba AC100(PAZ00) machine ASoC driver 3 3 * 4 4 * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.lauchpad.net> 5 5 * Copyright (C) 2012 - NVIDIA, Inc. ··· 110 110 { 111 111 struct snd_soc_codec *codec = rtd->codec; 112 112 struct snd_soc_dapm_context *dapm = &codec->dapm; 113 - struct device_node *np = codec->card->dev->of_node; 114 113 struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(codec->card); 115 114 116 115 snd_soc_jack_new(codec, "Headset Jack", SND_JACK_HEADSET, ··· 117 118 snd_soc_jack_add_pins(&tegra_alc5632_hs_jack, 118 119 ARRAY_SIZE(tegra_alc5632_hs_jack_pins), 119 120 tegra_alc5632_hs_jack_pins); 120 - 121 - machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); 122 121 123 122 if (gpio_is_valid(machine->gpio_hp_det)) { 124 123 tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det; ··· 156 159 157 160 static __devinit int tegra_alc5632_probe(struct platform_device *pdev) 158 161 { 162 + struct device_node *np = pdev->dev.of_node; 159 163 struct snd_soc_card *card = &snd_soc_tegra_alc5632; 160 164 struct tegra_alc5632 *alc5632; 161 165 int ret; ··· 178 180 ret = -EINVAL; 179 181 goto err; 180 182 } 183 + 184 + alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); 185 + if (alc5632->gpio_hp_det == -ENODEV) 186 + return -EPROBE_DEFER; 181 187 182 188 ret = snd_soc_of_parse_card_name(card, "nvidia,model"); 183 189 if (ret)