diff options
author | Allen Martin <amartin@nvidia.com> | 2011-03-25 13:42:58 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-03-29 17:17:05 -0700 |
commit | 3903a01f5c38a924a23d53dc28dfff60d6832d7d (patch) | |
tree | 0c2e043a48cfdb1350eddec61ef4f81716b0da0a /sound | |
parent | 71249003a92fb56a85f7edc8c28c70ae1bb1fd87 (diff) |
ASoC: tegra: make dependency on switch conditional
Make dependency on Android switch class driver conditional
so driver compiles on configurations with switch disabled
Change-Id: If0b3ad9b4582bd07b79f27ca3252eeb45050b7c8
Signed-off-by: Allen Martin <amartin@nvidia.com>
Reviewed-on: http://git-master/r/24364
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_wired_jack.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_wired_jack.c b/sound/soc/tegra/tegra_wired_jack.c index 9938a019aa51..bc5396eaba39 100644 --- a/sound/soc/tegra/tegra_wired_jack.c +++ b/sound/soc/tegra/tegra_wired_jack.c @@ -20,7 +20,9 @@ #include <linux/types.h> #include <linux/gpio.h> +#ifdef CONFIG_SWITCH #include <linux/switch.h> +#endif #include <linux/notifier.h> #include <sound/jack.h> #include <sound/soc.h> @@ -70,6 +72,7 @@ static struct snd_soc_jack_gpio wired_jack_gpios[] = { }, }; +#ifdef CONFIG_SWITCH static struct switch_dev wired_switch_dev = { .name = "h2w", }; @@ -137,6 +140,7 @@ static int wired_swith_notify(struct notifier_block *self, static struct notifier_block wired_switch_nb = { .notifier_call = wired_swith_notify, }; +#endif /* platform driver */ static int tegra_wired_jack_probe(struct platform_device *pdev) @@ -207,8 +211,10 @@ 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; +#ifdef CONFIG_SWITCH snd_soc_jack_notifier_register(tegra_wired_jack, &wired_switch_nb); +#endif return ret; } @@ -261,10 +267,12 @@ int tegra_jack_init(struct snd_soc_codec *codec) if (ret < 0) goto failed; +#ifdef CONFIG_SWITCH /* Addd h2w swith class support */ ret = switch_dev_register(&wired_switch_dev); if (ret < 0) goto switch_dev_failed; +#endif ret = platform_driver_register(&tegra_wired_jack_driver); if (ret < 0) @@ -272,8 +280,10 @@ int tegra_jack_init(struct snd_soc_codec *codec) return 0; +#ifdef CONFIG_SWITCH switch_dev_failed: switch_dev_unregister(&wired_switch_dev); +#endif platform_dev_failed: platform_driver_unregister(&tegra_wired_jack_driver); failed: @@ -286,7 +296,9 @@ failed: void tegra_jack_exit(void) { +#ifdef CONFIG_SWITCH switch_dev_unregister(&wired_switch_dev); +#endif platform_driver_unregister(&tegra_wired_jack_driver); if (tegra_wired_jack) { |