Skip to content

Commit 0fe153a

Browse files
krzkbroonie
authored andcommitted
ASoC: mediatek: mt8186: Handle component name prefix
Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20231023095428.166563-14-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e84c7f5 commit 0fe153a

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

sound/soc/mediatek/mt8186/mt8186-dai-adda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static int mtk_adda_mtkaif_cfg_event(struct snd_soc_dapm_widget *w,
321321
MTKAIF_RXIF_CLKINV_ADC_MASK_SFT,
322322
BIT(MTKAIF_RXIF_CLKINV_ADC_SFT));
323323

324-
if (strcmp(w->name, "ADDA_MTKAIF_CFG") == 0) {
324+
if (snd_soc_dapm_widget_name_cmp(w, "ADDA_MTKAIF_CFG") == 0) {
325325
if (afe_priv->mtkaif_chosen_phase[0] < 0 &&
326326
afe_priv->mtkaif_chosen_phase[1] < 0) {
327327
dev_err(afe->dev,

sound/soc/mediatek/mt8186/mt8186-dai-hw-gain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int mtk_hw_gain_event(struct snd_soc_dapm_widget *w,
4747

4848
switch (event) {
4949
case SND_SOC_DAPM_PRE_PMU:
50-
if (strcmp(w->name, HW_GAIN_1_EN_W_NAME) == 0) {
50+
if (snd_soc_dapm_widget_name_cmp(w, HW_GAIN_1_EN_W_NAME) == 0) {
5151
gain_cur = AFE_GAIN1_CUR;
5252
gain_con1 = AFE_GAIN1_CON1;
5353
} else {

sound/soc/mediatek/mt8186/mt8186-dai-i2s.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,13 @@ static int mtk_apll_event(struct snd_soc_dapm_widget *w,
393393

394394
switch (event) {
395395
case SND_SOC_DAPM_PRE_PMU:
396-
if (strcmp(w->name, APLL1_W_NAME) == 0)
396+
if (snd_soc_dapm_widget_name_cmp(w, APLL1_W_NAME) == 0)
397397
mt8186_apll1_enable(afe);
398398
else
399399
mt8186_apll2_enable(afe);
400400
break;
401401
case SND_SOC_DAPM_POST_PMD:
402-
if (strcmp(w->name, APLL1_W_NAME) == 0)
402+
if (snd_soc_dapm_widget_name_cmp(w, APLL1_W_NAME) == 0)
403403
mt8186_apll1_disable(afe);
404404
else
405405
mt8186_apll2_disable(afe);

sound/soc/mediatek/mt8186/mt8186-dai-src.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static int mtk_hw_src_event(struct snd_soc_dapm_widget *w,
322322
struct mtk_afe_src_priv *src_priv;
323323
unsigned int reg;
324324

325-
if (strcmp(w->name, HW_SRC_1_EN_W_NAME) == 0)
325+
if (snd_soc_dapm_widget_name_cmp(w, HW_SRC_1_EN_W_NAME) == 0)
326326
id = MT8186_DAI_SRC_1;
327327
else
328328
id = MT8186_DAI_SRC_2;
@@ -487,7 +487,7 @@ static int mtk_afe_src_en_connect(struct snd_soc_dapm_widget *source,
487487
struct mt8186_afe_private *afe_priv = afe->platform_priv;
488488
struct mtk_afe_src_priv *src_priv;
489489

490-
if (strcmp(w->name, HW_SRC_1_EN_W_NAME) == 0)
490+
if (snd_soc_dapm_widget_name_cmp(w, HW_SRC_1_EN_W_NAME) == 0)
491491
src_priv = afe_priv->dai_priv[MT8186_DAI_SRC_1];
492492
else
493493
src_priv = afe_priv->dai_priv[MT8186_DAI_SRC_2];

0 commit comments

Comments
 (0)