aboutsummaryrefslogtreecommitdiffstats
path: root/sound/arm/pxa2xx-ac97.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2008-04-22 11:09:49 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:41 -0400
commit815c1be320fd51e5981c007f737aca410707baf8 (patch)
tree80fce6967f5cba86f03449b5e8764542abd37899 /sound/arm/pxa2xx-ac97.c
parent7a22323b231fe5d47804f98f31a70eb34c6104a9 (diff)
[ALSA] pxa2xx-ac97: Support PXA3xx AC97
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/arm/pxa2xx-ac97.c')
-rw-r--r--sound/arm/pxa2xx-ac97.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 71fbf8d7ee82..5b3274b465eb 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -112,6 +112,16 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigne
112static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) 112static void pxa2xx_ac97_reset(struct snd_ac97 *ac97)
113{ 113{
114 /* First, try cold reset */ 114 /* First, try cold reset */
115#ifdef CONFIG_PXA3xx
116 int timeout;
117
118 /* Hold CLKBPB for 100us */
119 GCR = 0;
120 GCR = GCR_CLKBPB;
121 udelay(100);
122 GCR = 0;
123#endif
124
115 GCR &= GCR_COLD_RST; /* clear everything but nCRST */ 125 GCR &= GCR_COLD_RST; /* clear everything but nCRST */
116 GCR &= ~GCR_COLD_RST; /* then assert nCRST */ 126 GCR &= ~GCR_COLD_RST; /* then assert nCRST */
117 127
@@ -123,6 +133,14 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97)
123 clk_disable(ac97conf_clk); 133 clk_disable(ac97conf_clk);
124 GCR = GCR_COLD_RST; 134 GCR = GCR_COLD_RST;
125 udelay(50); 135 udelay(50);
136#elif defined(CONFIG_PXA3xx)
137 timeout = 1000;
138 /* Can't use interrupts on PXA3xx */
139 GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
140
141 GCR = GCR_WARM_RST | GCR_COLD_RST;
142 while (!(GSR & (GSR_PCR | GSR_SCR)) && timeout--)
143 mdelay(10);
126#else 144#else
127 GCR = GCR_COLD_RST; 145 GCR = GCR_COLD_RST;
128 GCR |= GCR_CDONE_IE|GCR_SDONE_IE; 146 GCR |= GCR_CDONE_IE|GCR_SDONE_IE;
@@ -143,6 +161,12 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97)
143 GCR |= GCR_WARM_RST; 161 GCR |= GCR_WARM_RST;
144 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); 162 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
145 udelay(500); 163 udelay(500);
164#elif defined(CONFIG_PXA3xx)
165 timeout = 100;
166 /* Can't use interrupts */
167 GCR |= GCR_WARM_RST;
168 while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
169 mdelay(1);
146#else 170#else
147 GCR |= GCR_WARM_RST|GCR_PRIRDY_IEN|GCR_SECRDY_IEN; 171 GCR |= GCR_WARM_RST|GCR_PRIRDY_IEN|GCR_SECRDY_IEN;
148 wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1); 172 wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);