From 23c12ca33e6851df34b2b3086d3a8841c2f1a0eb Mon Sep 17 00:00:00 2001 From: Shreshtha SAHU Date: Wed, 24 Sep 2014 20:51:29 +0530 Subject: soc: tegra: max98090: laguna: fix error return paths - Remove switch_dev_unregister and call tegra_asoc_switch_unregister instead in error return path corresponding to tegra_asoc_switch_register. - Skip max97236 registration for laguna erss platorm. Issues surfaced out on making max98090 as removable KO module. Bug 1550880 Change-Id: I6a6c0185a3980efab3592f0733bda214aac4fc81 Signed-off-by: Shreshtha SAHU Reviewed-on: http://git-master/r/551901 Reviewed-by: Venkat Moganty --- sound/soc/tegra/tegra_max98090.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c index f18ab905f029..88ff101d0514 100644 --- a/sound/soc/tegra/tegra_max98090.c +++ b/sound/soc/tegra/tegra_max98090.c @@ -1289,7 +1289,8 @@ static int tegra_late_probe(struct snd_soc_card *card) card->rtd[DAI_LINK_HIFI_MAX97236].codec; int ret; - if (of_machine_is_compatible("nvidia,norrin")) + if (of_machine_is_compatible("nvidia,norrin") || + of_machine_is_compatible("nvidia,laguna")) return 0; if (of_device_is_compatible(np, "nvidia,max97236")) { @@ -1570,8 +1571,17 @@ err_unregister_card: snd_soc_unregister_card(card); err_switch_unregister: #ifdef CONFIG_SWITCH - switch_dev_unregister(&tegra_max98090_headset_switch); + tegra_asoc_switch_unregister(&tegra_max98090_headset_switch); #endif + if (machine->avdd_aud_reg) { + regulator_disable(machine->avdd_aud_reg); + regulator_put(machine->avdd_aud_reg); + } + + if (machine->vdd_sw_1v8_reg) { + regulator_disable(machine->vdd_sw_1v8_reg); + regulator_put(machine->vdd_sw_1v8_reg); + } err_fini_utils: tegra_asoc_utils_fini(&machine->util_data); err_free_machine: @@ -1590,7 +1600,7 @@ static int __devexit tegra_max98090_driver_remove(struct platform_device *pdev) struct tegra_asoc_platform_data *pdata = machine->pdata; #ifdef CONFIG_SWITCH - switch_dev_unregister(&tegra_max98090_headset_switch); + tegra_asoc_switch_unregister(&tegra_max98090_headset_switch); #endif if (machine->gpio_requested & GPIO_HP_MUTE) -- cgit v1.2.3