* [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
@ 2022-03-26 15:14 Fabio Estevam
2022-03-28 19:01 ` Tim Harvey
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Fabio Estevam @ 2022-03-26 15:14 UTC (permalink / raw)
To: shawnguo; +Cc: marcel.ziswiler, otavio, linux-arm-kernel, Fabio Estevam
On a custom carrier board with a i.MX6Q Apalis SoM, the sgtl5000 codec
on the SoM is often not detected and the following error message is
seen when the sgtl5000 driver tries to read the ID register:
sgtl5000 1-000a: Error reading chip id -6
The reason for the error is that the MCLK clock is not provided
early enough.
Fix the problem by describing the MCLK pinctrl inside the codec
node instead of placing it inside the audmux pinctrl group.
With this change applied the sgtl5000 is always detected on every boot.
Fixes: 693e3ffaae5a ("ARM: dts: imx6: Add support for Toradex Apalis iMX6Q/D SoM")
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
index ed2739e39085..bd763bae596b 100644
--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
@@ -286,6 +286,8 @@ vgen6_reg: vgen6 {
codec: sgtl5000@a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_sgtl5000>;
clocks = <&clks IMX6QDL_CLK_CKO>;
VDDA-supply = <®_module_3v3_audio>;
VDDIO-supply = <®_module_3v3>;
@@ -517,8 +519,6 @@ MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0
MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0
MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
- /* SGTL5000 sys_mclk */
- MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
>;
};
@@ -811,6 +811,12 @@ MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x000b0
>;
};
+ pinctrl_sgtl5000: sgtl5000grp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
+ >;
+ };
+
pinctrl_spdif: spdifgrp {
fsl,pins = <
MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
2022-03-26 15:14 [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue Fabio Estevam
@ 2022-03-28 19:01 ` Tim Harvey
2022-03-28 19:13 ` Fabio Estevam
2022-03-30 15:41 ` Max Krummenacher
2022-04-10 8:06 ` Shawn Guo
2 siblings, 1 reply; 6+ messages in thread
From: Tim Harvey @ 2022-03-28 19:01 UTC (permalink / raw)
To: Fabio Estevam
Cc: Shawn Guo, Marcel Ziswiler, Otavio Salvador,
Linux ARM Mailing List
On Sat, Mar 26, 2022 at 8:16 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> On a custom carrier board with a i.MX6Q Apalis SoM, the sgtl5000 codec
> on the SoM is often not detected and the following error message is
> seen when the sgtl5000 driver tries to read the ID register:
>
> sgtl5000 1-000a: Error reading chip id -6
>
> The reason for the error is that the MCLK clock is not provided
> early enough.
>
> Fix the problem by describing the MCLK pinctrl inside the codec
> node instead of placing it inside the audmux pinctrl group.
>
> With this change applied the sgtl5000 is always detected on every boot.
>
> Fixes: 693e3ffaae5a ("ARM: dts: imx6: Add support for Toradex Apalis iMX6Q/D SoM")
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
> index ed2739e39085..bd763bae596b 100644
> --- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
> @@ -286,6 +286,8 @@ vgen6_reg: vgen6 {
> codec: sgtl5000@a {
> compatible = "fsl,sgtl5000";
> reg = <0x0a>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_sgtl5000>;
> clocks = <&clks IMX6QDL_CLK_CKO>;
> VDDA-supply = <®_module_3v3_audio>;
> VDDIO-supply = <®_module_3v3>;
> @@ -517,8 +519,6 @@ MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0
> MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0
> MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
> MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
> - /* SGTL5000 sys_mclk */
> - MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
> >;
> };
>
> @@ -811,6 +811,12 @@ MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x000b0
> >;
> };
>
> + pinctrl_sgtl5000: sgtl5000grp {
> + fsl,pins = <
> + MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
> + >;
> + };
> +
> pinctrl_spdif: spdifgrp {
> fsl,pins = <
> MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
> --
> 2.25.1
Fabio,
Intesting... was there a specific kernel version or set of conditions
such as what's configured as modules that made this issue show up? It
looks like there are a lot of IMX6 boards that define the MCLK in the
audmuxgrp.... some use simple-audio-card and some do not in case that
matters.
Best Regards,
Tim
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
2022-03-28 19:01 ` Tim Harvey
@ 2022-03-28 19:13 ` Fabio Estevam
2022-03-28 19:16 ` Tim Harvey
0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2022-03-28 19:13 UTC (permalink / raw)
To: Tim Harvey
Cc: Shawn Guo, Marcel Ziswiler, Otavio Salvador,
Linux ARM Mailing List
Hi Tim,
On Mon, Mar 28, 2022 at 4:02 PM Tim Harvey <tharvey@gateworks.com> wrote:
> Fabio,
>
> Intesting... was there a specific kernel version or set of conditions
> such as what's configured as modules that made this issue show up? It
> looks like there are a lot of IMX6 boards that define the MCLK in the
> audmuxgrp.... some use simple-audio-card and some do not in case that
> matters.
I observed this issue running a custom defconfig.
To be on the safe side, we should better not rely on kernel probe
order/defconfig and let the sgtl5000 node
to configure the MCLK pintctrl early, so that the MCLK becomes
available and the codec registers can be read safely read.
Regards,
Fabio Estevam
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
2022-03-28 19:13 ` Fabio Estevam
@ 2022-03-28 19:16 ` Tim Harvey
0 siblings, 0 replies; 6+ messages in thread
From: Tim Harvey @ 2022-03-28 19:16 UTC (permalink / raw)
To: Fabio Estevam
Cc: Shawn Guo, Marcel Ziswiler, Otavio Salvador,
Linux ARM Mailing List
On Mon, Mar 28, 2022 at 12:13 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Tim,
>
> On Mon, Mar 28, 2022 at 4:02 PM Tim Harvey <tharvey@gateworks.com> wrote:
>
> > Fabio,
> >
> > Intesting... was there a specific kernel version or set of conditions
> > such as what's configured as modules that made this issue show up? It
> > looks like there are a lot of IMX6 boards that define the MCLK in the
> > audmuxgrp.... some use simple-audio-card and some do not in case that
> > matters.
>
> I observed this issue running a custom defconfig.
>
> To be on the safe side, we should better not rely on kernel probe
> order/defconfig and let the sgtl5000 node
> to configure the MCLK pintctrl early, so that the MCLK becomes
> available and the codec registers can be read safely read.
>
> Regards,
>
> Fabio Estevam
Fabio,
Agreed - the MCLK is needed for the codec not for audmux.
Reviewed-by: Tim Harvey <tharvey@gateworks.com>
Best Regards,
Tim
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
2022-03-26 15:14 [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue Fabio Estevam
2022-03-28 19:01 ` Tim Harvey
@ 2022-03-30 15:41 ` Max Krummenacher
2022-04-10 8:06 ` Shawn Guo
2 siblings, 0 replies; 6+ messages in thread
From: Max Krummenacher @ 2022-03-30 15:41 UTC (permalink / raw)
To: festevam@gmail.com, shawnguo@kernel.org
Cc: linux-arm-kernel@lists.infradead.org, Marcel Ziswiler,
otavio@ossystems.com.br, tharvey@gateworks.com
On Sat, 2022-03-26 at 12:14 -0300, Fabio Estevam wrote:
> On a custom carrier board with a i.MX6Q Apalis SoM, the sgtl5000 codec
> on the SoM is often not detected and the following error message is
> seen when the sgtl5000 driver tries to read the ID register:
>
> sgtl5000 1-000a: Error reading chip id -6
>
> The reason for the error is that the MCLK clock is not provided
> early enough.
>
> Fix the problem by describing the MCLK pinctrl inside the codec
> node instead of placing it inside the audmux pinctrl group.
>
> With this change applied the sgtl5000 is always detected on every boot.
>
> Fixes: 693e3ffaae5a ("ARM: dts: imx6: Add support for Toradex Apalis iMX6Q/D SoM")
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
> index ed2739e39085..bd763bae596b 100644
> --- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
> @@ -286,6 +286,8 @@ vgen6_reg: vgen6 {
> codec: sgtl5000@a {
> compatible = "fsl,sgtl5000";
> reg = <0x0a>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_sgtl5000>;
> clocks = <&clks IMX6QDL_CLK_CKO>;
> VDDA-supply = <®_module_3v3_audio>;
> VDDIO-supply = <®_module_3v3>;
> @@ -517,8 +519,6 @@ MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0
> MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0
> MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
> MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
> - /* SGTL5000 sys_mclk */
> - MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
> >;
> };
>
> @@ -811,6 +811,12 @@ MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x000b0
> >;
> };
>
> + pinctrl_sgtl5000: sgtl5000grp {
> + fsl,pins = <
> + MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
> + >;
> + };
> +
> pinctrl_spdif: spdifgrp {
> fsl,pins = <
> MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
Thanks Fabio
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue
2022-03-26 15:14 [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue Fabio Estevam
2022-03-28 19:01 ` Tim Harvey
2022-03-30 15:41 ` Max Krummenacher
@ 2022-04-10 8:06 ` Shawn Guo
2 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2022-04-10 8:06 UTC (permalink / raw)
To: Fabio Estevam; +Cc: marcel.ziswiler, otavio, linux-arm-kernel
On Sat, Mar 26, 2022 at 12:14:55PM -0300, Fabio Estevam wrote:
> On a custom carrier board with a i.MX6Q Apalis SoM, the sgtl5000 codec
> on the SoM is often not detected and the following error message is
> seen when the sgtl5000 driver tries to read the ID register:
>
> sgtl5000 1-000a: Error reading chip id -6
>
> The reason for the error is that the MCLK clock is not provided
> early enough.
>
> Fix the problem by describing the MCLK pinctrl inside the codec
> node instead of placing it inside the audmux pinctrl group.
>
> With this change applied the sgtl5000 is always detected on every boot.
>
> Fixes: 693e3ffaae5a ("ARM: dts: imx6: Add support for Toradex Apalis iMX6Q/D SoM")
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
Applied, thanks!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-10 8:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-26 15:14 [PATCH] ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue Fabio Estevam
2022-03-28 19:01 ` Tim Harvey
2022-03-28 19:13 ` Fabio Estevam
2022-03-28 19:16 ` Tim Harvey
2022-03-30 15:41 ` Max Krummenacher
2022-04-10 8:06 ` Shawn Guo
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).