Commit 4e7f0ea0 authored by David Rhodes's avatar David Rhodes Committed by Mark Brown

ASoC: cs35l3x: Use neutral language in amp drivers

Revise variable names and comments in
cs35l35 and cs35l36 amp drivers.
Signed-off-by: default avatarDavid Rhodes <drhodes@opensource.cirrus.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210525194439.2232908-1-drhodes@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6405941e
...@@ -368,16 +368,16 @@ static int cs35l35_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) ...@@ -368,16 +368,16 @@ static int cs35l35_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
struct snd_soc_component *component = codec_dai->component; struct snd_soc_component *component = codec_dai->component;
struct cs35l35_private *cs35l35 = snd_soc_component_get_drvdata(component); struct cs35l35_private *cs35l35 = snd_soc_component_get_drvdata(component);
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:
regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1, regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1,
CS35L35_MS_MASK, 1 << CS35L35_MS_SHIFT); CS35L35_MS_MASK, 1 << CS35L35_MS_SHIFT);
cs35l35->slave_mode = false; cs35l35->clock_consumer = false;
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1, regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1,
CS35L35_MS_MASK, 0 << CS35L35_MS_SHIFT); CS35L35_MS_MASK, 0 << CS35L35_MS_SHIFT);
cs35l35->slave_mode = true; cs35l35->clock_consumer = true;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -556,8 +556,8 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream, ...@@ -556,8 +556,8 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream,
} }
sp_sclks = ((cs35l35->sclk / srate) / 4) - 1; sp_sclks = ((cs35l35->sclk / srate) / 4) - 1;
/* Only certain ratios are supported in I2S Slave Mode */ /* Only certain ratios supported when device is a clock consumer */
if (cs35l35->slave_mode) { if (cs35l35->clock_consumer) {
switch (sp_sclks) { switch (sp_sclks) {
case CS35L35_SP_SCLKS_32FS: case CS35L35_SP_SCLKS_32FS:
case CS35L35_SP_SCLKS_48FS: case CS35L35_SP_SCLKS_48FS:
...@@ -568,7 +568,7 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream, ...@@ -568,7 +568,7 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
} else { } else {
/* Only certain ratios supported in I2S MASTER Mode */ /* Only certain ratios supported when device is a clock provider */
switch (sp_sclks) { switch (sp_sclks) {
case CS35L35_SP_SCLKS_32FS: case CS35L35_SP_SCLKS_32FS:
case CS35L35_SP_SCLKS_64FS: case CS35L35_SP_SCLKS_64FS:
......
...@@ -283,7 +283,7 @@ struct cs35l35_private { ...@@ -283,7 +283,7 @@ struct cs35l35_private {
int sclk; int sclk;
bool pdm_mode; bool pdm_mode;
bool i2s_mode; bool i2s_mode;
bool slave_mode; bool clock_consumer;
/* GPIO for /RST */ /* GPIO for /RST */
struct gpio_desc *reset_gpio; struct gpio_desc *reset_gpio;
struct completion pdn_done; struct completion pdn_done;
......
...@@ -756,14 +756,14 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai, ...@@ -756,14 +756,14 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai,
{ {
struct cs35l36_private *cs35l36 = struct cs35l36_private *cs35l36 =
snd_soc_component_get_drvdata(component_dai->component); snd_soc_component_get_drvdata(component_dai->component);
unsigned int asp_fmt, lrclk_fmt, sclk_fmt, slave_mode, clk_frc; unsigned int asp_fmt, lrclk_fmt, sclk_fmt, clock_provider, clk_frc;
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:
slave_mode = 1; clock_provider = 1;
break; break;
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_CBC_CFC:
slave_mode = 0; clock_provider = 0;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -771,10 +771,10 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai, ...@@ -771,10 +771,10 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai,
regmap_update_bits(cs35l36->regmap, CS35L36_ASP_TX_PIN_CTRL, regmap_update_bits(cs35l36->regmap, CS35L36_ASP_TX_PIN_CTRL,
CS35L36_SCLK_MSTR_MASK, CS35L36_SCLK_MSTR_MASK,
slave_mode << CS35L36_SCLK_MSTR_SHIFT); clock_provider << CS35L36_SCLK_MSTR_SHIFT);
regmap_update_bits(cs35l36->regmap, CS35L36_ASP_RATE_CTRL, regmap_update_bits(cs35l36->regmap, CS35L36_ASP_RATE_CTRL,
CS35L36_LRCLK_MSTR_MASK, CS35L36_LRCLK_MSTR_MASK,
slave_mode << CS35L36_LRCLK_MSTR_SHIFT); clock_provider << CS35L36_LRCLK_MSTR_SHIFT);
switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
case SND_SOC_DAIFMT_CONT: case SND_SOC_DAIFMT_CONT:
......
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