All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] soc - Support PXA3xx AC97
@ 2008-04-22 13:14 Mark Brown
  2008-04-22 13:14 ` [PATCH 2/5] pxa2xx-ac97: " Mark Brown
  2008-04-22 14:11 ` [PATCH 1/5] soc - " Takashi Iwai
  0 siblings, 2 replies; 24+ messages in thread
From: Mark Brown @ 2008-04-22 13:14 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Mark Brown

The PXA3xx does not support the use of interrupts during reset and access
to the GPIO status requires similar handling to that for PXA27x.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/pxa/pxa2xx-ac97.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 815c153..95ae509 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -55,7 +55,7 @@ static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97,
 	mutex_lock(&car_mutex);
 
 	/* set up primary or secondary codec/modem space */
-#ifdef CONFIG_PXA27x
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 	reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
 #else
 	if (reg == AC97_GPIO_STATUS)
@@ -105,7 +105,7 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
 	mutex_lock(&car_mutex);
 
 	/* set up primary or secondary codec/modem space */
-#ifdef CONFIG_PXA27x
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 	reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
 #else
 	if (reg == AC97_GPIO_STATUS)
@@ -128,6 +128,9 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
 
 static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
 {
+#ifdef CONFIG_PXA3xx
+	int timeout = 100;
+#endif
 	gsr_bits = 0;
 
 #ifdef CONFIG_PXA27x
@@ -138,6 +141,11 @@ static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
 	GCR |= GCR_WARM_RST;
 	pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
 	udelay(500);
+#elif defined(CONFIG_PXA3xx)
+	/* Can't use interrupts */
+	GCR |= GCR_WARM_RST;
+	while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
+		mdelay(1);
 #else
 	GCR |= GCR_WARM_RST | GCR_PRIRDY_IEN | GCR_SECRDY_IEN;
 	wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
@@ -153,6 +161,16 @@ static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
 
 static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97)
 {
+#ifdef CONFIG_PXA3xx
+	int timeout = 1000;
+
+	/* Hold CLKBPB for 100us */
+	GCR = 0;
+	GCR = GCR_CLKBPB;
+	udelay(100);
+	GCR = 0;
+#endif
+
 	GCR &=  GCR_COLD_RST;  /* clear everything but nCRST */
 	GCR &= ~GCR_COLD_RST;  /* then assert nCRST */
 
@@ -164,6 +182,13 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97)
 	pxa_set_cken(CKEN_AC97CONF, 0);
 	GCR = GCR_COLD_RST;
 	udelay(50);
+#elif defined(CONFIG_PXA3xx)
+	/* Can't use interrupts on PXA3xx */
+	GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
+
+	GCR = GCR_WARM_RST | GCR_COLD_RST;
+	while (!(GSR & (GSR_PCR | GSR_SCR)) && timeout--)
+		mdelay(10);
 #else
 	GCR = GCR_COLD_RST;
 	GCR |= GCR_CDONE_IE|GCR_SDONE_IE;
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2008-04-23 10:19 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22 13:14 [PATCH 1/5] soc - Support PXA3xx AC97 Mark Brown
2008-04-22 13:14 ` [PATCH 2/5] pxa2xx-ac97: " Mark Brown
2008-04-22 13:14   ` [PATCH 3/5] ASoC: Add drivers for the Texas Instruments OMAP processors Mark Brown
2008-04-22 13:14     ` [PATCH 4/5] soc - neo1973_wm8753 - Fix module unload Mark Brown
2008-04-22 13:14       ` [PATCH 5/5] soc - s3c24xx - Improve diagnostic output Mark Brown
2008-04-22 14:14         ` Takashi Iwai
2008-04-22 14:26           ` Tim Niemeyer
2008-04-22 14:40             ` Takashi Iwai
2008-04-22 14:13       ` [PATCH 4/5] soc - neo1973_wm8753 - Fix module unload Takashi Iwai
2008-04-22 14:13     ` [PATCH 3/5] ASoC: Add drivers for the Texas Instruments OMAP processors Takashi Iwai
2008-04-22 14:43       ` Mark Brown
2008-04-22 14:56         ` Takashi Iwai
2008-04-22 18:38           ` Mark Brown
2008-04-23  8:41             ` Takashi Iwai
2008-04-23 10:15               ` Mark Brown
2008-04-23 10:19                 ` Takashi Iwai
2008-04-23  5:57           ` Jarkko Nikula
2008-04-23  9:08             ` Takashi Iwai
2008-04-23  9:20               ` Mark Brown
2008-04-23  9:33                 ` Takashi Iwai
2008-04-23  9:36                   ` Mark Brown
2008-04-23  9:40                     ` Takashi Iwai
2008-04-22 14:12   ` [PATCH 2/5] pxa2xx-ac97: Support PXA3xx AC97 Takashi Iwai
2008-04-22 14:11 ` [PATCH 1/5] soc - " Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.