mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ASoC: remove duplicated code on pxa-ssp.c
* We don't need to write the registers twice, remove the first write. * DAIFMT_INV switch is duplicated inside DAIFMT_FORMAT switch, move it out. (This patch is for Mark's for-2.6.32 branch, I have not checked if the code is duplicated on current 2.6.30) Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
46f5822f78
commit
fa44c077eb
1 changed files with 15 additions and 35 deletions
|
@ -457,31 +457,27 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssp_write_reg(ssp, SSCR0, sscr0);
|
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
|
||||||
ssp_write_reg(ssp, SSCR1, sscr1);
|
case SND_SOC_DAIFMT_NB_NF:
|
||||||
ssp_write_reg(ssp, SSPSP, sspsp);
|
sspsp |= SSPSP_SFRMP;
|
||||||
|
break;
|
||||||
|
case SND_SOC_DAIFMT_NB_IF:
|
||||||
|
break;
|
||||||
|
case SND_SOC_DAIFMT_IB_IF:
|
||||||
|
sspsp |= SSPSP_SCMODE(2);
|
||||||
|
break;
|
||||||
|
case SND_SOC_DAIFMT_IB_NF:
|
||||||
|
sspsp |= SSPSP_SCMODE(2) | SSPSP_SFRMP;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
|
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
|
||||||
case SND_SOC_DAIFMT_I2S:
|
case SND_SOC_DAIFMT_I2S:
|
||||||
sscr0 |= SSCR0_PSP;
|
sscr0 |= SSCR0_PSP;
|
||||||
sscr1 |= SSCR1_RWOT | SSCR1_TRAIL;
|
sscr1 |= SSCR1_RWOT | SSCR1_TRAIL;
|
||||||
|
|
||||||
/* See hw_params() */
|
/* See hw_params() */
|
||||||
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
|
|
||||||
case SND_SOC_DAIFMT_NB_NF:
|
|
||||||
sspsp |= SSPSP_SFRMP;
|
|
||||||
break;
|
|
||||||
case SND_SOC_DAIFMT_NB_IF:
|
|
||||||
break;
|
|
||||||
case SND_SOC_DAIFMT_IB_IF:
|
|
||||||
sspsp |= SSPSP_SCMODE(2);
|
|
||||||
break;
|
|
||||||
case SND_SOC_DAIFMT_IB_NF:
|
|
||||||
sspsp |= SSPSP_SCMODE(2) | SSPSP_SFRMP;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SND_SOC_DAIFMT_DSP_A:
|
case SND_SOC_DAIFMT_DSP_A:
|
||||||
|
@ -489,22 +485,6 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
|
||||||
case SND_SOC_DAIFMT_DSP_B:
|
case SND_SOC_DAIFMT_DSP_B:
|
||||||
sscr0 |= SSCR0_MOD | SSCR0_PSP;
|
sscr0 |= SSCR0_MOD | SSCR0_PSP;
|
||||||
sscr1 |= SSCR1_TRAIL | SSCR1_RWOT;
|
sscr1 |= SSCR1_TRAIL | SSCR1_RWOT;
|
||||||
|
|
||||||
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
|
|
||||||
case SND_SOC_DAIFMT_NB_NF:
|
|
||||||
sspsp |= SSPSP_SFRMP;
|
|
||||||
break;
|
|
||||||
case SND_SOC_DAIFMT_NB_IF:
|
|
||||||
break;
|
|
||||||
case SND_SOC_DAIFMT_IB_IF:
|
|
||||||
sspsp |= SSPSP_SCMODE(2);
|
|
||||||
break;
|
|
||||||
case SND_SOC_DAIFMT_IB_NF:
|
|
||||||
sspsp |= SSPSP_SCMODE(2) | SSPSP_SFRMP;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue