From: Takashi Iwai Subject: Re: [PATCH] ASoC: rt5670: add set_bclk_ratio in dai ops Date: Tue, 12 Sep 2017 09:13:50 +0200 Message-ID: References: <1505197205-12237-1-git-send-email-bardliao@realtek.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A39DF266D07 for ; Tue, 12 Sep 2017 09:13:52 +0200 (CEST) In-Reply-To: <1505197205-12237-1-git-send-email-bardliao@realtek.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Bard Liao Cc: oder_chiou@realtek.com, jack.yu@realtek.com, alsa-devel@alsa-project.org, lars@metafoo.de, lgirdwood@gmail.com, broonie@kernel.org, shumingf@realtek.com, flove@realtek.com List-Id: alsa-devel@alsa-project.org On Tue, 12 Sep 2017 08:20:05 +0200, Bard Liao wrote: > > We need to set a specific bit for 50 bclk rate. So add set_bclk_ratio > function to set the bit. > > Signed-off-by: Bard Liao > --- > sound/soc/codecs/rt5670.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c > index 9545764..dbdd01c 100644 > --- a/sound/soc/codecs/rt5670.c > +++ b/sound/soc/codecs/rt5670.c > @@ -2582,6 +2582,22 @@ static int rt5670_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, > return 0; > } > > +static int rt5670_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) > +{ > + struct snd_soc_codec *codec = dai->codec; > + > + dev_dbg(codec->dev, "%s ratio=%d\n", __func__, ratio); > + if (dai->id != RT5670_AIF1) > + return 0; > + > + if (ratio == 50) > + snd_soc_update_bits(codec, RT5670_GEN_CTRL3, 0x0800, 0x0800); > + else > + snd_soc_update_bits(codec, RT5670_GEN_CTRL3, 0x0800, 0x0); Better to define some proper constant for 0x0800 bit. thanks, Takashi