mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
ASoC: fix pxa-ssp compiling issue under mach-mmp
pxa-ssp.c uses API like cpu_is_pxa3xx(), cpu_is_pxa2xx(), which is defined under arch-pxa architecture, and drivers under mach-mmp can't find it. so just use ssp->type to replace that API. Signed-off-by: Qiao Zhou <zhouqiao@marvell.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
601722157b
commit
972a55b62d
2 changed files with 12 additions and 27 deletions
|
@ -160,6 +160,7 @@ enum pxa_ssp_type {
|
||||||
PXA25x_SSP, /* pxa 210, 250, 255, 26x */
|
PXA25x_SSP, /* pxa 210, 250, 255, 26x */
|
||||||
PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */
|
PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */
|
||||||
PXA27x_SSP,
|
PXA27x_SSP,
|
||||||
|
PXA3xx_SSP,
|
||||||
PXA168_SSP,
|
PXA168_SSP,
|
||||||
PXA910_SSP,
|
PXA910_SSP,
|
||||||
CE4100_SSP,
|
CE4100_SSP,
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
#include <mach/hardware.h>
|
#include <mach/hardware.h>
|
||||||
#include <mach/dma.h>
|
#include <mach/dma.h>
|
||||||
#include <mach/audio.h>
|
|
||||||
|
|
||||||
#include "../../arm/pxa2xx-pcm.h"
|
#include "../../arm/pxa2xx-pcm.h"
|
||||||
#include "pxa-ssp.h"
|
#include "pxa-ssp.h"
|
||||||
|
@ -194,7 +193,7 @@ static void pxa_ssp_set_scr(struct ssp_device *ssp, u32 div)
|
||||||
{
|
{
|
||||||
u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0);
|
u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0);
|
||||||
|
|
||||||
if (cpu_is_pxa25x() && ssp->type == PXA25x_SSP) {
|
if (ssp->type == PXA25x_SSP) {
|
||||||
sscr0 &= ~0x0000ff00;
|
sscr0 &= ~0x0000ff00;
|
||||||
sscr0 |= ((div - 2)/2) << 8; /* 2..512 */
|
sscr0 |= ((div - 2)/2) << 8; /* 2..512 */
|
||||||
} else {
|
} else {
|
||||||
|
@ -212,7 +211,7 @@ static u32 pxa_ssp_get_scr(struct ssp_device *ssp)
|
||||||
u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0);
|
u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0);
|
||||||
u32 div;
|
u32 div;
|
||||||
|
|
||||||
if (cpu_is_pxa25x() && ssp->type == PXA25x_SSP)
|
if (ssp->type == PXA25x_SSP)
|
||||||
div = ((sscr0 >> 8) & 0xff) * 2 + 2;
|
div = ((sscr0 >> 8) & 0xff) * 2 + 2;
|
||||||
else
|
else
|
||||||
div = ((sscr0 >> 8) & 0xfff) + 1;
|
div = ((sscr0 >> 8) & 0xfff) + 1;
|
||||||
|
@ -242,7 +241,7 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
|
||||||
break;
|
break;
|
||||||
case PXA_SSP_CLK_PLL:
|
case PXA_SSP_CLK_PLL:
|
||||||
/* Internal PLL is fixed */
|
/* Internal PLL is fixed */
|
||||||
if (cpu_is_pxa25x())
|
if (ssp->type == PXA25x_SSP)
|
||||||
priv->sysclk = 1843200;
|
priv->sysclk = 1843200;
|
||||||
else
|
else
|
||||||
priv->sysclk = 13000000;
|
priv->sysclk = 13000000;
|
||||||
|
@ -266,11 +265,11 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
|
||||||
|
|
||||||
/* The SSP clock must be disabled when changing SSP clock mode
|
/* The SSP clock must be disabled when changing SSP clock mode
|
||||||
* on PXA2xx. On PXA3xx it must be enabled when doing so. */
|
* on PXA2xx. On PXA3xx it must be enabled when doing so. */
|
||||||
if (!cpu_is_pxa3xx())
|
if (ssp->type != PXA3xx_SSP)
|
||||||
clk_disable(ssp->clk);
|
clk_disable(ssp->clk);
|
||||||
val = pxa_ssp_read_reg(ssp, SSCR0) | sscr0;
|
val = pxa_ssp_read_reg(ssp, SSCR0) | sscr0;
|
||||||
pxa_ssp_write_reg(ssp, SSCR0, val);
|
pxa_ssp_write_reg(ssp, SSCR0, val);
|
||||||
if (!cpu_is_pxa3xx())
|
if (ssp->type != PXA3xx_SSP)
|
||||||
clk_enable(ssp->clk);
|
clk_enable(ssp->clk);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -294,24 +293,20 @@ static int pxa_ssp_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
|
||||||
case PXA_SSP_AUDIO_DIV_SCDB:
|
case PXA_SSP_AUDIO_DIV_SCDB:
|
||||||
val = pxa_ssp_read_reg(ssp, SSACD);
|
val = pxa_ssp_read_reg(ssp, SSACD);
|
||||||
val &= ~SSACD_SCDB;
|
val &= ~SSACD_SCDB;
|
||||||
#if defined(CONFIG_PXA3xx)
|
if (ssp->type == PXA3xx_SSP)
|
||||||
if (cpu_is_pxa3xx())
|
|
||||||
val &= ~SSACD_SCDX8;
|
val &= ~SSACD_SCDX8;
|
||||||
#endif
|
|
||||||
switch (div) {
|
switch (div) {
|
||||||
case PXA_SSP_CLK_SCDB_1:
|
case PXA_SSP_CLK_SCDB_1:
|
||||||
val |= SSACD_SCDB;
|
val |= SSACD_SCDB;
|
||||||
break;
|
break;
|
||||||
case PXA_SSP_CLK_SCDB_4:
|
case PXA_SSP_CLK_SCDB_4:
|
||||||
break;
|
break;
|
||||||
#if defined(CONFIG_PXA3xx)
|
|
||||||
case PXA_SSP_CLK_SCDB_8:
|
case PXA_SSP_CLK_SCDB_8:
|
||||||
if (cpu_is_pxa3xx())
|
if (ssp->type == PXA3xx_SSP)
|
||||||
val |= SSACD_SCDX8;
|
val |= SSACD_SCDX8;
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -337,10 +332,8 @@ static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai, int pll_id,
|
||||||
struct ssp_device *ssp = priv->ssp;
|
struct ssp_device *ssp = priv->ssp;
|
||||||
u32 ssacd = pxa_ssp_read_reg(ssp, SSACD) & ~0x70;
|
u32 ssacd = pxa_ssp_read_reg(ssp, SSACD) & ~0x70;
|
||||||
|
|
||||||
#if defined(CONFIG_PXA3xx)
|
if (ssp->type == PXA3xx_SSP)
|
||||||
if (cpu_is_pxa3xx())
|
|
||||||
pxa_ssp_write_reg(ssp, SSACDD, 0);
|
pxa_ssp_write_reg(ssp, SSACDD, 0);
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (freq_out) {
|
switch (freq_out) {
|
||||||
case 5622000:
|
case 5622000:
|
||||||
|
@ -365,11 +358,10 @@ static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai, int pll_id,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
#ifdef CONFIG_PXA3xx
|
|
||||||
/* PXA3xx has a clock ditherer which can be used to generate
|
/* PXA3xx has a clock ditherer which can be used to generate
|
||||||
* a wider range of frequencies - calculate a value for it.
|
* a wider range of frequencies - calculate a value for it.
|
||||||
*/
|
*/
|
||||||
if (cpu_is_pxa3xx()) {
|
if (ssp->type == PXA3xx_SSP) {
|
||||||
u32 val;
|
u32 val;
|
||||||
u64 tmp = 19968;
|
u64 tmp = 19968;
|
||||||
tmp *= 1000000;
|
tmp *= 1000000;
|
||||||
|
@ -386,7 +378,6 @@ static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai, int pll_id,
|
||||||
val, freq_out);
|
val, freq_out);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -590,10 +581,8 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
|
||||||
/* bit size */
|
/* bit size */
|
||||||
switch (params_format(params)) {
|
switch (params_format(params)) {
|
||||||
case SNDRV_PCM_FORMAT_S16_LE:
|
case SNDRV_PCM_FORMAT_S16_LE:
|
||||||
#ifdef CONFIG_PXA3xx
|
if (ssp->type == PXA3xx_SSP)
|
||||||
if (cpu_is_pxa3xx())
|
|
||||||
sscr0 |= SSCR0_FPCKE;
|
sscr0 |= SSCR0_FPCKE;
|
||||||
#endif
|
|
||||||
sscr0 |= SSCR0_DataSize(16);
|
sscr0 |= SSCR0_DataSize(16);
|
||||||
break;
|
break;
|
||||||
case SNDRV_PCM_FORMAT_S24_LE:
|
case SNDRV_PCM_FORMAT_S24_LE:
|
||||||
|
@ -618,9 +607,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
|
||||||
* trying and failing a lot; some of the registers
|
* trying and failing a lot; some of the registers
|
||||||
* needed for that mode are only available on PXA3xx.
|
* needed for that mode are only available on PXA3xx.
|
||||||
*/
|
*/
|
||||||
|
if (ssp->type != PXA3xx_SSP)
|
||||||
#ifdef CONFIG_PXA3xx
|
|
||||||
if (!cpu_is_pxa3xx())
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
sspsp |= SSPSP_SFRMWDTH(width * 2);
|
sspsp |= SSPSP_SFRMWDTH(width * 2);
|
||||||
|
@ -628,9 +615,6 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
|
||||||
sspsp |= SSPSP_EDMYSTOP(3);
|
sspsp |= SSPSP_EDMYSTOP(3);
|
||||||
sspsp |= SSPSP_DMYSTOP(3);
|
sspsp |= SSPSP_DMYSTOP(3);
|
||||||
sspsp |= SSPSP_DMYSTRT(1);
|
sspsp |= SSPSP_DMYSTRT(1);
|
||||||
#else
|
|
||||||
return -EINVAL;
|
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
/* The frame width is the width the LRCLK is
|
/* The frame width is the width the LRCLK is
|
||||||
* asserted for; the delay is expressed in
|
* asserted for; the delay is expressed in
|
||||||
|
|
Loading…
Reference in a new issue