From: "Maso Huang (黃加竹)" <Maso.Huang@mediatek.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"broonie@kernel.org" <broonie@kernel.org>,
"tiwai@suse.com" <tiwai@suse.com>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"perex@perex.cz" <perex@perex.cz>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH 2/2] ASoC: mediatek: mt7986: add sample rate checker
Date: Tue, 24 Oct 2023 02:27:32 +0000 [thread overview]
Message-ID: <c5a19ddaa458cbd48b8040d1b6e81f6cfe017906.camel@mediatek.com> (raw)
In-Reply-To: <d1c7833a-10d6-4188-a0e7-fab31a6bad43@collabora.com>
On Mon, 2023-10-23 at 13:07 +0200, AngeloGioacchino Del Regno wrote:
> Il 23/10/23 11:54, Maso Huang ha scritto:
> > mt7986 only supports 8/12/16/24/32/48/96/192 kHz
> >
> > Signed-off-by: Maso Huang <maso.huang@mediatek.com>
> > ---
> > sound/soc/mediatek/mt7986/mt7986-dai-etdm.c | 22
> > +++++++++++++++++----
> > 1 file changed, 18 insertions(+), 4 deletions(-)
> >
> > diff --git a/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c
> > b/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c
> > index e523d33846fe..270852ce3dd9 100644
> > --- a/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c
> > +++ b/sound/soc/mediatek/mt7986/mt7986-dai-etdm.c
> > @@ -237,12 +237,26 @@ static int mtk_dai_etdm_hw_params(struct
> > snd_pcm_substream *substream,
> > struct snd_pcm_hw_params *params,
> > struct snd_soc_dai *dai)
> > {
> > + unsigned int rate = params_rate(params);
> > struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai);
> >
> > - mtk_dai_etdm_config(afe, params, dai,
> > SNDRV_PCM_STREAM_PLAYBACK);
> > - mtk_dai_etdm_config(afe, params, dai,
> > SNDRV_PCM_STREAM_CAPTURE);
> > -
> > - return 0;
> > + switch (rate) {
> > + case 8000:
> > + case 12000:
> > + case 16000:
> > + case 24000:
> > + case 32000:
> > + case 48000:
> > + case 96000:
> > + case 192000:
> > + mtk_dai_etdm_config(afe, params, dai,
> > SNDRV_PCM_STREAM_PLAYBACK);
> > + mtk_dai_etdm_config(afe, params, dai,
> > SNDRV_PCM_STREAM_CAPTURE);
> > + return 0;
> > + default:
> > + dev_warn(afe->dev, "%s(), sample rate: %d is not
> > supported\n", __func__, rate);
> > + dev_warn(afe->dev, "%s(), only support
> > 8/12/16/24/32/48/96/192 kHz\n", __func__);
>
> That's better:
>
> dev_err(afe->dev,
> "Sample rate %d invalid. Supported rates:
> 8/12/16/24/32/48/96/192 kHz\n",
> rate, __func__);
>
> after which,
>
> Reviewed-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
>
> Regards,
> Angelo
>
>
Hi Angelo,
Thanks for your review!
I'll refine it in v2.
Best regards,
Maso
prev parent reply other threads:[~2023-10-24 2:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 9:54 [PATCH 0/2] ASoC: mediatek: Remove redundant code and add sample rate checker of MT7986 SoC Maso Huang
2023-10-23 9:54 ` [PATCH 1/2] ASoC: mediatek: mt7986: remove redundant remove function Maso Huang
2023-10-23 11:07 ` AngeloGioacchino Del Regno
2023-10-24 2:28 ` Maso Huang (黃加竹)
2023-10-23 9:54 ` [PATCH 2/2] ASoC: mediatek: mt7986: add sample rate checker Maso Huang
2023-10-23 11:07 ` AngeloGioacchino Del Regno
2023-10-24 2:27 ` Maso Huang (黃加竹) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c5a19ddaa458cbd48b8040d1b6e81f6cfe017906.camel@mediatek.com \
--to=maso.huang@mediatek.com \
--cc=alsa-devel@alsa-project.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®