Re: [PATCH 3/5] Sound: SOC: TAS571x: implemented digital mute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 10, 2016 at 3:22 AM, Petr Kulhavy <petr@xxxxxxxxx> wrote:
> The driver did not have a mute function. The amplifier was brought out of
> shutdown mode (hard-mute) once for ever in probe(), which was causing
> clicks and pops when altering the I2C register configuration later.
>
> This adds the digital_mute() function. The amplifier unmute in probe()
> was removed.
>
> Signed-off-by: Petr Kulhavy <petr@xxxxxxxxx>
> Tested-by: Petr Kulhavy <petr@xxxxxxxxx>
> ---
>  sound/soc/codecs/tas571x.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c
> index 2a63069..431dffa 100644
> --- a/sound/soc/codecs/tas571x.c
> +++ b/sound/soc/codecs/tas571x.c
> @@ -171,6 +171,23 @@ static int tas571x_hw_params(struct snd_pcm_substream *substream,
>                                   TAS571X_SDI_FMT_MASK, val);
>  }
>
> +static int tas571x_mute(struct snd_soc_dai *dai, int mute)
> +{
> +       struct snd_soc_codec *codec = dai->codec;
> +       u8 sysctl2;
> +       int ret;
> +
> +       sysctl2 = mute ? TAS571X_SYS_CTRL_2_SDN_MASK : 0;
> +
> +       ret = snd_soc_update_bits(codec,
> +                           TAS571X_SYS_CTRL_2_REG,
> +                    TAS571X_SYS_CTRL_2_SDN_MASK,
> +                    sysctl2);
> +       usleep_range(1000, 2000);
> +
> +       return ret;
> +}
> +
>  static int tas571x_set_bias_level(struct snd_soc_codec *codec,
>                                   enum snd_soc_bias_level level)
>  {
> @@ -218,6 +235,7 @@ static int tas571x_set_bias_level(struct snd_soc_codec *codec,
>  static const struct snd_soc_dai_ops tas571x_dai_ops = {
>         .set_fmt        = tas571x_set_dai_fmt,
>         .hw_params      = tas571x_hw_params,
> +       .digital_mute   = tas571x_mute,
>  };

Hi Petr,

It is good to see that this driver is getting some use. :-)

An earlier iteration of the code implemented digital_mute, although it
used a different register:

+        return regmap_update_bits(priv->regmap,
+                                 TAS571X_SOFT_MUTE_REG,
+                                 TAS571X_SOFT_MUTE_CH_MASK,
+                                 mute ? TAS571X_SOFT_MUTE_CH_MASK : 0);

This was removed here: https://chromium-review.googlesource.com/#/c/265878/

Are you able to test the modified code on 5711 and 5717 (or 5719)?
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux