All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver
@ 2008-12-18 10:15 Lopez Cruz, Misael
  2008-12-18 12:51 ` Jarkko Nikula
  2008-12-18 13:41 ` Tony Lindgren
  0 siblings, 2 replies; 6+ messages in thread
From: Lopez Cruz, Misael @ 2008-12-18 10:15 UTC (permalink / raw)
  To: linux-omap; +Cc: Pandita, Vikram

This patch enables XCCR and RCCR McBSP register writing in OMAP 24xx/34xx
platforms. It also explicitly initializes those registers to their default
values in ASoC McBSP DAI driver.

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
---
 arch/arm/plat-omap/include/mach/mcbsp.h |    6 ++++++
 arch/arm/plat-omap/mcbsp.c              |    4 ++++
 sound/soc/omap/omap-mcbsp.c             |    4 ++++
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h
index 6a0d1a0..5885f3a 100644
--- a/arch/arm/plat-omap/include/mach/mcbsp.h
+++ b/arch/arm/plat-omap/include/mach/mcbsp.h
@@ -231,11 +231,16 @@
 #define XPBBLK(value)		((value)<<7)	/* Bits 7:8 */
 
 /*********************** McBSP XCCR bit definitions *************************/
+#define EXTCLKGATE		0x8000
+#define PPCONNECT		0x4000
+#define DXENDLY(value)		((value)<<12)	/* Bits 12:13 */
+#define XFULL_CYCLE		0x0800
 #define DILB			0x0020
 #define XDMAEN			0x0008
 #define XDISABLE		0x0001

 /********************** McBSP RCCR bit definitions *************************/
+#define RFULL_CYCLE		0x0800
 #define RDMAEN			0x0008
 #define RDISABLE		0x0001

@@ -267,6 +271,8 @@ struct omap_mcbsp_reg_cfg {
 	u16 rcerh;
 	u16 xcerg;
 	u16 xcerh;
+	u16 xccr;
+	u16 rccr;
 };
 
 typedef enum {
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index af33fc7..d71b30b 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -173,6 +173,10 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
 	OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2);
 	OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1);
 	OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0);
+	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+		OMAP_MCBSP_WRITE(io_base, XCCR, config->xccr);
+		OMAP_MCBSP_WRITE(io_base, RCCR, config->rccr);
+	}
 }
 EXPORT_SYMBOL(omap_mcbsp_config);
 
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 8485a8a..2e7000d 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -295,6 +295,10 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
 	regs->spcr1	|= RINTM(3);
 	regs->rcr2	|= RFIG;
 	regs->xcr2	|= XFIG;
+	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+		regs->xccr = DXENDLY(1) | XDMAEN;
+		regs->rccr = RFULL_CYCLE | RDMAEN;
+	}
 
 	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
 	case SND_SOC_DAIFMT_I2S:
-- 
1.5.4.3

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

* Re: [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver
  2008-12-18 10:15 [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver Lopez Cruz, Misael
@ 2008-12-18 12:51 ` Jarkko Nikula
  2008-12-18 13:41 ` Tony Lindgren
  1 sibling, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2008-12-18 12:51 UTC (permalink / raw)
  To: ext Lopez Cruz, Misael; +Cc: linux-omap, Pandita, Vikram

On Thu, 18 Dec 2008 04:15:09 -0600
"ext Lopez Cruz, Misael" <x0052729@ti.com> wrote:

> diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
> index 8485a8a..2e7000d 100644
> --- a/sound/soc/omap/omap-mcbsp.c
> +++ b/sound/soc/omap/omap-mcbsp.c
> @@ -295,6 +295,10 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
>  	regs->spcr1	|= RINTM(3);
>  	regs->rcr2	|= RFIG;
>  	regs->xcr2	|= XFIG;
> +	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
> +		regs->xccr = DXENDLY(1) | XDMAEN;
> +		regs->rccr = RFULL_CYCLE | RDMAEN;
> +	}
>  
This part should go as a separate patch and via alsa-devel when omap
part is in upstream. Probably easier to handle via LKML? So two
patches: plat-omap and sound part.


Jarkko

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

* Re: [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver
  2008-12-18 10:15 [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver Lopez Cruz, Misael
  2008-12-18 12:51 ` Jarkko Nikula
@ 2008-12-18 13:41 ` Tony Lindgren
  2008-12-18 13:49   ` Jarkko Nikula
  2008-12-18 15:17   ` [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registersfor " shekhar, chandra
  1 sibling, 2 replies; 6+ messages in thread
From: Tony Lindgren @ 2008-12-18 13:41 UTC (permalink / raw)
  To: Lopez Cruz, Misael; +Cc: linux-omap, Pandita, Vikram

Hi,

* Lopez Cruz, Misael <x0052729@ti.com> [081218 12:16]:
> This patch enables XCCR and RCCR McBSP register writing in OMAP 24xx/34xx
> platforms. It also explicitly initializes those registers to their default
> values in ASoC McBSP DAI driver.

Can you please describe a bit what these registers do? It's impossible
for anybody to decipher without looking at the TRM right now.

> Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
> ---
>  arch/arm/plat-omap/include/mach/mcbsp.h |    6 ++++++
>  arch/arm/plat-omap/mcbsp.c              |    4 ++++
>  sound/soc/omap/omap-mcbsp.c             |    4 ++++
>  3 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h
> index 6a0d1a0..5885f3a 100644
> --- a/arch/arm/plat-omap/include/mach/mcbsp.h
> +++ b/arch/arm/plat-omap/include/mach/mcbsp.h
> @@ -231,11 +231,16 @@
>  #define XPBBLK(value)		((value)<<7)	/* Bits 7:8 */
>  
>  /*********************** McBSP XCCR bit definitions *************************/
> +#define EXTCLKGATE		0x8000
> +#define PPCONNECT		0x4000
> +#define DXENDLY(value)		((value)<<12)	/* Bits 12:13 */
> +#define XFULL_CYCLE		0x0800
>  #define DILB			0x0020
>  #define XDMAEN			0x0008
>  #define XDISABLE		0x0001
> 
>  /********************** McBSP RCCR bit definitions *************************/
> +#define RFULL_CYCLE		0x0800
>  #define RDMAEN			0x0008
>  #define RDISABLE		0x0001
> 
> @@ -267,6 +271,8 @@ struct omap_mcbsp_reg_cfg {
>  	u16 rcerh;
>  	u16 xcerg;
>  	u16 xcerh;
> +	u16 xccr;
> +	u16 rccr;
>  };
>  
>  typedef enum {
> diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
> index af33fc7..d71b30b 100644
> --- a/arch/arm/plat-omap/mcbsp.c
> +++ b/arch/arm/plat-omap/mcbsp.c
> @@ -173,6 +173,10 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
>  	OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2);
>  	OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1);
>  	OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0);
> +	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
> +		OMAP_MCBSP_WRITE(io_base, XCCR, config->xccr);
> +		OMAP_MCBSP_WRITE(io_base, RCCR, config->rccr);
> +	}
>  }
>  EXPORT_SYMBOL(omap_mcbsp_config);
>  

You can do the above with cpu_class_is_omap2() instead. Might be worth
checking that these registers are available on 2420 too.

> diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
> index 8485a8a..2e7000d 100644
> --- a/sound/soc/omap/omap-mcbsp.c
> +++ b/sound/soc/omap/omap-mcbsp.c
> @@ -295,6 +295,10 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
>  	regs->spcr1	|= RINTM(3);
>  	regs->rcr2	|= RFIG;
>  	regs->xcr2	|= XFIG;
> +	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
> +		regs->xccr = DXENDLY(1) | XDMAEN;
> +		regs->rccr = RFULL_CYCLE | RDMAEN;
> +	}
>  
>  	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
>  	case SND_SOC_DAIFMT_I2S:
> -- 

I agree with Jarkko's comment, the ASoC change should go via alsa list
as a separate patch.

Regards,

Tony


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

* Re: [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver
  2008-12-18 13:41 ` Tony Lindgren
@ 2008-12-18 13:49   ` Jarkko Nikula
  2008-12-18 14:16     ` Tony Lindgren
  2008-12-18 15:17   ` [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registersfor " shekhar, chandra
  1 sibling, 1 reply; 6+ messages in thread
From: Jarkko Nikula @ 2008-12-18 13:49 UTC (permalink / raw)
  To: ext Tony Lindgren; +Cc: Lopez Cruz, Misael, linux-omap, Pandita, Vikram

On Thu, 18 Dec 2008 15:41:37 +0200
"ext Tony Lindgren" <tony@atomide.com> wrote:

> Hi,
> 
> * Lopez Cruz, Misael <x0052729@ti.com> [081218 12:16]:
> > This patch enables XCCR and RCCR McBSP register writing in OMAP 24xx/34xx
> > platforms. It also explicitly initializes those registers to their default
> > values in ASoC McBSP DAI driver.
> 
> Can you please describe a bit what these registers do? It's impossible
> for anybody to decipher without looking at the TRM right now.
> 
Agree.

> You can do the above with cpu_class_is_omap2() instead. Might be worth
> checking that these registers are available on 2420 too.
> 
No they are not. These are new registers found in 2430 and OMAP3.

> I agree with Jarkko's comment, the ASoC change should go via alsa list
> as a separate patch.
> 
Probably -mm tree would speed up this since it requires change both in
plat-omap and sound subsystems?


Jarkko

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

* Re: [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver
  2008-12-18 13:49   ` Jarkko Nikula
@ 2008-12-18 14:16     ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2008-12-18 14:16 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: Lopez Cruz, Misael, linux-omap, Pandita, Vikram

* Jarkko Nikula <jarkko.nikula@nokia.com> [081218 15:49]:
> On Thu, 18 Dec 2008 15:41:37 +0200
> "ext Tony Lindgren" <tony@atomide.com> wrote:
> 
> > Hi,
> > 
> > * Lopez Cruz, Misael <x0052729@ti.com> [081218 12:16]:
> > > This patch enables XCCR and RCCR McBSP register writing in OMAP 24xx/34xx
> > > platforms. It also explicitly initializes those registers to their default
> > > values in ASoC McBSP DAI driver.
> > 
> > Can you please describe a bit what these registers do? It's impossible
> > for anybody to decipher without looking at the TRM right now.
> > 
> Agree.
> 
> > You can do the above with cpu_class_is_omap2() instead. Might be worth
> > checking that these registers are available on 2420 too.
> > 
> No they are not. These are new registers found in 2430 and OMAP3.

OK, so then it needs to be cpu_is_omap2430().. instead.

> > I agree with Jarkko's comment, the ASoC change should go via alsa list
> > as a separate patch.
> > 
> Probably -mm tree would speed up this since it requires change both in
> plat-omap and sound subsystems?

Well sounds like we should be able to get the plat-omap change merged
during the -rc cycle via omap-fixes branch.

Regards,

Tony

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

* Re: [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registersfor McBSP DAI driver
  2008-12-18 13:41 ` Tony Lindgren
  2008-12-18 13:49   ` Jarkko Nikula
@ 2008-12-18 15:17   ` shekhar, chandra
  1 sibling, 0 replies; 6+ messages in thread
From: shekhar, chandra @ 2008-12-18 15:17 UTC (permalink / raw)
  To: Tony Lindgren, Lopez Cruz, Misael; +Cc: linux-omap, Pandita, Vikram


----- Original Message ----- 
From: "Tony Lindgren" <tony@atomide.com>
To: "Lopez Cruz, Misael" <x0052729@ti.com>
Cc: <linux-omap@vger.kernel.org>; "Pandita, Vikram" <vikram.pandita@ti.com>
Sent: Thursday, December 18, 2008 7:11 PM
Subject: Re: [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registersfor 
McBSP DAI driver


> Hi,
>
> * Lopez Cruz, Misael <x0052729@ti.com> [081218 12:16]:
>> This patch enables XCCR and RCCR McBSP register writing in OMAP 24xx/34xx
>> platforms. It also explicitly initializes those registers to their default
>> values in ASoC McBSP DAI driver.
>
> Can you please describe a bit what these registers do? It's impossible
> for anybody to decipher without looking at the TRM right now.
>
>> Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
>> ---
>>  arch/arm/plat-omap/include/mach/mcbsp.h |    6 ++++++
>>  arch/arm/plat-omap/mcbsp.c              |    4 ++++
>>  sound/soc/omap/omap-mcbsp.c             |    4 ++++
>>  3 files changed, 14 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h 
>> b/arch/arm/plat-omap/include/mach/mcbsp.h
>> index 6a0d1a0..5885f3a 100644
>> --- a/arch/arm/plat-omap/include/mach/mcbsp.h
>> +++ b/arch/arm/plat-omap/include/mach/mcbsp.h
>> @@ -231,11 +231,16 @@
>>  #define XPBBLK(value) ((value)<<7) /* Bits 7:8 */
>>
>>  /*********************** McBSP XCCR bit definitions 
>> *************************/
>> +#define EXTCLKGATE 0x8000
>> +#define PPCONNECT 0x4000
>> +#define DXENDLY(value) ((value)<<12) /* Bits 12:13 */
>> +#define XFULL_CYCLE 0x0800
>>  #define DILB 0x0020
>>  #define XDMAEN 0x0008
>>  #define XDISABLE 0x0001
>>
>>  /********************** McBSP RCCR bit definitions 
>> *************************/
>> +#define RFULL_CYCLE 0x0800
>>  #define RDMAEN 0x0008
>>  #define RDISABLE 0x0001
>>
>> @@ -267,6 +271,8 @@ struct omap_mcbsp_reg_cfg {
>>  u16 rcerh;
>>  u16 xcerg;
>>  u16 xcerh;
>> + u16 xccr;
>> + u16 rccr;
>>  };
>>

i believe these  register width should be defined as 32 bits instead of 16, 
while read/write function will take care 16 or 32 bit write
depending on cpu.

>>  typedef enum {
>> diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
>> index af33fc7..d71b30b 100644
>> --- a/arch/arm/plat-omap/mcbsp.c
>> +++ b/arch/arm/plat-omap/mcbsp.c
>> @@ -173,6 +173,10 @@ void omap_mcbsp_config(unsigned int id, const struct 
>> omap_mcbsp_reg_cfg *config)
>>  OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2);
>>  OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1);
>>  OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0);
>> + if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
>> + OMAP_MCBSP_WRITE(io_base, XCCR, config->xccr);
>> + OMAP_MCBSP_WRITE(io_base, RCCR, config->rccr);
>> + }
>>  }
>>  EXPORT_SYMBOL(omap_mcbsp_config);
>>
>
> You can do the above with cpu_class_is_omap2() instead. Might be worth
> checking that these registers are available on 2420 too.
>
>> diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
>> index 8485a8a..2e7000d 100644
>> --- a/sound/soc/omap/omap-mcbsp.c
>> +++ b/sound/soc/omap/omap-mcbsp.c
>> @@ -295,6 +295,10 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai 
>> *cpu_dai,
>>  regs->spcr1 |= RINTM(3);
>>  regs->rcr2 |= RFIG;
>>  regs->xcr2 |= XFIG;
>> + if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
>> + regs->xccr = DXENDLY(1) | XDMAEN;
>> + regs->rccr = RFULL_CYCLE | RDMAEN;
>> + }
>>
>>  switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
>>  case SND_SOC_DAIFMT_I2S:
>> -- 
>
> I agree with Jarkko's comment, the ASoC change should go via alsa list
> as a separate patch.
>
> Regards,
>
> Tony
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

end of thread, other threads:[~2008-12-18 15:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-18 10:15 [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registers for McBSP DAI driver Lopez Cruz, Misael
2008-12-18 12:51 ` Jarkko Nikula
2008-12-18 13:41 ` Tony Lindgren
2008-12-18 13:49   ` Jarkko Nikula
2008-12-18 14:16     ` Tony Lindgren
2008-12-18 15:17   ` [PATCH] ARM: OMAP3: Initialize XCCR and RCCR McBSP registersfor " shekhar, chandra

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.