Commit e288179d authored by Mark Brown's avatar Mark Brown

ASoC: DAI clocking terminology modernisation

Merge series from Mark Brown <broonie@kernel.org>:

Update the last batch of CODEC drivers without specific
maintainers to use the new defines for DAI clocking.
parents 336a2d93 894bf75b
...@@ -710,22 +710,19 @@ static int cx2072x_config_i2spcm(struct cx2072x_priv *cx2072x) ...@@ -710,22 +710,19 @@ static int cx2072x_config_i2spcm(struct cx2072x_priv *cx2072x)
regdbt2.ulval = 0xac; regdbt2.ulval = 0xac;
/* set master/slave */ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBP_CFP:
case SND_SOC_DAIFMT_CBM_CFM:
reg2.r.tx_master = 1; reg2.r.tx_master = 1;
reg3.r.rx_master = 1; reg3.r.rx_master = 1;
dev_dbg(dev, "Sets Master mode\n");
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
reg2.r.tx_master = 0; reg2.r.tx_master = 0;
reg3.r.rx_master = 0; reg3.r.rx_master = 0;
dev_dbg(dev, "Sets Slave mode\n");
break; break;
default: default:
dev_err(dev, "Unsupported DAI master mode\n"); dev_err(dev, "Unsupported DAI clocking mode\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1009,9 +1006,9 @@ static int cx2072x_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -1009,9 +1006,9 @@ static int cx2072x_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
dev_dbg(dev, "set_dai_fmt- %08x\n", fmt); dev_dbg(dev, "set_dai_fmt- %08x\n", fmt);
/* set master/slave */ /* set master/slave */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBP_CFP:
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
break; break;
default: default:
......
...@@ -1591,9 +1591,9 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai, ...@@ -1591,9 +1591,9 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
cdata->fmt = fmt; cdata->fmt = fmt;
regval = 0; regval = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
/* Set to slave mode PLL - MAS mode off */ /* Set to consumer mode PLL - MAS mode off */
snd_soc_component_write(component, snd_soc_component_write(component,
M98090_REG_CLOCK_RATIO_NI_MSB, 0x00); M98090_REG_CLOCK_RATIO_NI_MSB, 0x00);
snd_soc_component_write(component, snd_soc_component_write(component,
...@@ -1602,8 +1602,8 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai, ...@@ -1602,8 +1602,8 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
M98090_USE_M1_MASK, 0); M98090_USE_M1_MASK, 0);
max98090->master = false; max98090->master = false;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBP_CFP:
/* Set to master mode */ /* Set to provider mode */
if (max98090->tdm_slots == 4) { if (max98090->tdm_slots == 4) {
/* TDM */ /* TDM */
regval |= M98090_MAS_MASK | regval |= M98090_MAS_MASK |
...@@ -1619,8 +1619,6 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai, ...@@ -1619,8 +1619,6 @@ static int max98090_dai_set_fmt(struct snd_soc_dai *codec_dai,
} }
max98090->master = true; max98090->master = true;
break; break;
case SND_SOC_DAIFMT_CBS_CFM:
case SND_SOC_DAIFMT_CBM_CFS:
default: default:
dev_err(component->dev, "DAI clock mode unsupported"); dev_err(component->dev, "DAI clock mode unsupported");
return -EINVAL; return -EINVAL;
......
...@@ -69,11 +69,11 @@ static int rk3328_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -69,11 +69,11 @@ static int rk3328_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
snd_soc_component_get_drvdata(dai->component); snd_soc_component_get_drvdata(dai->component);
unsigned int val; unsigned int val;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
val = PIN_DIRECTION_IN | DAC_I2S_MODE_SLAVE; val = PIN_DIRECTION_IN | DAC_I2S_MODE_SLAVE;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBP_CFP:
val = PIN_DIRECTION_OUT | DAC_I2S_MODE_MASTER; val = PIN_DIRECTION_OUT | DAC_I2S_MODE_MASTER;
break; break;
default: default:
......
...@@ -601,8 +601,8 @@ static int sta32x_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -601,8 +601,8 @@ static int sta32x_set_dai_fmt(struct snd_soc_dai *codec_dai,
struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component); struct sta32x_priv *sta32x = snd_soc_component_get_drvdata(component);
u8 confb = 0; u8 confb = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
...@@ -630,8 +630,8 @@ static int sta350_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -630,8 +630,8 @@ static int sta350_set_dai_fmt(struct snd_soc_dai *codec_dai,
struct sta350_priv *sta350 = snd_soc_component_get_drvdata(component); struct sta350_priv *sta350 = snd_soc_component_get_drvdata(component);
unsigned int confb = 0; unsigned int confb = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
...@@ -199,10 +199,10 @@ static int stih407_sas_dac_mute(struct snd_soc_dai *dai, int mute, int stream) ...@@ -199,10 +199,10 @@ static int stih407_sas_dac_mute(struct snd_soc_dai *dai, int mute, int stream)
static int sti_sas_spdif_set_fmt(struct snd_soc_dai *dai, static int sti_sas_spdif_set_fmt(struct snd_soc_dai *dai,
unsigned int fmt) unsigned int fmt)
{ {
if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS) { if ((fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) != SND_SOC_DAIFMT_CBC_CFC) {
dev_err(dai->component->dev, dev_err(dai->component->dev,
"%s: ERROR: Unsupporter master mask 0x%x\n", "%s: ERROR: Unsupported clocking mask 0x%x\n",
__func__, fmt & SND_SOC_DAIFMT_MASTER_MASK); __func__, fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK);
return -EINVAL; return -EINVAL;
} }
......
...@@ -347,17 +347,17 @@ static int tas2552_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -347,17 +347,17 @@ static int tas2552_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
struct tas2552_data *tas2552 = dev_get_drvdata(component->dev); struct tas2552_data *tas2552 = dev_get_drvdata(component->dev);
u8 serial_format; u8 serial_format;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
serial_format = 0x00; serial_format = 0x00;
break; break;
case SND_SOC_DAIFMT_CBS_CFM: case SND_SOC_DAIFMT_CBC_CFP:
serial_format = TAS2552_WCLKDIR; serial_format = TAS2552_WCLKDIR;
break; break;
case SND_SOC_DAIFMT_CBM_CFS: case SND_SOC_DAIFMT_CBP_CFC:
serial_format = TAS2552_BCLKDIR; serial_format = TAS2552_BCLKDIR;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBP_CFP:
serial_format = (TAS2552_BCLKDIR | TAS2552_WCLKDIR); serial_format = (TAS2552_BCLKDIR | TAS2552_WCLKDIR);
break; break;
default: default:
......
...@@ -340,11 +340,11 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -340,11 +340,11 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
u8 tdm_rx_start_slot = 0, asi_cfg_1 = 0; u8 tdm_rx_start_slot = 0, asi_cfg_1 = 0;
int ret; int ret;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
break; break;
default: default:
dev_err(tas2770->dev, "ASI format master is not found\n"); dev_err(tas2770->dev, "ASI invalid DAI clocking\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -318,7 +318,7 @@ static int tas5086_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -318,7 +318,7 @@ static int tas5086_set_dai_fmt(struct snd_soc_dai *codec_dai,
struct tas5086_private *priv = snd_soc_component_get_drvdata(component); struct tas5086_private *priv = snd_soc_component_get_drvdata(component);
/* The TAS5086 can only be slave to all clocks */ /* The TAS5086 can only be slave to all clocks */
if ((format & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS) { if ((format & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) != SND_SOC_DAIFMT_CBC_CFC) {
dev_err(component->dev, "Invalid clocking mode\n"); dev_err(component->dev, "Invalid clocking mode\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -89,8 +89,8 @@ static int tas5720_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -89,8 +89,8 @@ static int tas5720_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
u8 serial_format; u8 serial_format;
int ret; int ret;
if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS) { if ((fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) != SND_SOC_DAIFMT_CBC_CFC) {
dev_vdbg(component->dev, "DAI Format master is not found\n"); dev_vdbg(component->dev, "DAI clocking invalid\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -160,11 +160,11 @@ static int tas6424_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -160,11 +160,11 @@ static int tas6424_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
dev_dbg(component->dev, "%s() fmt=0x%0x\n", __func__, fmt); dev_dbg(component->dev, "%s() fmt=0x%0x\n", __func__, fmt);
/* clock masters */ /* clock masters */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
break; break;
default: default:
dev_err(component->dev, "Invalid DAI master/slave interface\n"); dev_err(component->dev, "Invalid DAI clocking\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -1252,8 +1252,7 @@ static int adc3xxx_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -1252,8 +1252,7 @@ static int adc3xxx_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
int master = 0; int master = 0;
int ret; int ret;
/* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBP_CFP: case SND_SOC_DAIFMT_CBP_CFP:
master = 1; master = 1;
clkdir = ADC3XXX_BCLK_MASTER | ADC3XXX_WCLK_MASTER; clkdir = ADC3XXX_BCLK_MASTER | ADC3XXX_WCLK_MASTER;
......
...@@ -713,16 +713,14 @@ static int adcx140_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -713,16 +713,14 @@ static int adcx140_set_dai_fmt(struct snd_soc_dai *codec_dai,
bool inverted_bclk = false; bool inverted_bclk = false;
/* set master/slave audio interface */ /* set master/slave audio interface */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBP_CFP:
iface_reg2 |= ADCX140_BCLK_FSYNC_MASTER; iface_reg2 |= ADCX140_BCLK_FSYNC_MASTER;
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
break; break;
case SND_SOC_DAIFMT_CBS_CFM:
case SND_SOC_DAIFMT_CBM_CFS:
default: default:
dev_err(component->dev, "Invalid DAI master/slave interface\n"); dev_err(component->dev, "Invalid DAI clock provider\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -429,12 +429,11 @@ static int tlv320aic23_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -429,12 +429,11 @@ static int tlv320aic23_set_dai_fmt(struct snd_soc_dai *codec_dai,
iface_reg = snd_soc_component_read(component, TLV320AIC23_DIGT_FMT) & (~0x03); iface_reg = snd_soc_component_read(component, TLV320AIC23_DIGT_FMT) & (~0x03);
/* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBP_CFP:
case SND_SOC_DAIFMT_CBM_CFM:
iface_reg |= TLV320AIC23_MS_MASTER; iface_reg |= TLV320AIC23_MS_MASTER;
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
iface_reg &= ~TLV320AIC23_MS_MASTER; iface_reg &= ~TLV320AIC23_MS_MASTER;
break; break;
default: default:
......
...@@ -32,7 +32,7 @@ struct aic26 { ...@@ -32,7 +32,7 @@ struct aic26 {
struct spi_device *spi; struct spi_device *spi;
struct regmap *regmap; struct regmap *regmap;
struct snd_soc_component *component; struct snd_soc_component *component;
int master; int clock_provider;
int datfm; int datfm;
int mclk; int mclk;
...@@ -117,8 +117,8 @@ static int aic26_hw_params(struct snd_pcm_substream *substream, ...@@ -117,8 +117,8 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
reg = dval << 2; reg = dval << 2;
snd_soc_component_write(component, AIC26_REG_PLL_PROG2, reg); snd_soc_component_write(component, AIC26_REG_PLL_PROG2, reg);
/* Audio Control 3 (master mode, fsref rate) */ /* Audio Control 3 (clock provider mode, fsref rate) */
if (aic26->master) if (aic26->clock_provider)
reg = 0x0800; reg = 0x0800;
if (fsref == 48000) if (fsref == 48000)
reg = 0x2000; reg = 0x2000;
...@@ -178,10 +178,9 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -178,10 +178,9 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n", dev_dbg(&aic26->spi->dev, "aic26_set_fmt(dai=%p, fmt==%i)\n",
codec_dai, fmt); codec_dai, fmt);
/* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBP_CFP: aic26->clock_provider = 1; break;
case SND_SOC_DAIFMT_CBM_CFM: aic26->master = 1; break; case SND_SOC_DAIFMT_CBC_CFC: aic26->clock_provider = 0; break;
case SND_SOC_DAIFMT_CBS_CFS: aic26->master = 0; break;
default: default:
dev_dbg(&aic26->spi->dev, "bad master\n"); return -EINVAL; dev_dbg(&aic26->spi->dev, "bad master\n"); return -EINVAL;
} }
...@@ -363,7 +362,7 @@ static int aic26_spi_probe(struct spi_device *spi) ...@@ -363,7 +362,7 @@ static int aic26_spi_probe(struct spi_device *spi)
/* Initialize the driver data */ /* Initialize the driver data */
aic26->spi = spi; aic26->spi = spi;
dev_set_drvdata(&spi->dev, aic26); dev_set_drvdata(&spi->dev, aic26);
aic26->master = 1; aic26->clock_provider = 1;
ret = devm_snd_soc_register_component(&spi->dev, ret = devm_snd_soc_register_component(&spi->dev,
&aic26_soc_component_dev, &aic26_dai, 1); &aic26_soc_component_dev, &aic26_dai, 1);
......
...@@ -1033,8 +1033,8 @@ static int aic31xx_clock_master_routes(struct snd_soc_component *component, ...@@ -1033,8 +1033,8 @@ static int aic31xx_clock_master_routes(struct snd_soc_component *component,
struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component); struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
int ret; int ret;
fmt &= SND_SOC_DAIFMT_MASTER_MASK; fmt &= SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK;
if (fmt == SND_SOC_DAIFMT_CBS_CFS && if (fmt == SND_SOC_DAIFMT_CBC_CFC &&
aic31xx->master_dapm_route_applied) { aic31xx->master_dapm_route_applied) {
/* /*
* Remove the DAPM route(s) for codec clock master modes, * Remove the DAPM route(s) for codec clock master modes,
...@@ -1051,7 +1051,7 @@ static int aic31xx_clock_master_routes(struct snd_soc_component *component, ...@@ -1051,7 +1051,7 @@ static int aic31xx_clock_master_routes(struct snd_soc_component *component,
return ret; return ret;
aic31xx->master_dapm_route_applied = false; aic31xx->master_dapm_route_applied = false;
} else if (fmt != SND_SOC_DAIFMT_CBS_CFS && } else if (fmt != SND_SOC_DAIFMT_CBC_CFC &&
!aic31xx->master_dapm_route_applied) { !aic31xx->master_dapm_route_applied) {
/* /*
* Add the needed DAPM route(s) for codec clock master modes, * Add the needed DAPM route(s) for codec clock master modes,
...@@ -1083,21 +1083,20 @@ static int aic31xx_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -1083,21 +1083,20 @@ static int aic31xx_set_dai_fmt(struct snd_soc_dai *codec_dai,
dev_dbg(component->dev, "## %s: fmt = 0x%x\n", __func__, fmt); dev_dbg(component->dev, "## %s: fmt = 0x%x\n", __func__, fmt);
/* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBP_CFP:
case SND_SOC_DAIFMT_CBM_CFM:
iface_reg1 |= AIC31XX_BCLK_MASTER | AIC31XX_WCLK_MASTER; iface_reg1 |= AIC31XX_BCLK_MASTER | AIC31XX_WCLK_MASTER;
break; break;
case SND_SOC_DAIFMT_CBS_CFM: case SND_SOC_DAIFMT_CBC_CFP:
iface_reg1 |= AIC31XX_WCLK_MASTER; iface_reg1 |= AIC31XX_WCLK_MASTER;
break; break;
case SND_SOC_DAIFMT_CBM_CFS: case SND_SOC_DAIFMT_CBP_CFC:
iface_reg1 |= AIC31XX_BCLK_MASTER; iface_reg1 |= AIC31XX_BCLK_MASTER;
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
break; break;
default: default:
dev_err(component->dev, "Invalid DAI master/slave interface\n"); dev_err(component->dev, "Invalid DAI clock provider\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -615,15 +615,14 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -615,15 +615,14 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
u8 iface_reg_2 = 0; u8 iface_reg_2 = 0;
u8 iface_reg_3 = 0; u8 iface_reg_3 = 0;
/* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBP_CFP:
case SND_SOC_DAIFMT_CBM_CFM:
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_CBC_CFC:
break; break;
default: default:
printk(KERN_ERR "aic32x4: invalid DAI master/slave interface\n"); printk(KERN_ERR "aic32x4: invalid clock provider\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -1253,22 +1253,21 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -1253,22 +1253,21 @@ static int aic3x_set_dai_fmt(struct snd_soc_dai *codec_dai,
iface_areg = snd_soc_component_read(component, AIC3X_ASD_INTF_CTRLA) & 0x3f; iface_areg = snd_soc_component_read(component, AIC3X_ASD_INTF_CTRLA) & 0x3f;
iface_breg = snd_soc_component_read(component, AIC3X_ASD_INTF_CTRLB) & 0x3f; iface_breg = snd_soc_component_read(component, AIC3X_ASD_INTF_CTRLB) & 0x3f;
/* set master/slave audio interface */ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBP_CFP:
case SND_SOC_DAIFMT_CBM_CFM:
aic3x->master = 1; aic3x->master = 1;
iface_areg |= BIT_CLK_MASTER | WORD_CLK_MASTER; iface_areg |= BIT_CLK_MASTER | WORD_CLK_MASTER;
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
aic3x->master = 0; aic3x->master = 0;
iface_areg &= ~(BIT_CLK_MASTER | WORD_CLK_MASTER); iface_areg &= ~(BIT_CLK_MASTER | WORD_CLK_MASTER);
break; break;
case SND_SOC_DAIFMT_CBM_CFS: case SND_SOC_DAIFMT_CBP_CFC:
aic3x->master = 1; aic3x->master = 1;
iface_areg |= BIT_CLK_MASTER; iface_areg |= BIT_CLK_MASTER;
iface_areg &= ~WORD_CLK_MASTER; iface_areg &= ~WORD_CLK_MASTER;
break; break;
case SND_SOC_DAIFMT_CBS_CFM: case SND_SOC_DAIFMT_CBC_CFP:
aic3x->master = 1; aic3x->master = 1;
iface_areg |= WORD_CLK_MASTER; iface_areg |= WORD_CLK_MASTER;
iface_areg &= ~BIT_CLK_MASTER; iface_areg &= ~BIT_CLK_MASTER;
......
...@@ -1317,16 +1317,14 @@ static int dac33_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -1317,16 +1317,14 @@ static int dac33_set_dai_fmt(struct snd_soc_dai *codec_dai,
aictrl_a = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_A); aictrl_a = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_A);
aictrl_b = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_B); aictrl_b = dac33_read_reg_cache(component, DAC33_SER_AUDIOIF_CTRL_B);
/* set master/slave audio interface */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBP_CFP:
/* Codec Master */
aictrl_a |= (DAC33_MSBCLK | DAC33_MSWCLK); aictrl_a |= (DAC33_MSBCLK | DAC33_MSWCLK);
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
/* Codec Slave */
if (dac33->fifo_mode) { if (dac33->fifo_mode) {
dev_err(component->dev, "FIFO mode requires master mode\n"); dev_err(component->dev, "FIFO mode requires provider mode\n");
return -EINVAL; return -EINVAL;
} else } else
aictrl_a &= ~(DAC33_MSBCLK | DAC33_MSWCLK); aictrl_a &= ~(DAC33_MSBCLK | DAC33_MSWCLK);
......
...@@ -169,7 +169,7 @@ static int uda1334_set_dai_sysclk(struct snd_soc_dai *codec_dai, ...@@ -169,7 +169,7 @@ static int uda1334_set_dai_sysclk(struct snd_soc_dai *codec_dai,
static int uda1334_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) static int uda1334_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{ {
fmt &= (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK | fmt &= (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK |
SND_SOC_DAIFMT_MASTER_MASK); SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK);
if (fmt != (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | if (fmt != (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
SND_SOC_DAIFMT_CBC_CFC)) { SND_SOC_DAIFMT_CBC_CFC)) {
......
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