diff options
author | Nikesh Oswal <noswal@nvidia.com> | 2013-01-03 20:58:21 +0530 |
---|---|---|
committer | Riham Haidar <rhaidar@nvidia.com> | 2013-01-16 19:15:10 -0800 |
commit | c7e1e8baed29a4aeef2a44033b618387debe8ab0 (patch) | |
tree | d67a90095426e2968126da36362d4b4012a6ecdb /sound | |
parent | f85ce9a5e1c44ac16d120a35a5796ff5cc4bb3a4 (diff) |
asoc: tegra: cs42l73: change sw registration logic
change switch registration and unregistration logic
to use common api's implemented in tegra_asoc_utils
Bug 1203124
Change-Id: Ie5264617b330d9bda6481eae410c0fdb59139e07
Signed-off-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-on: http://git-master/r/188339
Reviewed-by: Riham Haidar <rhaidar@nvidia.com>
Tested-by: Riham Haidar <rhaidar@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_cs42l73.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra_cs42l73.c b/sound/soc/tegra/tegra_cs42l73.c index 9de766e6faee..802303a6338a 100644 --- a/sound/soc/tegra/tegra_cs42l73.c +++ b/sound/soc/tegra/tegra_cs42l73.c @@ -1317,7 +1317,7 @@ static __devinit int tegra_cs42l73_driver_probe(struct platform_device *pdev) #ifdef CONFIG_SWITCH /* Addd h2w swith class support */ - ret = switch_dev_register(&tegra_cs42l73_headset_switch); + ret = tegra_asoc_switch_register(&tegra_cs42l73_headset_switch); if (ret < 0) goto err_fini_utils; #endif @@ -1382,7 +1382,7 @@ err_unregister_card: snd_soc_unregister_card(card); err_unregister_switch: #ifdef CONFIG_SWITCH - switch_dev_unregister(&tegra_cs42l73_headset_switch); + tegra_asoc_switch_unregister(&tegra_cs42l73_headset_switch); err_fini_utils: #endif tegra_asoc_utils_fini(&machine->util_data); @@ -1398,6 +1398,10 @@ static int __devexit tegra_cs42l73_driver_remove(struct platform_device *pdev) struct tegra_cs42l73 *machine = snd_soc_card_get_drvdata(card); struct tegra_asoc_platform_data *pdata = machine->pdata; +#ifdef CONFIG_SWITCH + tegra_asoc_switch_unregister(&tegra_cs42l73_headset_switch); +#endif + if (machine->gpio_requested & GPIO_HP_DET) snd_soc_jack_free_gpios(&tegra_cs42l73_hp_jack, 1, |