[alsa-devel] [PATCH 3/3] ASoC: codecs: max98088: Added digital mute function in DAI1 and DAI2

Jinyoung Park jinyoungp at nvidia.com
Fri May 13 10:25:12 CEST 2011


Jassi, 
I agree with you and it is not difficult.
If Peter Hsiang agrees that compress them, I will do that.
He is author of max98088 driver.

Peter,
How do you think about that?

Thanks,
Jinyoung.

-----Original Message-----
From: Jassi Brar [mailto:jassisinghbrar at gmail.com] 
Sent: Friday, May 13, 2011 4:11 PM
To: Jinyoung Park
Cc: broonie at opensource.wolfsonmicro.com; Peter.Hsiang at maxim-ic.com; alsa-devel at alsa-project.org; lrg at slimlogic.co.uk
Subject: Re: [alsa-devel] [PATCH 3/3] ASoC: codecs: max98088: Added digital mute function in DAI1 and DAI2

On Thu, May 12, 2011 at 11:28 AM,  <jinyoungp at nvidia.com> wrote:

> +static int max98088_dai1_digital_mute(struct snd_soc_dai *codec_dai, 
> +int mute) {
> +       struct snd_soc_codec *codec = codec_dai->codec;
> +       int reg;
> +
> +       if (mute)
> +               reg = M98088_DAI_MUTE;
> +       else
> +               reg = 0;
> +
> +       snd_soc_update_bits(codec, M98088_REG_2F_LVL_DAI1_PLAY,
> +                           M98088_DAI_MUTE_MASK, reg);
> +       return 0;
> +}
> +
> +static int max98088_dai2_digital_mute(struct snd_soc_dai *codec_dai, 
> +int mute) {
> +       struct snd_soc_codec *codec = codec_dai->codec;
> +       int reg;
> +
> +       if (mute)
> +               reg = M98088_DAI_MUTE;
> +       else
> +               reg = 0;
> +
> +       snd_soc_update_bits(codec, M98088_REG_31_LVL_DAI2_PLAY,
> +                           M98088_DAI_MUTE_MASK, reg);
> +       return 0;
> +}

max98088_dai1_digital_mute     max98088_dai2_digital_mute
max98088_dai1_set_fmt             max98088_dai2_set_fmt
max98088_dai1_hw_params      max98088_dai2_hw_params

These pairs are essentially same function operating on different registers. Can't we compress them ?

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


More information about the Alsa-devel mailing list