Skip to content

Commit

Permalink
ASoC: fsl-esai: Update to modern clocking terminology
Browse files Browse the repository at this point in the history
As part of moving to remove the old style defines for the bus clocks update
the fsl-esai driver to use more modern terminology for clocking.

Signed-off-by: Mark Brown <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
broonie committed Sep 22, 2021
1 parent 2757b34 commit e0b64fa
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions sound/soc/fsl/fsl_esai.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct fsl_esai_soc_data {
* @sck_rate: clock rate of desired SCKx clock
* @hck_dir: the direction of HCKx pads
* @sck_div: if using PSR/PM dividers for SCKx clock
* @slave_mode: if fully using DAI slave mode
* @consumer_mode: if fully using DAI clock consumer mode
* @synchronous: if using tx/rx synchronous mode
* @name: driver name
*/
Expand All @@ -78,7 +78,7 @@ struct fsl_esai {
u32 sck_rate[2];
bool hck_dir[2];
bool sck_div[2];
bool slave_mode;
bool consumer_mode;
bool synchronous;
char name[32];
};
Expand Down Expand Up @@ -366,8 +366,8 @@ static int fsl_esai_set_bclk(struct snd_soc_dai *dai, bool tx, u32 freq)
u32 sub, ratio = hck_rate / freq;
int ret;

/* Don't apply for fully slave mode or unchanged bclk */
if (esai_priv->slave_mode || esai_priv->sck_rate[tx] == freq)
/* Don't apply for fully consumer mode or unchanged bclk */
if (esai_priv->consumer_mode || esai_priv->sck_rate[tx] == freq)
return 0;

if (ratio * freq > hck_rate)
Expand Down Expand Up @@ -476,20 +476,20 @@ static int fsl_esai_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return -EINVAL;
}

esai_priv->slave_mode = false;
esai_priv->consumer_mode = false;

/* DAI clock master masks */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
esai_priv->slave_mode = true;
/* DAI clock provider masks */
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBP_CFP:
esai_priv->consumer_mode = true;
break;
case SND_SOC_DAIFMT_CBS_CFM:
case SND_SOC_DAIFMT_CBC_CFP:
xccr |= ESAI_xCCR_xCKD;
break;
case SND_SOC_DAIFMT_CBM_CFS:
case SND_SOC_DAIFMT_CBP_CFC:
xccr |= ESAI_xCCR_xFSD;
break;
case SND_SOC_DAIFMT_CBS_CFS:
case SND_SOC_DAIFMT_CBC_CFC:
xccr |= ESAI_xCCR_xFSD | ESAI_xCCR_xCKD;
break;
default:
Expand Down Expand Up @@ -1016,8 +1016,8 @@ static int fsl_esai_probe(struct platform_device *pdev)
/* Set a default slot number */
esai_priv->slots = 2;

/* Set a default master/slave state */
esai_priv->slave_mode = true;
/* Set a default clock provider state */
esai_priv->consumer_mode = true;

/* Determine the FIFO depth */
iprop = of_get_property(np, "fsl,fifo-depth", NULL);
Expand Down

0 comments on commit e0b64fa

Please sign in to comment.