[alsa-devel] [PATCH 0/2] 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(-)
_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) ==
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
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; }
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
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
participants (3)
-
Jarkko Nikula
-
Mark Brown
-
Peter Ujfalusi