Commit 6d260880 authored by Mark Brown's avatar Mark Brown

ASoC: es8328: Use modern ASoC DAI format terminology

As part of moving to remove the old style defines for the bus clocks update
the es8328 driver to use more modern terminology for clocking.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220222223534.3212743-1-broonie@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 58d858ae
......@@ -84,7 +84,7 @@ struct es8328_priv {
int mclkdiv2;
const struct snd_pcm_hw_constraint_list *sysclk_constraints;
const int *mclk_ratios;
bool master;
bool provider;
struct regulator_bulk_data supplies[ES8328_SUPPLY_NUM];
};
......@@ -462,7 +462,7 @@ static int es8328_startup(struct snd_pcm_substream *substream,
struct snd_soc_component *component = dai->component;
struct es8328_priv *es8328 = snd_soc_component_get_drvdata(component);
if (es8328->master && es8328->sysclk_constraints)
if (es8328->provider && es8328->sysclk_constraints)
snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_RATE,
es8328->sysclk_constraints);
......@@ -486,7 +486,7 @@ static int es8328_hw_params(struct snd_pcm_substream *substream,
else
reg = ES8328_ADCCONTROL5;
if (es8328->master) {
if (es8328->provider) {
if (!es8328->sysclk_constraints) {
dev_err(component->dev, "No MCLK configured\n");
return -EINVAL;
......@@ -590,19 +590,19 @@ static int es8328_set_dai_fmt(struct snd_soc_dai *codec_dai,
u8 dac_mode = 0;
u8 adc_mode = 0;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBP_CFP:
/* Master serial port mode, with BCLK generated automatically */
snd_soc_component_update_bits(component, ES8328_MASTERMODE,
ES8328_MASTERMODE_MSC,
ES8328_MASTERMODE_MSC);
es8328->master = true;
es8328->provider = true;
break;
case SND_SOC_DAIFMT_CBS_CFS:
case SND_SOC_DAIFMT_CBC_CFC:
/* Slave serial port mode */
snd_soc_component_update_bits(component, ES8328_MASTERMODE,
ES8328_MASTERMODE_MSC, 0);
es8328->master = false;
es8328->provider = false;
break;
default:
return -EINVAL;
......
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