Commit 316cd941 authored by Mark Brown's avatar Mark Brown

ASoC: es7241: Use modern ASoC DAI format terminology

As part of moving to remove the old style defines for the bus clocks update
the es7241 driver to use more modern terminology for clocking.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220222223300.3120298-1-broonie@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 677c90ba
...@@ -29,7 +29,7 @@ struct es7241_data { ...@@ -29,7 +29,7 @@ struct es7241_data {
struct gpio_desc *m1; struct gpio_desc *m1;
unsigned int fmt; unsigned int fmt;
unsigned int mclk; unsigned int mclk;
bool is_slave; bool is_consumer;
const struct es7241_chip *chip; const struct es7241_chip *chip;
}; };
...@@ -46,9 +46,9 @@ static void es7241_set_mode(struct es7241_data *priv, int m0, int m1) ...@@ -46,9 +46,9 @@ static void es7241_set_mode(struct es7241_data *priv, int m0, int m1)
gpiod_set_value_cansleep(priv->reset, 1); gpiod_set_value_cansleep(priv->reset, 1);
} }
static int es7241_set_slave_mode(struct es7241_data *priv, static int es7241_set_consumer_mode(struct es7241_data *priv,
const struct es7241_clock_mode *mode, const struct es7241_clock_mode *mode,
unsigned int mfs) unsigned int mfs)
{ {
int j; int j;
...@@ -67,9 +67,9 @@ static int es7241_set_slave_mode(struct es7241_data *priv, ...@@ -67,9 +67,9 @@ static int es7241_set_slave_mode(struct es7241_data *priv,
return 0; return 0;
} }
static int es7241_set_master_mode(struct es7241_data *priv, static int es7241_set_provider_mode(struct es7241_data *priv,
const struct es7241_clock_mode *mode, const struct es7241_clock_mode *mode,
unsigned int mfs) unsigned int mfs)
{ {
/* /*
* We can't really set clock ratio, if the mclk/lrclk is different * We can't really set clock ratio, if the mclk/lrclk is different
...@@ -98,10 +98,10 @@ static int es7241_hw_params(struct snd_pcm_substream *substream, ...@@ -98,10 +98,10 @@ static int es7241_hw_params(struct snd_pcm_substream *substream,
if (rate < mode->rate_min || rate >= mode->rate_max) if (rate < mode->rate_min || rate >= mode->rate_max)
continue; continue;
if (priv->is_slave) if (priv->is_consumer)
return es7241_set_slave_mode(priv, mode, mfs); return es7241_set_consumer_mode(priv, mode, mfs);
else else
return es7241_set_master_mode(priv, mode, mfs); return es7241_set_provider_mode(priv, mode, mfs);
} }
/* should not happen */ /* should not happen */
...@@ -136,12 +136,12 @@ static int es7241_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -136,12 +136,12 @@ static int es7241_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return -EINVAL; return -EINVAL;
} }
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:
priv->is_slave = true; priv->is_consumer = true;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_CBP_CFP:
priv->is_slave = false; priv->is_consumer = false;
break; break;
default: default:
......
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