[alsa-devel] [PATCH 3/3] ASoC: codecs: max98088: Added digital mute function in DAI1 and DAI2
Jassi Brar
jassisinghbrar at gmail.com
Fri May 13 09:11:23 CEST 2011
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 ?
More information about the Alsa-devel
mailing list