From: Jiaxin Yu <jiaxin.yu@mediatek.com>
To: Mark Brown <broonie@kernel.org>
Cc: <tiwai@suse.com>, <matthias.bgg@gmail.com>, <robh+dt@kernel.org>,
<p.zabel@pengutronix.de>, <tzungbi@google.com>,
<alsa-devel@alsa-project.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<devicetree@vger.kernel.org>, <shane.chien@mediatek.com>,
<kuninori.morimoto.gx@renesas.com>, <Trevor.Wu@mediatek.com>,
<Bicycle.Tsai@mediatek.com>
Subject: Re: [PATCH v3 3/9] ASoC: mediatek: mt8192: support i2s in platform driver
Date: Wed, 4 Nov 2020 14:50:52 +0800 [thread overview]
Message-ID: <1604472652.26523.14.camel@mhfsdcap03> (raw)
In-Reply-To: <20201030143729.GF4405@sirena.org.uk>
On Fri, 2020-10-30 at 14:37 +0000, Mark Brown wrote:
> On Sat, Oct 24, 2020 at 03:58:53PM +0800, Jiaxin Yu wrote:
>
> > +static const struct soc_enum mt8192_i2s_enum[] = {
> > + SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(mt8192_i2s_hd_str),
> > + mt8192_i2s_hd_str),
> > +};
>
> Why is this declared as a single element array? It just makes all the
> usages look odd for no obvious gain.
>
> > +static int mtk_i2s_en_event(struct snd_soc_dapm_widget *w,
> > + struct snd_kcontrol *kcontrol,
> > + int event)
>
> > + dev_info(cmpnt->dev, "%s(), name %s, event 0x%x\n",
> > + __func__, w->name, event);
>
> This should be dev_dbg() at most, _info() will be too noisy in the logs.
> Same for a lot of functions, including the stream callbacks.
>
> > +static int mtk_i2s_hd_en_event(struct snd_soc_dapm_widget *w,
> > + struct snd_kcontrol *kcontrol,
> > + int event)
> > +{
> > + struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
> > +
> > + dev_info(cmpnt->dev, "%s(), name %s, event 0x%x\n",
> > + __func__, w->name, event);
> > +
> > + return 0;
> > +}
>
> This should just be removed entirely, there's trace in the core if you
> need logging in production systems - the tracepoints in particular are
> good for just leaving on all the time without adding overhead.
>
> > + return (i2s_need_apll == cur_apll) ? 1 : 0;
>
> Please write normal conditional statements to improve legiblity.
>
> > + if (rate == 44100)
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON3, 0x001B9000);
> > + else if (rate == 32000)
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON3, 0x140000);
> > + else
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON3, 0x001E0000);
>
> This would be better written as a switch statement.
>
> > + /* Calibration setting */
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON4, 0x00140000);
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON9, 0x00036000);
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON10, 0x0002FC00);
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON6, 0x00007EF4);
> > + regmap_write(afe->regmap, AFE_ASRC_2CH_CON5, 0x00FF5986);
>
> Are you sure this isn't system dependant?
Hi Mark,
Yes, this is a system independent setting. And I fixed other comments
you pointed out then send "PATCH v4".
next prev parent reply other threads:[~2020-11-04 6:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-24 7:58 [PATCH v3 0/9] ASoC: Mediatek: Add support for MT8192 SoC Jiaxin Yu
2020-10-24 7:58 ` [PATCH v3 1/9] ASoC: mediatek: mt6359: add the calibration functions Jiaxin Yu
2020-10-24 7:58 ` [PATCH v3 2/9] ASoC: mediatek: mt8192: add platform driver Jiaxin Yu
2020-10-24 7:58 ` [PATCH v3 3/9] ASoC: mediatek: mt8192: support i2s in " Jiaxin Yu
2020-10-30 14:37 ` Mark Brown
2020-11-04 6:50 ` Jiaxin Yu [this message]
2020-10-24 7:58 ` [PATCH v3 4/9] ASoC: mediatek: mt8192: support add " Jiaxin Yu
2020-10-30 15:13 ` Mark Brown
2020-10-24 7:58 ` [PATCH v3 5/9] ASoC: mediatek: mt8192: support pcm " Jiaxin Yu
2020-10-24 7:58 ` [PATCH v3 6/9] ASoC: mediatek: mt8192: support tdm " Jiaxin Yu
2020-10-24 7:58 ` [PATCH v3 7/9] dt-bindings: mediatek: mt8192: add audio afe document Jiaxin Yu
2020-10-24 7:58 ` [PATCH v3 8/9] ASoC: mediatek: mt8192: add machine driver with mt6359, rt1015 and rt5682 Jiaxin Yu
2020-10-24 7:58 ` [PATCH v3 9/9] dt-bindings: mediatek: mt8192: add mt8192-mt6358-rt1015-rt5682 document Jiaxin Yu
2020-10-30 17:54 ` [PATCH v3 0/9] ASoC: Mediatek: Add support for MT8192 SoC Mark Brown
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=1604472652.26523.14.camel@mhfsdcap03 \
--to=jiaxin.yu@mediatek.com \
--cc=Bicycle.Tsai@mediatek.com \
--cc=Trevor.Wu@mediatek.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=shane.chien@mediatek.com \
--cc=tiwai@suse.com \
--cc=tzungbi@google.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;
as well as URLs for NNTP newsgroup(s).