Skip to contentSkip to conversation

ASoC: omap-mcbsp: CPU version check changes

PATCH In review Peter Ujfalusi 3 participants 6 messages Jan 17, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ASoC: omap-mcbsp: CPU version check changes

Hello,

The following patches changes the way we check CPU versions to enable different features (FIFO, and some register differencies). In this way we are not going to need to change (and bloat) the checks for future versions of OMAP.

Regards,
Peter

---
Peter Ujfalusi (2):
ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO
ASoC: omap-mcbsp: Use future proof OMAP version checks for
configuration

 sound/soc/omap/omap-mcbsp.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.8.3
#1 lore raw

PATCH 1/2 ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO

Quoted 1 line

From OMAP3 onwards the McBSP ports have FIFO. To avoid adding supported

SoC families to the list we can just rule out the omap24xx SoCs.

---
 sound/soc/omap/omap-mcbsp.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
sound/soc/omap/omap-mcbsp.c +6 -5
index 0173719..56333d5 100644
@@ -132,9 +132,10 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
 		err = omap_mcbsp_request(bus_id);
 
 	/*
-	 * OMAP3 McBSP FIFO is word structured.
-	 * McBSP2 has 1024 + 256 = 1280 word long buffer,
-	 * McBSP1,3,4,5 has 128 word long buffer
+	 * There is a FIFO in OMAP3 and newer SoCs for McBSP. This FIFO is word
+	 * structured.
+	 * OMAP3 McBSP2 has 1024 + 256 = 1280 word long buffer,
+	 * All other McBSP port has 128 word long buffer.
 	 * This means that the size of the FIFO depends on the sample format.
 	 * For example on McBSP3:
 	 * 16bit samples: size is 128 * 2 = 256 bytes
@@ -146,7 +147,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream,
 	 * 2 channels (stereo): size is 128 / 2 = 64 frames (2 * 64 words)
 	 * 4 channels: size is 128 / 4 = 32 frames (4 * 32 words)
 	 */
-	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+	if (cpu_class_is_omap2() && !cpu_is_omap24xx()) {
 		/*
 		* Rule for the buffer size. We should not allow
 		* smaller buffer than the FIFO size to avoid underruns
@@ -258,7 +259,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
 	default:
 		return -EINVAL;
 	}
-	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
+	if (cpu_class_is_omap2() && !cpu_is_omap24xx()) {
 		dma_data->set_threshold = omap_mcbsp_set_threshold;
 		/* TODO: Currently, MODE_ELEMENT == MODE_FRAME */
 		if (omap_mcbsp_get_dma_op_mode(bus_id) ==
Signature · 1 line
1.7.8.3
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO

Quoted 2 lines · Peter Ujfalusi

From OMAP3 onwards the McBSP ports have FIFO. To avoid adding supported SoC families to the list we can just rule out the omap24xx SoCs.

#3 lore raw

PATCH 2/2 ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration

In reply to Peter Ujfalusi

Change the cpu_is_ checks so that we do not need to change them when new SoC is available.

---
 sound/soc/omap/omap-mcbsp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/omap/omap-mcbsp.c +2 -2
index 56333d5..4c3218f 100644
@@ -416,11 +416,11 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai,
 	regs->spcr2	|= XINTM(3) | FREE;
 	regs->spcr1	|= RINTM(3);
 	/* RFIG and XFIG are not defined in 34xx */
-	if (!cpu_is_omap34xx() && !cpu_is_omap44xx()) {
+	if (cpu_class_is_omap1() || cpu_is_omap24xx()) {
 		regs->rcr2	|= RFIG;
 		regs->xcr2	|= XFIG;
 	}
-	if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) {
+	if (cpu_class_is_omap2() && !cpu_is_omap242x()) {
 		regs->xccr = DXENDLY(1) | XDMAEN | XDISABLE;
 		regs->rccr = RFULL_CYCLE | RDMAEN | RDISABLE;
 	}
Signature · 1 line
1.7.8.3
Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration

Quoted 2 lines · Peter Ujfalusi

Change the cpu_is_ checks so that we do not need to change them when new SoC is available.

Acked-by on the v1 series
#5 lore raw
In reply to Peter Ujfalusi
Quoted 7 lines · Peter Ujfalusi

Hello,

The following patches changes the way we check CPU versions to enable different features (FIFO, and some register differencies). In this way we are not going to need to change (and bloat) the checks for future versions of OMAP.

While we understand this is only a half step better than currently but better than adding new cpu_is_omap4+ tests so for both: