All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes
@ 2012-01-17 13:16 Peter Ujfalusi
  2012-01-17 13:16 ` [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO Peter Ujfalusi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Ujfalusi @ 2012-01-17 13:16 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Jarkko Nikula

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(-)

-- 
1.7.8.3

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

* [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO
  2012-01-17 13:16 [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes Peter Ujfalusi
@ 2012-01-17 13:16 ` Peter Ujfalusi
  2012-01-17 15:42   ` Mark Brown
  2012-01-17 13:16 ` [PATCH 2/2] ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration Peter Ujfalusi
  2012-01-17 13:49 ` [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes Jarkko Nikula
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Ujfalusi @ 2012-01-17 13:16 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Jarkko Nikula

>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.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-mcbsp.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 0173719..56333d5 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -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) ==
-- 
1.7.8.3

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

* [PATCH 2/2] ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration
  2012-01-17 13:16 [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes Peter Ujfalusi
  2012-01-17 13:16 ` [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO Peter Ujfalusi
@ 2012-01-17 13:16 ` Peter Ujfalusi
  2012-01-17 15:43   ` Mark Brown
  2012-01-17 13:49 ` [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes Jarkko Nikula
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Ujfalusi @ 2012-01-17 13:16 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Jarkko Nikula

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

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/omap-mcbsp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 56333d5..4c3218f 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -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;
 	}
-- 
1.7.8.3

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

* Re: [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes
  2012-01-17 13:16 [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes Peter Ujfalusi
  2012-01-17 13:16 ` [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO Peter Ujfalusi
  2012-01-17 13:16 ` [PATCH 2/2] ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration Peter Ujfalusi
@ 2012-01-17 13:49 ` Jarkko Nikula
  2 siblings, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2012-01-17 13:49 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, Mark Brown, Liam Girdwood

On 01/17/2012 03:16 PM, Peter Ujfalusi wrote:
> 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:

Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>

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

* Re: [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO
  2012-01-17 13:16 ` [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO Peter Ujfalusi
@ 2012-01-17 15:42   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-01-17 15:42 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood, Jarkko Nikula

On Tue, Jan 17, 2012 at 02:16:09PM +0100, Peter Ujfalusi wrote:
> 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.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

* Re: [PATCH 2/2] ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration
  2012-01-17 13:16 ` [PATCH 2/2] ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration Peter Ujfalusi
@ 2012-01-17 15:43   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-01-17 15:43 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood, Jarkko Nikula

On Tue, Jan 17, 2012 at 02:16:10PM +0100, Peter Ujfalusi wrote:
> Change the cpu_is_ checks so that we do not need to change them when new
> SoC is available.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

end of thread, other threads:[~2012-01-17 15:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 13:16 [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes Peter Ujfalusi
2012-01-17 13:16 ` [PATCH 1/2] ASoC: omap-mcbsp: Simplify checks for McBSP IP with FIFO Peter Ujfalusi
2012-01-17 15:42   ` Mark Brown
2012-01-17 13:16 ` [PATCH 2/2] ASoC: omap-mcbsp: Use future proof OMAP version checks for configuration Peter Ujfalusi
2012-01-17 15:43   ` Mark Brown
2012-01-17 13:49 ` [PATCH 0/2] ASoC: omap-mcbsp: CPU version check changes Jarkko Nikula

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.