--- Begin Message ---
- To: "robh+dt@xxxxxxxxxx" <robh+dt@xxxxxxxxxx>, "broonie@xxxxxxxxxx" <broonie@xxxxxxxxxx>, "tiwai@xxxxxxxx" <tiwai@xxxxxxxx>, "lgirdwood@xxxxxxxxx" <lgirdwood@xxxxxxxxx>, "krzysztof.kozlowski+dt@xxxxxxxxxx" <krzysztof.kozlowski+dt@xxxxxxxxxx>, "matthias.bgg@xxxxxxxxx" <matthias.bgg@xxxxxxxxx>, "perex@xxxxxxxx" <perex@xxxxxxxx>, "angelogioacchino.delregno@xxxxxxxxxxxxx" <angelogioacchino.delregno@xxxxxxxxxxxxx>
- Subject: Re: [PATCH 3/7] ASoC: mediatek: mt8188: revise ETDM control flow
- From: Trevor Wu (吳文良) <Trevor.Wu@xxxxxxxxxxxx>
- Date: Mon, 17 Apr 2023 02:52:35 +0000
- Cc: "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "linux-mediatek@xxxxxxxxxxxxxxxxxxx" <linux-mediatek@xxxxxxxxxxxxxxxxxxx>, "alsa-devel@xxxxxxxxxxxxxxxx" <alsa-devel@xxxxxxxxxxxxxxxx>, "devicetree@xxxxxxxxxxxxxxx" <devicetree@xxxxxxxxxxxxxxx>
- In-reply-to: <e36598dd-4f83-90b4-1744-61d18744b02d@collabora.com>
- References: <20230413104713.7174-1-trevor.wu@mediatek.com> <20230413104713.7174-4-trevor.wu@mediatek.com> <e36598dd-4f83-90b4-1744-61d18744b02d@collabora.com>
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
>
--- End Message ---