summaryrefslogtreecommitdiff
path: root/sound/soc/tegra/tegra_aic326x.c
diff options
context:
space:
mode:
authorNikesh Oswal <noswal@nvidia.com>2012-02-08 10:35:03 -0800
committerLokesh Pathak <lpathak@nvidia.com>2012-02-23 05:08:08 -0800
commit64fcec0b6d07b3c0585530b0e683b575990d5b36 (patch)
treee1bf5afe4628da3e17c29ad50383c0cac6708521 /sound/soc/tegra/tegra_aic326x.c
parent4c00234126eac2f5dff167653a22832b054f8ddc (diff)
asoc: tegra: aic326x machine: register the sw dev before the card
If sw dev is registered after the card then there would be a kernel panic if we try to boot the device with Headset connected because when the card is registered init of every dai link is called from where we register the jack with codec driver and doing so will enable headset interrupts which would try to set switch state for an unregistered switch device Change-Id: Ie951f41028a3459e4e13d021c80c3f830bbcc533 Signed-off-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-on: http://git-master/r/84536 Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound/soc/tegra/tegra_aic326x.c')
-rw-r--r--sound/soc/tegra/tegra_aic326x.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/soc/tegra/tegra_aic326x.c b/sound/soc/tegra/tegra_aic326x.c
index 80ef3abc1de0..f9a925754ca6 100644
--- a/sound/soc/tegra/tegra_aic326x.c
+++ b/sound/soc/tegra/tegra_aic326x.c
@@ -1045,6 +1045,16 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev)
tegra_aic326x_i2s_dai_name[machine->codec_info[BT_SCO].i2s_id];
#endif
+#ifdef CONFIG_SWITCH
+ /* Add h2w switch class support */
+ ret = switch_dev_register(&aic326x_wired_switch_dev);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "not able to register switch device %d\n",
+ ret);
+ goto err_fini_utils;
+ }
+#endif
+
ret = snd_soc_register_card(card);
if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
@@ -1057,16 +1067,6 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev)
goto err_unregister_card;
}
-#ifdef CONFIG_SWITCH
- /* Add h2w switch class support */
- ret = switch_dev_register(&aic326x_wired_switch_dev);
- if (ret < 0) {
- dev_err(&pdev->dev, "not able to register switch device %d\n",
- ret);
- goto err_unregister_card;
- }
-#endif
-
return 0;
err_unregister_card: