diff options
author | Jarkko Nikula <jarkko.nikula@nokia.com> | 2008-05-15 05:01:36 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-05-19 07:19:19 -0400 |
commit | f99a633a151686a599413bef758253dfd04887d1 (patch) | |
tree | 7e851cd9077a590525eedf0d61ddb9744216949d /sound/soc/omap/n810.c | |
parent | 1a2505988ea650b61bd07722e99080a40ff27653 (diff) |
[ALSA] ASoC: Convert N810 machine driver to use gpiolib
Use gpiolib since it is now available for OMAPs. Change also references to
HW version RX44 to product name N810.
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc/omap/n810.c')
-rw-r--r-- | sound/soc/omap/n810.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c index c2afffbe8da6..c32487b6c7b0 100644 --- a/sound/soc/omap/n810.c +++ b/sound/soc/omap/n810.c | |||
@@ -30,15 +30,15 @@ | |||
30 | 30 | ||
31 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
32 | #include <asm/arch/hardware.h> | 32 | #include <asm/arch/hardware.h> |
33 | #include <asm/arch/gpio.h> | 33 | #include <linux/gpio.h> |
34 | #include <asm/arch/mcbsp.h> | 34 | #include <asm/arch/mcbsp.h> |
35 | 35 | ||
36 | #include "omap-mcbsp.h" | 36 | #include "omap-mcbsp.h" |
37 | #include "omap-pcm.h" | 37 | #include "omap-pcm.h" |
38 | #include "../codecs/tlv320aic3x.h" | 38 | #include "../codecs/tlv320aic3x.h" |
39 | 39 | ||
40 | #define RX44_HEADSET_AMP_GPIO 10 | 40 | #define N810_HEADSET_AMP_GPIO 10 |
41 | #define RX44_SPEAKER_AMP_GPIO 101 | 41 | #define N810_SPEAKER_AMP_GPIO 101 |
42 | 42 | ||
43 | static struct clk *sys_clkout2; | 43 | static struct clk *sys_clkout2; |
44 | static struct clk *sys_clkout2_src; | 44 | static struct clk *sys_clkout2_src; |
@@ -154,9 +154,9 @@ static int n810_spk_event(struct snd_soc_dapm_widget *w, | |||
154 | struct snd_kcontrol *k, int event) | 154 | struct snd_kcontrol *k, int event) |
155 | { | 155 | { |
156 | if (SND_SOC_DAPM_EVENT_ON(event)) | 156 | if (SND_SOC_DAPM_EVENT_ON(event)) |
157 | omap_set_gpio_dataout(RX44_SPEAKER_AMP_GPIO, 1); | 157 | gpio_set_value(N810_SPEAKER_AMP_GPIO, 1); |
158 | else | 158 | else |
159 | omap_set_gpio_dataout(RX44_SPEAKER_AMP_GPIO, 0); | 159 | gpio_set_value(N810_SPEAKER_AMP_GPIO, 0); |
160 | 160 | ||
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
@@ -165,9 +165,9 @@ static int n810_jack_event(struct snd_soc_dapm_widget *w, | |||
165 | struct snd_kcontrol *k, int event) | 165 | struct snd_kcontrol *k, int event) |
166 | { | 166 | { |
167 | if (SND_SOC_DAPM_EVENT_ON(event)) | 167 | if (SND_SOC_DAPM_EVENT_ON(event)) |
168 | omap_set_gpio_dataout(RX44_HEADSET_AMP_GPIO, 1); | 168 | gpio_set_value(N810_HEADSET_AMP_GPIO, 1); |
169 | else | 169 | else |
170 | omap_set_gpio_dataout(RX44_HEADSET_AMP_GPIO, 0); | 170 | gpio_set_value(N810_HEADSET_AMP_GPIO, 0); |
171 | 171 | ||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
@@ -303,12 +303,12 @@ static int __init n810_soc_init(void) | |||
303 | clk_set_parent(sys_clkout2_src, func96m_clk); | 303 | clk_set_parent(sys_clkout2_src, func96m_clk); |
304 | clk_set_rate(sys_clkout2, 12000000); | 304 | clk_set_rate(sys_clkout2, 12000000); |
305 | 305 | ||
306 | if (omap_request_gpio(RX44_HEADSET_AMP_GPIO) < 0) | 306 | if (gpio_request(N810_HEADSET_AMP_GPIO, "hs_amp") < 0) |
307 | BUG(); | 307 | BUG(); |
308 | if (omap_request_gpio(RX44_SPEAKER_AMP_GPIO) < 0) | 308 | if (gpio_request(N810_SPEAKER_AMP_GPIO, "spk_amp") < 0) |
309 | BUG(); | 309 | BUG(); |
310 | omap_set_gpio_direction(RX44_HEADSET_AMP_GPIO, 0); | 310 | gpio_direction_output(N810_HEADSET_AMP_GPIO, 0); |
311 | omap_set_gpio_direction(RX44_SPEAKER_AMP_GPIO, 0); | 311 | gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0); |
312 | 312 | ||
313 | return 0; | 313 | return 0; |
314 | err2: | 314 | err2: |
@@ -323,6 +323,9 @@ err1: | |||
323 | 323 | ||
324 | static void __exit n810_soc_exit(void) | 324 | static void __exit n810_soc_exit(void) |
325 | { | 325 | { |
326 | gpio_free(N810_SPEAKER_AMP_GPIO); | ||
327 | gpio_free(N810_HEADSET_AMP_GPIO); | ||
328 | |||
326 | platform_device_unregister(n810_snd_device); | 329 | platform_device_unregister(n810_snd_device); |
327 | } | 330 | } |
328 | 331 | ||