* PXA AC97 updates @ 2008-04-14 15:11 Mark Brown 2008-04-14 15:12 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() Mark Brown 2008-04-14 15:13 ` PXA AC97 updates Takashi Iwai 0 siblings, 2 replies; 11+ messages in thread From: Mark Brown @ 2008-04-14 15:11 UTC (permalink / raw) To: eric miao, Takashi Iwai; +Cc: alsa-devel, linux-arm-kernel This patch series fixes a bug in the currently queued conversion of the PXA AC97 drivers to the clock API and adds support for AC97 on PXA3xx SoCs. Takashi, since these changes build on things currently queued in the ARM tree for 2.6.26, including ARM-specific changes, it's probably best to merge via there if that's OK? ------------------------------------------------------------------- List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() 2008-04-14 15:11 PXA AC97 updates Mark Brown @ 2008-04-14 15:12 ` Mark Brown 2008-04-14 15:12 ` [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 Mark Brown 2008-04-15 11:32 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() eric miao 2008-04-14 15:13 ` PXA AC97 updates Takashi Iwai 1 sibling, 2 replies; 11+ messages in thread From: Mark Brown @ 2008-04-14 15:12 UTC (permalink / raw) To: eric miao, Takashi Iwai; +Cc: alsa-devel, Mark Brown, linux-arm-kernel For some reason this is not required on PXA3xx. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> --- sound/soc/pxa/pxa2xx-ac97.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index fe9c297..e173799 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -314,6 +314,7 @@ static int pxa2xx_ac97_probe(struct platform_device *pdev) ac97_clk = NULL; goto err_irq; } + clk_enable(ac97_clk); return 0; err_irq: -- 1.5.5 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 2008-04-14 15:12 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() Mark Brown @ 2008-04-14 15:12 ` Mark Brown 2008-04-14 15:12 ` [PATCH 3/3] soc - " Mark Brown 2008-04-15 14:08 ` [PATCH 2/3] pxa2xx-ac97: " eric miao 2008-04-15 11:32 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() eric miao 1 sibling, 2 replies; 11+ messages in thread From: Mark Brown @ 2008-04-14 15:12 UTC (permalink / raw) To: eric miao, Takashi Iwai; +Cc: alsa-devel, Mark Brown, linux-arm-kernel Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> --- sound/arm/pxa2xx-ac97.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 8704e28..bf02e5f 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 static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) { /* First, try cold reset */ +#ifdef CONFIG_PXA3xx + int timeout; + + /* 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 */ @@ -123,6 +133,14 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) clk_disable(ac97conf_clk); GCR = GCR_COLD_RST; udelay(50); +#elif defined(CONFIG_PXA3xx) + timeout = 1000; + /* 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; @@ -143,6 +161,12 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) GCR |= GCR_WARM_RST; pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); udelay(500); +#elif defined(CONFIG_PXA3xx) + timeout = 100; + /* 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); -- 1.5.5 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] soc - Support PXA3xx AC97 2008-04-14 15:12 ` [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 Mark Brown @ 2008-04-14 15:12 ` Mark Brown 2008-04-15 14:08 ` [PATCH 2/3] pxa2xx-ac97: " eric miao 1 sibling, 0 replies; 11+ messages in thread From: Mark Brown @ 2008-04-14 15:12 UTC (permalink / raw) To: eric miao, Takashi Iwai; +Cc: alsa-devel, Mark Brown, linux-arm-kernel 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 e173799..3d9ebb4 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -61,7 +61,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) @@ -111,7 +111,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) @@ -134,6 +134,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 @@ -144,6 +147,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); @@ -159,6 +167,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 */ @@ -170,6 +188,13 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97) clk_disable(ac97conf_clk); 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] 11+ messages in thread
* Re: [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 2008-04-14 15:12 ` [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 Mark Brown 2008-04-14 15:12 ` [PATCH 3/3] soc - " Mark Brown @ 2008-04-15 14:08 ` eric miao 2008-04-15 14:19 ` [alsa-devel] " Mark Brown 1 sibling, 1 reply; 11+ messages in thread From: eric miao @ 2008-04-15 14:08 UTC (permalink / raw) To: Mark Brown; +Cc: Takashi Iwai, alsa-devel, linux-arm-kernel I'm a bit upset about the #ifdef .. #endif, though the original code has the similar issues already. On Mon, Apr 14, 2008 at 11:12 PM, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> > --- > sound/arm/pxa2xx-ac97.c | 24 ++++++++++++++++++++++++ > 1 files changed, 24 insertions(+), 0 deletions(-) > > diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c > index 8704e28..bf02e5f 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 > static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) > { > /* First, try cold reset */ > +#ifdef CONFIG_PXA3xx > + int timeout; > + > + /* 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 */ > > @@ -123,6 +133,14 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) > clk_disable(ac97conf_clk); > GCR = GCR_COLD_RST; > udelay(50); > +#elif defined(CONFIG_PXA3xx) > + timeout = 1000; > + /* 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; > @@ -143,6 +161,12 @@ static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) > GCR |= GCR_WARM_RST; > pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); > udelay(500); > +#elif defined(CONFIG_PXA3xx) > + timeout = 100; > + /* 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); > -- > 1.5.5 > > -- Cheers - eric ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [alsa-devel] [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 2008-04-15 14:08 ` [PATCH 2/3] pxa2xx-ac97: " eric miao @ 2008-04-15 14:19 ` Mark Brown 0 siblings, 0 replies; 11+ messages in thread From: Mark Brown @ 2008-04-15 14:19 UTC (permalink / raw) To: eric miao; +Cc: Takashi Iwai, alsa-devel, linux-arm-kernel On Tue, Apr 15, 2008 at 10:08:22PM +0800, eric miao wrote: > I'm a bit upset about the #ifdef .. #endif, though the original code > has the similar issues already. Yes - any change to fix that would be better off as a separate commit. There's also the MFP configuration that's currently being done for PXA2xx which ought to be removed once the MFP implementations are synchronised. ------------------------------------------------------------------- List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() 2008-04-14 15:12 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() Mark Brown 2008-04-14 15:12 ` [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 Mark Brown @ 2008-04-15 11:32 ` eric miao 2008-04-15 12:29 ` Mark Brown 1 sibling, 1 reply; 11+ messages in thread From: eric miao @ 2008-04-15 11:32 UTC (permalink / raw) To: Mark Brown; +Cc: Takashi Iwai, alsa-devel, linux-arm-kernel It looks a bit confused between the commit message and the actual change. My understanding would be the pxa{25x,27x} requires this change (adding clk_enable), but pxa3xx does not require this. So actually the change is addressing some issue on pxa{25x,27x}? On Mon, Apr 14, 2008 at 11:12 PM, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: > For some reason this is not required on PXA3xx. > > Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> > --- > sound/soc/pxa/pxa2xx-ac97.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c > index fe9c297..e173799 100644 > --- a/sound/soc/pxa/pxa2xx-ac97.c > +++ b/sound/soc/pxa/pxa2xx-ac97.c > @@ -314,6 +314,7 @@ static int pxa2xx_ac97_probe(struct platform_device *pdev) > ac97_clk = NULL; > goto err_irq; > } > + clk_enable(ac97_clk); > return 0; > > err_irq: > -- > 1.5.5 > > -- Cheers - eric ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() 2008-04-15 11:32 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() eric miao @ 2008-04-15 12:29 ` Mark Brown 2008-04-15 14:11 ` eric miao 0 siblings, 1 reply; 11+ messages in thread From: Mark Brown @ 2008-04-15 12:29 UTC (permalink / raw) To: eric miao; +Cc: Takashi Iwai, alsa-devel, linux-arm-kernel On Tue, Apr 15, 2008 at 07:32:39PM +0800, eric miao wrote: > It looks a bit confused between the commit message and the actual change. > My understanding would be the pxa{25x,27x} requires this change (adding > clk_enable), but pxa3xx does not require this. So actually the change is > addressing some issue on pxa{25x,27x}? For correctness WRT the clock API it's required on all variants - the note about PXA3xx is just to indicate how it got through testing. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() 2008-04-15 12:29 ` Mark Brown @ 2008-04-15 14:11 ` eric miao 2008-04-15 14:36 ` Mark Brown 0 siblings, 1 reply; 11+ messages in thread From: eric miao @ 2008-04-15 14:11 UTC (permalink / raw) To: eric miao, Takashi Iwai, linux-arm-kernel, alsa-devel On Tue, Apr 15, 2008 at 8:29 PM, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: > On Tue, Apr 15, 2008 at 07:32:39PM +0800, eric miao wrote: > > > It looks a bit confused between the commit message and the actual change. > > My understanding would be the pxa{25x,27x} requires this change (adding > > clk_enable), but pxa3xx does not require this. So actually the change is > > addressing some issue on pxa{25x,27x}? > > For correctness WRT the clock API it's required on all variants - the > note about PXA3xx is just to indicate how it got through testing. > I'm OK with this then, and it would be better the commit message been modified to a more consistent version :) -- Cheers - eric ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() 2008-04-15 14:11 ` eric miao @ 2008-04-15 14:36 ` Mark Brown 0 siblings, 0 replies; 11+ messages in thread From: Mark Brown @ 2008-04-15 14:36 UTC (permalink / raw) To: eric miao; +Cc: Takashi Iwai, alsa-devel, linux-arm-kernel On Tue, Apr 15, 2008 at 10:11:34PM +0800, eric miao wrote: > On Tue, Apr 15, 2008 at 8:29 PM, Mark Brown > > For correctness WRT the clock API it's required on all variants - the > > note about PXA3xx is just to indicate how it got through testing. > I'm OK with this then, and it would be better the commit message been > modified to a more consistent version :) It's probably easier to just not mention that it ever worked at all :/ ------------------------------------------------------------------- List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: PXA AC97 updates 2008-04-14 15:11 PXA AC97 updates Mark Brown 2008-04-14 15:12 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() Mark Brown @ 2008-04-14 15:13 ` Takashi Iwai 1 sibling, 0 replies; 11+ messages in thread From: Takashi Iwai @ 2008-04-14 15:13 UTC (permalink / raw) To: Mark Brown; +Cc: alsa-devel, eric miao, linux-arm-kernel At Mon, 14 Apr 2008 16:11:28 +0100, Mark Brown wrote: > > This patch series fixes a bug in the currently queued conversion of the > PXA AC97 drivers to the clock API and adds support for AC97 on PXA3xx > SoCs. Takashi, since these changes build on things currently queued in > the ARM tree for 2.6.26, including ARM-specific changes, it's probably > best to merge via there if that's OK? Sure, no problem from my side. Thanks. Takashi ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-04-15 14:36 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-04-14 15:11 PXA AC97 updates Mark Brown 2008-04-14 15:12 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() Mark Brown 2008-04-14 15:12 ` [PATCH 2/3] pxa2xx-ac97: Support PXA3xx AC97 Mark Brown 2008-04-14 15:12 ` [PATCH 3/3] soc - " Mark Brown 2008-04-15 14:08 ` [PATCH 2/3] pxa2xx-ac97: " eric miao 2008-04-15 14:19 ` [alsa-devel] " Mark Brown 2008-04-15 11:32 ` [PATCH 1/3] soc - pxa2xx-ac97: Add missing clk_enable() eric miao 2008-04-15 12:29 ` Mark Brown 2008-04-15 14:11 ` eric miao 2008-04-15 14:36 ` Mark Brown 2008-04-14 15:13 ` PXA AC97 updates Takashi Iwai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox