[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <228e990dcb46d5640f03deeeec720f6a4d4715b3.camel@mediatek.com>
Date: Mon, 17 Apr 2023 02:52:35 +0000
From: Trevor Wu (吳文良) <Trevor.Wu@...iatek.com>
To: "robh+dt@...nel.org" <robh+dt@...nel.org>,
"broonie@...nel.org" <broonie@...nel.org>,
"tiwai@...e.com" <tiwai@...e.com>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"perex@...ex.cz" <perex@...ex.cz>,
"angelogioacchino.delregno@...labora.com"
<angelogioacchino.delregno@...labora.com>
CC: "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH 3/7] ASoC: mediatek: mt8188: revise ETDM control flow
On Thu, 2023-04-13 at 15:17 +0200, AngeloGioacchino Del Regno wrote:
>
> > +static int mtk_etdm_mclk_connect(struct snd_soc_dapm_widget
> > *source,
> > + struct snd_soc_dapm_widget *sink)
> > +{
> > + struct snd_soc_dapm_widget *w = sink;
> > + struct snd_soc_component *cmpnt =
> > snd_soc_dapm_to_component(w->dapm);
> > + struct mtk_base_afe *afe =
> > snd_soc_component_get_drvdata(cmpnt);
> > + struct mt8188_afe_private *afe_priv = afe->platform_priv;
> > + struct mtk_dai_etdm_priv *etdm_priv;
> > + int mclk_id;
> > +
> > + mclk_id = get_etdm_id_by_name(afe, source->name);
> > + if (mclk_id < 0) {
> > + dev_info(afe->dev, "mclk_id < 0");
>
> Since you're returning 0, this doesn't appear to be an error and this
> print is
> useless unless it is used for debugging purposes.
>
> Please change it to dev_dbg().
>
> > + return 0;
> > + }
> > +
> > + etdm_priv = get_etdm_priv_by_name(afe, w->name);
> > + if (!etdm_priv) {
> > + dev_info(afe->dev, "etdm_priv == NULL");
>
> dev_dbg()
>
> > + return 0;
> > + }
> > +
> > + if (get_etdm_id_by_name(afe, sink->name) == mclk_id)
> > + return !!(etdm_priv->mclk_freq > 0);
> > +
> > + if (etdm_priv->cowork_source_id == mclk_id) {
> > + etdm_priv = afe_priv->dai_priv[mclk_id];
> > + return !!(etdm_priv->mclk_freq > 0);
> > + }
> > +
> > + return 0;
> > +}
> > +
> > +static int mtk_etdm_cowork_connect(struct snd_soc_dapm_widget
> > *source,
> > + struct snd_soc_dapm_widget *sink)
> > +{
> > + struct snd_soc_dapm_widget *w = sink;
> > + struct snd_soc_component *cmpnt =
> > snd_soc_dapm_to_component(w->dapm);
> > + struct mtk_base_afe *afe =
> > snd_soc_component_get_drvdata(cmpnt);
> > + struct mt8188_afe_private *afe_priv = afe->platform_priv;
> > + struct mtk_dai_etdm_priv *etdm_priv;
> > + int source_id;
> > + int i;
> > +
> > + source_id = get_etdm_id_by_name(afe, source->name);
> > + if (source_id < 0) {
> > + dev_info(afe->dev, "%s() source_id < 0\n", __func__);
>
> dev_dbg() please
>
> > + return 0;
> > + }
> > +
> > + etdm_priv = get_etdm_priv_by_name(afe, w->name);
> > + if (!etdm_priv) {
> > + dev_info(afe->dev, "%s() etdm_priv == NULL\n",
> > __func__);
>
> ...again... and everywhere else.
>
> > + return 0;
> > + }
> > +
>
OK, I will review all dev_info and replace them with dev_dbg in V2.
Thanks,
Trevor
>
Powered by blists - more mailing lists