* [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers
@ 2021-05-25 19:44 David Rhodes
2021-05-25 19:58 ` Pierre-Louis Bossart
2021-05-26 20:21 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: David Rhodes @ 2021-05-25 19:44 UTC (permalink / raw)
To: alsa-devel, broonie, patches; +Cc: David Rhodes
Revise variable names and comments in
cs35l35 and cs35l36 amp drivers.
Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com>
---
sound/soc/codecs/cs35l35.c | 16 ++++++++--------
sound/soc/codecs/cs35l35.h | 2 +-
sound/soc/codecs/cs35l36.c | 16 ++++++++--------
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index f20ed838b958..f4e2dc0ed5cc 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -367,16 +367,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 cs35l35_private *cs35l35 = snd_soc_component_get_drvdata(component);
- 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:
regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1,
CS35L35_MS_MASK, 1 << CS35L35_MS_SHIFT);
- cs35l35->slave_mode = false;
+ cs35l35->clock_consumer = false;
break;
- case SND_SOC_DAIFMT_CBS_CFS:
+ case SND_SOC_DAIFMT_CBC_CFC:
regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1,
CS35L35_MS_MASK, 0 << CS35L35_MS_SHIFT);
- cs35l35->slave_mode = true;
+ cs35l35->clock_consumer = true;
break;
default:
return -EINVAL;
@@ -555,8 +555,8 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream,
}
sp_sclks = ((cs35l35->sclk / srate) / 4) - 1;
- /* Only certain ratios are supported in I2S Slave Mode */
- if (cs35l35->slave_mode) {
+ /* Only certain ratios supported when device is a clock consumer */
+ if (cs35l35->clock_consumer) {
switch (sp_sclks) {
case CS35L35_SP_SCLKS_32FS:
case CS35L35_SP_SCLKS_48FS:
@@ -567,7 +567,7 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
} else {
- /* Only certain ratios supported in I2S MASTER Mode */
+ /* Only certain ratios supported when device is a clock provider */
switch (sp_sclks) {
case CS35L35_SP_SCLKS_32FS:
case CS35L35_SP_SCLKS_64FS:
diff --git a/sound/soc/codecs/cs35l35.h b/sound/soc/codecs/cs35l35.h
index ffb154cd962c..2e69fef318e3 100644
--- a/sound/soc/codecs/cs35l35.h
+++ b/sound/soc/codecs/cs35l35.h
@@ -282,7 +282,7 @@ struct cs35l35_private {
int sclk;
bool pdm_mode;
bool i2s_mode;
- bool slave_mode;
+ bool clock_consumer;
/* GPIO for /RST */
struct gpio_desc *reset_gpio;
struct completion pdn_done;
diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index a038bcec2d17..895ceed12cd9 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -756,14 +756,14 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai,
{
struct cs35l36_private *cs35l36 =
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) {
- case SND_SOC_DAIFMT_CBM_CFM:
- slave_mode = 1;
+ switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
+ case SND_SOC_DAIFMT_CBP_CFP:
+ clock_provider = 1;
break;
- case SND_SOC_DAIFMT_CBS_CFS:
- slave_mode = 0;
+ case SND_SOC_DAIFMT_CBC_CFC:
+ clock_provider = 0;
break;
default:
return -EINVAL;
@@ -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,
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,
CS35L36_LRCLK_MSTR_MASK,
- slave_mode << CS35L36_LRCLK_MSTR_SHIFT);
+ clock_provider << CS35L36_LRCLK_MSTR_SHIFT);
switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
case SND_SOC_DAIFMT_CONT:
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers
2021-05-25 19:44 [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers David Rhodes
@ 2021-05-25 19:58 ` Pierre-Louis Bossart
2021-05-26 20:21 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2021-05-25 19:58 UTC (permalink / raw)
To: David Rhodes, alsa-devel, broonie, patches
On 5/25/21 2:44 PM, David Rhodes wrote:
> Revise variable names and comments in
> cs35l35 and cs35l36 amp drivers.
>
> Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers
2021-05-25 19:44 [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers David Rhodes
2021-05-25 19:58 ` Pierre-Louis Bossart
@ 2021-05-26 20:21 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2021-05-26 20:21 UTC (permalink / raw)
To: alsa-devel, patches, David Rhodes; +Cc: broonie, Mark, Brown
From: Mark Brown,,, <broonie@kernel.org>
On Tue, 25 May 2021 14:44:39 -0500, David Rhodes wrote:
> Revise variable names and comments in
> cs35l35 and cs35l36 amp drivers.
Applied, thanks!
[1/1] ASoC: cs35l3x: Use neutral language in amp drivers
commit: 4e7f0ea0e2e73851cd988f7c334c01d131048abf
Best regards,
--
Mark Brown,,, <broonie@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers
2020-10-19 22:44 David Rhodes
@ 2020-10-20 12:09 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-10-20 12:09 UTC (permalink / raw)
To: David Rhodes; +Cc: patches, alsa-devel, brian.austin, james.schulman
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
On Mon, Oct 19, 2020 at 05:44:27PM -0500, David Rhodes wrote:
> - /* Only certain ratios are supported in I2S Slave Mode */
> - if (cs35l35->slave_mode) {
> + /* Only certain ratios are supported in I2S Device Mode */
> + if (cs35l35->clock_mode) {
> - /* Only certain ratios supported in I2S MASTER Mode */
> + /* Only certain ratios supported in I2S Controller Mode */
Your renaming moves this to a boolean variable called clock mode which
maps onto device and controller. I am not sure people are going to be
able to follow that. Perhaps clock_source or something?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers
@ 2020-10-19 22:44 David Rhodes
2020-10-20 12:09 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: David Rhodes @ 2020-10-19 22:44 UTC (permalink / raw)
To: alsa-devel, broonie, brian.austin, james.schulman, patches, david.rhodes
Revise variable names and comments in
cs35l35 and cs35l36 amp drivers.
Signed-off-by: David Rhodes <david.rhodes@cirrus.com>
---
sound/soc/codecs/cs35l35.c | 10 +++++-----
sound/soc/codecs/cs35l35.h | 2 +-
sound/soc/codecs/cs35l36.c | 10 +++++-----
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index e330427..3774b69 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -372,12 +372,12 @@ static int cs35l35_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
case SND_SOC_DAIFMT_CBM_CFM:
regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1,
CS35L35_MS_MASK, 1 << CS35L35_MS_SHIFT);
- cs35l35->slave_mode = false;
+ cs35l35->clock_mode = false;
break;
case SND_SOC_DAIFMT_CBS_CFS:
regmap_update_bits(cs35l35->regmap, CS35L35_CLK_CTL1,
CS35L35_MS_MASK, 0 << CS35L35_MS_SHIFT);
- cs35l35->slave_mode = true;
+ cs35l35->clock_mode = true;
break;
default:
return -EINVAL;
@@ -556,8 +556,8 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream,
}
sp_sclks = ((cs35l35->sclk / srate) / 4) - 1;
- /* Only certain ratios are supported in I2S Slave Mode */
- if (cs35l35->slave_mode) {
+ /* Only certain ratios are supported in I2S Device Mode */
+ if (cs35l35->clock_mode) {
switch (sp_sclks) {
case CS35L35_SP_SCLKS_32FS:
case CS35L35_SP_SCLKS_48FS:
@@ -568,7 +568,7 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
} else {
- /* Only certain ratios supported in I2S MASTER Mode */
+ /* Only certain ratios supported in I2S Controller Mode */
switch (sp_sclks) {
case CS35L35_SP_SCLKS_32FS:
case CS35L35_SP_SCLKS_64FS:
diff --git a/sound/soc/codecs/cs35l35.h b/sound/soc/codecs/cs35l35.h
index ffb154c..017fa6d 100644
--- a/sound/soc/codecs/cs35l35.h
+++ b/sound/soc/codecs/cs35l35.h
@@ -282,7 +282,7 @@ struct cs35l35_private {
int sclk;
bool pdm_mode;
bool i2s_mode;
- bool slave_mode;
+ bool clock_mode;
/* GPIO for /RST */
struct gpio_desc *reset_gpio;
struct completion pdn_done;
diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c
index e9b5f76..86f5533 100644
--- a/sound/soc/codecs/cs35l36.c
+++ b/sound/soc/codecs/cs35l36.c
@@ -756,14 +756,14 @@ static int cs35l36_set_dai_fmt(struct snd_soc_dai *component_dai,
{
struct cs35l36_private *cs35l36 =
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_mode, clk_frc;
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM:
- slave_mode = 1;
+ clock_mode = 1;
break;
case SND_SOC_DAIFMT_CBS_CFS:
- slave_mode = 0;
+ clock_mode = 0;
break;
default:
return -EINVAL;
@@ -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,
CS35L36_SCLK_MSTR_MASK,
- slave_mode << CS35L36_SCLK_MSTR_SHIFT);
+ clock_mode << CS35L36_SCLK_MSTR_SHIFT);
regmap_update_bits(cs35l36->regmap, CS35L36_ASP_RATE_CTRL,
CS35L36_LRCLK_MSTR_MASK,
- slave_mode << CS35L36_LRCLK_MSTR_SHIFT);
+ clock_mode << CS35L36_LRCLK_MSTR_SHIFT);
switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
case SND_SOC_DAIFMT_CONT:
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-26 20:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 19:44 [PATCH] ASoC: cs35l3x: Use neutral language in amp drivers David Rhodes
2021-05-25 19:58 ` Pierre-Louis Bossart
2021-05-26 20:21 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2020-10-19 22:44 David Rhodes
2020-10-20 12:09 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.