From 2925b58209c9acfb89b036a0d0eb5b0ebc3abb3a Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 16 Jun 2020 14:21:42 +0900 Subject: ASoC: codecs: da*: rename to snd_soc_component_read() We need to use snd_soc_component_read() instead of snd_soc_component_read32() This patch renames _read32() to _read() Signed-off-by: Kuninori Morimoto Acked-by: Adam Thomson Link: https://lore.kernel.org/r/87bllj4mc8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/codecs/da7210.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'sound/soc/codecs/da7210.c') diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index e172913d04a4..0c99dcf242e4 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -330,7 +330,7 @@ static int da7210_put_alc_sw(struct snd_kcontrol *kcontrol, if (ucontrol->value.integer.value[0]) { /* Check if noise suppression is enabled */ - if (snd_soc_component_read32(component, DA7210_CONTROL) & DA7210_NOISE_SUP_EN) { + if (snd_soc_component_read(component, DA7210_CONTROL) & DA7210_NOISE_SUP_EN) { dev_dbg(component->dev, "Disable noise suppression to enable ALC\n"); return -EINVAL; @@ -354,27 +354,27 @@ static int da7210_put_noise_sup_sw(struct snd_kcontrol *kcontrol, if (ucontrol->value.integer.value[0]) { /* Check if ALC is enabled */ - if (snd_soc_component_read32(component, DA7210_ADC) & DA7210_ADC_ALC_EN) + if (snd_soc_component_read(component, DA7210_ADC) & DA7210_ADC_ALC_EN) goto err; /* Check ZC for HP and AUX1 PGA */ - if ((snd_soc_component_read32(component, DA7210_ZERO_CROSS) & + if ((snd_soc_component_read(component, DA7210_ZERO_CROSS) & (DA7210_AUX1_L_ZC | DA7210_AUX1_R_ZC | DA7210_HP_L_ZC | DA7210_HP_R_ZC)) != (DA7210_AUX1_L_ZC | DA7210_AUX1_R_ZC | DA7210_HP_L_ZC | DA7210_HP_R_ZC)) goto err; /* Check INPGA_L_VOL and INPGA_R_VOL */ - val = snd_soc_component_read32(component, DA7210_IN_GAIN); + val = snd_soc_component_read(component, DA7210_IN_GAIN); if (((val & DA7210_INPGA_L_VOL) < DA7210_INPGA_MIN_VOL_NS) || (((val & DA7210_INPGA_R_VOL) >> 4) < DA7210_INPGA_MIN_VOL_NS)) goto err; /* Check AUX1_L_VOL and AUX1_R_VOL */ - if (((snd_soc_component_read32(component, DA7210_AUX1_L) & DA7210_AUX1_L_VOL) < + if (((snd_soc_component_read(component, DA7210_AUX1_L) & DA7210_AUX1_L_VOL) < DA7210_AUX1_MIN_VOL_NS) || - ((snd_soc_component_read32(component, DA7210_AUX1_R) & DA7210_AUX1_R_VOL) < + ((snd_soc_component_read(component, DA7210_AUX1_R) & DA7210_AUX1_R_VOL) < DA7210_AUX1_MIN_VOL_NS)) goto err; } @@ -767,7 +767,7 @@ static int da7210_hw_params(struct snd_pcm_substream *substream, /* Enable DAI */ snd_soc_component_write(component, DA7210_DAI_CFG3, DA7210_DAI_OE | DA7210_DAI_EN); - dai_cfg1 = 0xFC & snd_soc_component_read32(component, DA7210_DAI_CFG1); + dai_cfg1 = 0xFC & snd_soc_component_read(component, DA7210_DAI_CFG1); switch (params_width(params)) { case 16: @@ -874,11 +874,11 @@ static int da7210_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt) u32 dai_cfg1; u32 dai_cfg3; - dai_cfg1 = 0x7f & snd_soc_component_read32(component, DA7210_DAI_CFG1); - dai_cfg3 = 0xfc & snd_soc_component_read32(component, DA7210_DAI_CFG3); + dai_cfg1 = 0x7f & snd_soc_component_read(component, DA7210_DAI_CFG1); + dai_cfg3 = 0xfc & snd_soc_component_read(component, DA7210_DAI_CFG3); - if ((snd_soc_component_read32(component, DA7210_PLL) & DA7210_PLL_EN) && - (!(snd_soc_component_read32(component, DA7210_PLL_DIV3) & DA7210_PLL_BYP))) + if ((snd_soc_component_read(component, DA7210_PLL) & DA7210_PLL_EN) && + (!(snd_soc_component_read(component, DA7210_PLL_DIV3) & DA7210_PLL_BYP))) return -EINVAL; switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { @@ -927,7 +927,7 @@ static int da7210_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt) static int da7210_mute(struct snd_soc_dai *dai, int mute) { struct snd_soc_component *component = dai->component; - u8 mute_reg = snd_soc_component_read32(component, DA7210_DAC_HPF) & 0xFB; + u8 mute_reg = snd_soc_component_read(component, DA7210_DAC_HPF) & 0xFB; if (mute) snd_soc_component_write(component, DA7210_DAC_HPF, mute_reg | 0x4); -- cgit v1.2.3 From d3d0502ae595c29091dac0cda7550f19b913074f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Tue, 7 Jul 2020 14:06:05 -0500 Subject: ASoC: codecs: da7210: fix kernel-doc Fix W=1 warning, the kernel-doc syntax was probably from Doxygen? Signed-off-by: Pierre-Louis Bossart Acked-by: Adam Thomson Link: https://lore.kernel.org/r/20200707190612.97799-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/codecs/da7210.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sound/soc/codecs/da7210.c') diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 0c99dcf242e4..2bb727dd3a20 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -971,14 +971,16 @@ static int da7210_set_dai_sysclk(struct snd_soc_dai *codec_dai, /** * da7210_set_dai_pll :Configure the codec PLL - * @param codec_dai : pointer to codec DAI - * @param pll_id : da7210 has only one pll, so pll_id is always zero - * @param fref : MCLK frequency, should be < 20MHz - * @param fout : FsDM value, Refer page 44 & 45 of datasheet - * @return int : Zero for success, negative error code for error + * @codec_dai: pointer to codec DAI + * @pll_id: da7210 has only one pll, so pll_id is always zero + * @source: clock source + * @fref: MCLK frequency, should be < 20MHz + * @fout: FsDM value, Refer page 44 & 45 of datasheet * * Note: Supported PLL input frequencies are 12MHz, 13MHz, 13.5MHz, 14.4MHz, * 19.2MHz, 19.6MHz and 19.8MHz + * + * Return: Zero for success, negative error code for error */ static int da7210_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, int source, unsigned int fref, unsigned int fout) -- cgit v1.2.3 From f39c0540d6941b2390cea20f413b620adcc3be86 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 9 Jul 2020 10:57:02 +0900 Subject: ASoC: codecs: da*: merge .digital_mute() into .mute_stream() snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto Reviewed-by: Peter Ujfalusi Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/87sge1wiwi.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/codecs/da7210.c | 5 +++-- sound/soc/codecs/da7213.c | 5 +++-- sound/soc/codecs/da9055.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'sound/soc/codecs/da7210.c') diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 2bb727dd3a20..3d05c37f676e 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -924,7 +924,7 @@ static int da7210_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt) return 0; } -static int da7210_mute(struct snd_soc_dai *dai, int mute) +static int da7210_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; u8 mute_reg = snd_soc_component_read(component, DA7210_DAC_HPF) & 0xFB; @@ -1036,7 +1036,8 @@ static const struct snd_soc_dai_ops da7210_dai_ops = { .set_fmt = da7210_set_dai_fmt, .set_sysclk = da7210_set_dai_sysclk, .set_pll = da7210_set_dai_pll, - .digital_mute = da7210_mute, + .mute_stream = da7210_mute, + .no_capture_mute = 1, }; static struct snd_soc_dai_driver da7210_dai = { diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index fe93ec702645..72402467adcc 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c @@ -1332,7 +1332,7 @@ static int da7213_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; } -static int da7213_mute(struct snd_soc_dai *dai, int mute) +static int da7213_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; @@ -1528,7 +1528,8 @@ static int da7213_set_component_pll(struct snd_soc_component *component, static const struct snd_soc_dai_ops da7213_dai_ops = { .hw_params = da7213_hw_params, .set_fmt = da7213_set_dai_fmt, - .digital_mute = da7213_mute, + .mute_stream = da7213_mute, + .no_capture_mute = 1, }; static struct snd_soc_dai_driver da7213_dai = { diff --git a/sound/soc/codecs/da9055.c b/sound/soc/codecs/da9055.c index e93436ccb674..b0d9ca6de685 100644 --- a/sound/soc/codecs/da9055.c +++ b/sound/soc/codecs/da9055.c @@ -1211,7 +1211,7 @@ static int da9055_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; } -static int da9055_mute(struct snd_soc_dai *dai, int mute) +static int da9055_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; @@ -1324,7 +1324,8 @@ static const struct snd_soc_dai_ops da9055_dai_ops = { .set_fmt = da9055_set_dai_fmt, .set_sysclk = da9055_set_dai_sysclk, .set_pll = da9055_set_dai_pll, - .digital_mute = da9055_mute, + .mute_stream = da9055_mute, + .no_capture_mute = 1, }; static struct snd_soc_dai_driver da9055_dai = { -- cgit v1.2.3