Commit 01b37e94 authored by Wolfram Sang's avatar Wolfram Sang Committed by Mark Brown

ASoC: tlv320aic32x4: always enable dividers

Dividers (such as MDAC) are always needed, independent of the codec
being I2S master or slave. Needed on a custom board where the codec has
to be slave.
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Acked-by: default avatarJavier Martin <javier.martin@vista-silicon.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent bb362e2e
...@@ -60,7 +60,6 @@ struct aic32x4_rate_divs { ...@@ -60,7 +60,6 @@ struct aic32x4_rate_divs {
struct aic32x4_priv { struct aic32x4_priv {
u32 sysclk; u32 sysclk;
s32 master;
u8 page_no; u8 page_no;
void *control_data; void *control_data;
u32 power_cfg; u32 power_cfg;
...@@ -369,7 +368,6 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai, ...@@ -369,7 +368,6 @@ static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{ {
struct snd_soc_codec *codec = codec_dai->codec; struct snd_soc_codec *codec = codec_dai->codec;
struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
u8 iface_reg_1; u8 iface_reg_1;
u8 iface_reg_2; u8 iface_reg_2;
u8 iface_reg_3; u8 iface_reg_3;
...@@ -384,11 +382,9 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -384,11 +382,9 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
/* set master/slave audio interface */ /* set master/slave audio interface */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBM_CFM:
aic32x4->master = 1;
iface_reg_1 |= AIC32X4_BCLKMASTER | AIC32X4_WCLKMASTER; iface_reg_1 |= AIC32X4_BCLKMASTER | AIC32X4_WCLKMASTER;
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBS_CFS:
aic32x4->master = 0;
break; break;
default: default:
printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n"); printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n");
...@@ -526,11 +522,8 @@ static int aic32x4_mute(struct snd_soc_dai *dai, int mute) ...@@ -526,11 +522,8 @@ static int aic32x4_mute(struct snd_soc_dai *dai, int mute)
static int aic32x4_set_bias_level(struct snd_soc_codec *codec, static int aic32x4_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level) enum snd_soc_bias_level level)
{ {
struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
switch (level) { switch (level) {
case SND_SOC_BIAS_ON: case SND_SOC_BIAS_ON:
if (aic32x4->master) {
/* Switch on PLL */ /* Switch on PLL */
snd_soc_update_bits(codec, AIC32X4_PLLPR, snd_soc_update_bits(codec, AIC32X4_PLLPR,
AIC32X4_PLLEN, AIC32X4_PLLEN); AIC32X4_PLLEN, AIC32X4_PLLEN);
...@@ -554,12 +547,10 @@ static int aic32x4_set_bias_level(struct snd_soc_codec *codec, ...@@ -554,12 +547,10 @@ static int aic32x4_set_bias_level(struct snd_soc_codec *codec,
/* Switch on BCLK_N Divider */ /* Switch on BCLK_N Divider */
snd_soc_update_bits(codec, AIC32X4_BCLKN, snd_soc_update_bits(codec, AIC32X4_BCLKN,
AIC32X4_BCLKEN, AIC32X4_BCLKEN); AIC32X4_BCLKEN, AIC32X4_BCLKEN);
}
break; break;
case SND_SOC_BIAS_PREPARE: case SND_SOC_BIAS_PREPARE:
break; break;
case SND_SOC_BIAS_STANDBY: case SND_SOC_BIAS_STANDBY:
if (aic32x4->master) {
/* Switch off PLL */ /* Switch off PLL */
snd_soc_update_bits(codec, AIC32X4_PLLPR, snd_soc_update_bits(codec, AIC32X4_PLLPR,
AIC32X4_PLLEN, 0); AIC32X4_PLLEN, 0);
...@@ -583,7 +574,6 @@ static int aic32x4_set_bias_level(struct snd_soc_codec *codec, ...@@ -583,7 +574,6 @@ static int aic32x4_set_bias_level(struct snd_soc_codec *codec,
/* Switch off BCLK_N Divider */ /* Switch off BCLK_N Divider */
snd_soc_update_bits(codec, AIC32X4_BCLKN, snd_soc_update_bits(codec, AIC32X4_BCLKN,
AIC32X4_BCLKEN, 0); AIC32X4_BCLKEN, 0);
}
break; break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment