mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name
@ 2025-02-28 10:32 Louis-Alexis Eyraud
  2025-02-28 13:14 ` Nícolas F. R. A. Prado
  2025-03-04 14:20 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Louis-Alexis Eyraud @ 2025-02-28 10:32 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Matthias Brugger, AngeloGioacchino Del Regno, Macpaul Lin
  Cc: kernel, linux-sound, linux-kernel, linux-arm-kernel,
	linux-mediatek, Louis-Alexis Eyraud

A recent dtbs_check error fix in mt6359.dtsi file changed a node name
(from "mt6359codec" to "audio-codec") without modifying the mt6539
codec code that uses it.
It leads to a probe failure after devicetree parsing returns in error:
```
[    1.354025] mt6359-sound mt6359-sound: mt6359_platform_driver_probe() failed to parse dts
[    1.355066] mt6359-sound mt6359-sound: probe with driver mt6359-sound failed with error -22
```

So, add the child node retrieval with the new name and if not found,
try with the older one for backward compatibility.

Fixes: 76b35f59bbe6 ("arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec")
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
I've tested this patch on a Mediatek Genio 510 EVK board with a kernel
based on linux-next (tag: 20250228)
---
 sound/soc/codecs/mt6359.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c
index 0b76a55664b0352f6ee2d0f3c96466ffe1df2d6d..f73120c6a6ce680797a1f61841815ca01a24adf4 100644
--- a/sound/soc/codecs/mt6359.c
+++ b/sound/soc/codecs/mt6359.c
@@ -2867,9 +2867,12 @@ static int mt6359_parse_dt(struct mt6359_priv *priv)
 	struct device *dev = priv->dev;
 	struct device_node *np;
 
-	np = of_get_child_by_name(dev->parent->of_node, "mt6359codec");
-	if (!np)
-		return -EINVAL;
+	np = of_get_child_by_name(dev->parent->of_node, "audio-codec");
+	if (!np) {
+		np = of_get_child_by_name(dev->parent->of_node, "mt6359codec");
+		if (!np)
+			return -EINVAL;
+	}
 
 	ret = of_property_read_u32(np, "mediatek,dmic-mode",
 				   &priv->dmic_one_wire_mode);

---
base-commit: 15c3f6fa407bf6913c282b22ef2bcfa40cb53927
change-id: 20250227-mt6359-fix-probe-failed-a83e0fee902c

Best regards,
-- 
Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name
  2025-02-28 10:32 [PATCH] ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name Louis-Alexis Eyraud
@ 2025-02-28 13:14 ` Nícolas F. R. A. Prado
  2025-03-04 14:20 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Nícolas F. R. A. Prado @ 2025-02-28 13:14 UTC (permalink / raw)
  To: Louis-Alexis Eyraud
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Matthias Brugger, AngeloGioacchino Del Regno, Macpaul Lin,
	kernel, linux-sound, linux-kernel, linux-arm-kernel,
	linux-mediatek

On Fri, Feb 28, 2025 at 11:32:19AM +0100, Louis-Alexis Eyraud wrote:
> A recent dtbs_check error fix in mt6359.dtsi file changed a node name
> (from "mt6359codec" to "audio-codec") without modifying the mt6539
> codec code that uses it.
> It leads to a probe failure after devicetree parsing returns in error:
> ```
> [    1.354025] mt6359-sound mt6359-sound: mt6359_platform_driver_probe() failed to parse dts
> [    1.355066] mt6359-sound mt6359-sound: probe with driver mt6359-sound failed with error -22
> ```
> 
> So, add the child node retrieval with the new name and if not found,
> try with the older one for backward compatibility.
> 
> Fixes: 76b35f59bbe6 ("arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec")
> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name
  2025-02-28 10:32 [PATCH] ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name Louis-Alexis Eyraud
  2025-02-28 13:14 ` Nícolas F. R. A. Prado
@ 2025-03-04 14:20 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-03-04 14:20 UTC (permalink / raw)
  To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Matthias Brugger,
	AngeloGioacchino Del Regno, Macpaul Lin, Louis-Alexis Eyraud
  Cc: kernel, linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek

On Fri, 28 Feb 2025 11:32:19 +0100, Louis-Alexis Eyraud wrote:
> A recent dtbs_check error fix in mt6359.dtsi file changed a node name
> (from "mt6359codec" to "audio-codec") without modifying the mt6539
> codec code that uses it.
> It leads to a probe failure after devicetree parsing returns in error:
> ```
> [    1.354025] mt6359-sound mt6359-sound: mt6359_platform_driver_probe() failed to parse dts
> [    1.355066] mt6359-sound mt6359-sound: probe with driver mt6359-sound failed with error -22
> ```
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name
      commit: 79c080c75cdd0a5ba38be039f6f9bb66ec53b0c4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-04 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-28 10:32 [PATCH] ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name Louis-Alexis Eyraud
2025-02-28 13:14 ` Nícolas F. R. A. Prado
2025-03-04 14:20 ` Mark Brown

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®