summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoswal <noswal@nvidia.com>2011-03-15 16:26:41 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-03-16 19:47:50 -0800
commit8fa457c5ac6394a181610e9a095586e4a8ff3123 (patch)
treee9da10d442be8007f803a1496b5ade6903156974
parent1c3b9bd9adf9343a0612ba0bfcd6c7cfef77a999 (diff)
ASoC: tegra: whistler boot failuretegra-10.11.ER2
whistler not booting because switch device required by jack driver not initialised Change-Id: I447a9fd179f08f38fc9e2444650ce7511d2092ee Reviewed-on: http://git-master/r/22993 Tested-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--sound/soc/tegra/tegra_wired_jack.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sound/soc/tegra/tegra_wired_jack.c b/sound/soc/tegra/tegra_wired_jack.c
index b846fa003c62..9938a019aa51 100644
--- a/sound/soc/tegra/tegra_wired_jack.c
+++ b/sound/soc/tegra/tegra_wired_jack.c
@@ -207,18 +207,9 @@ static int tegra_wired_jack_probe(struct platform_device *pdev)
tegra_wired_jack_conf.cdc_irq = cdc_irq;
tegra_wired_jack_conf.en_spkr = en_spkr;
- /* Addd h2w swith class support */
- ret = switch_dev_register(&wired_switch_dev);
- if (ret < 0)
- goto switch_dev_failed;
-
snd_soc_jack_notifier_register(tegra_wired_jack,
&wired_switch_nb);
- return 0;
-
-switch_dev_failed:
- switch_dev_unregister(&wired_switch_dev);
return ret;
}
@@ -232,8 +223,6 @@ static int tegra_wired_jack_remove(struct platform_device *pdev)
gpio_free(tegra_wired_jack_conf.en_mic_ext);
gpio_free(tegra_wired_jack_conf.en_spkr);
- switch_dev_unregister(&wired_switch_dev);
-
return 0;
}
@@ -272,12 +261,19 @@ int tegra_jack_init(struct snd_soc_codec *codec)
if (ret < 0)
goto failed;
+ /* Addd h2w swith class support */
+ ret = switch_dev_register(&wired_switch_dev);
+ if (ret < 0)
+ goto switch_dev_failed;
+
ret = platform_driver_register(&tegra_wired_jack_driver);
if (ret < 0)
goto platform_dev_failed;
return 0;
+switch_dev_failed:
+ switch_dev_unregister(&wired_switch_dev);
platform_dev_failed:
platform_driver_unregister(&tegra_wired_jack_driver);
failed:
@@ -290,6 +286,7 @@ failed:
void tegra_jack_exit(void)
{
+ switch_dev_unregister(&wired_switch_dev);
platform_driver_unregister(&tegra_wired_jack_driver);
if (tegra_wired_jack) {