diff mbox series

[V3,2/3] arm64: dts: imx8mp: Add micfil node

Message ID 20230831044431.250338-2-aford173@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show
Series [V3,1/3] arm64: dts: imx8mp: Add easrc node | expand

Commit Message

Adam Ford Aug. 31, 2023, 4:44 a.m. UTC
The i.MX8MP has a micfil controller which is used for interfacing
with a pulse density microphone. Add the node and mark it as
disabled by default.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
V3:  The AUDIOMIX_PDM_ROOT doesn't exist and the real clock is
     called IMX8MP_CLK_AUDIOMIX_PDM_SEL, so swap it out.

V2:  No change

Comments

Marek Vasut Aug. 31, 2023, 9:53 p.m. UTC | #1
On 8/31/23 06:44, Adam Ford wrote:
> The i.MX8MP has a micfil controller which is used for interfacing
> with a pulse density microphone. Add the node and mark it as
> disabled by default.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> ---
> V3:  The AUDIOMIX_PDM_ROOT doesn't exist and the real clock is
>       called IMX8MP_CLK_AUDIOMIX_PDM_SEL, so swap it out.
> 
> V2:  No change
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> index 3167706d81e1..341fd0369ce9 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> @@ -1479,6 +1479,27 @@ easrc: easrc@30c90000 {
>   					fsl,asrc-format = <2>;
>   					status = "disabled";
>   				};
> +
> +				micfil: audio-controller@30ca0000 {
> +					compatible = "fsl,imx8mp-micfil";
> +					reg = <0x30ca0000 0x10000>;
> +					#sound-dai-cells = <0>;
> +					interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
> +						     <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
> +						     <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
> +						     <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
> +					clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_IPG>,
> +						 <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_SEL>,
> +						 <&clk IMX8MP_AUDIO_PLL1_OUT>,
> +						 <&clk IMX8MP_AUDIO_PLL2_OUT>,
> +						 <&clk IMX8MP_CLK_EXT3>;
> +					clock-names = "ipg_clk", "ipg_clk_app",
> +						      "pll8k", "pll11k", "clkext3";
> +					dmas = <&sdma2 24 25 0x80000000>;
> +					dma-names = "rx";

Is dma-names really required if there is only a single DMA channel in DT ?
Adam Ford Sept. 1, 2023, 11:06 a.m. UTC | #2
On Thu, Aug 31, 2023 at 4:53 PM Marek Vasut <marex@denx.de> wrote:
>
> On 8/31/23 06:44, Adam Ford wrote:
> > The i.MX8MP has a micfil controller which is used for interfacing
> > with a pulse density microphone. Add the node and mark it as
> > disabled by default.
> >
> > Signed-off-by: Adam Ford <aford173@gmail.com>
> > ---
> > V3:  The AUDIOMIX_PDM_ROOT doesn't exist and the real clock is
> >       called IMX8MP_CLK_AUDIOMIX_PDM_SEL, so swap it out.
> >
> > V2:  No change
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > index 3167706d81e1..341fd0369ce9 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > @@ -1479,6 +1479,27 @@ easrc: easrc@30c90000 {
> >                                       fsl,asrc-format = <2>;
> >                                       status = "disabled";
> >                               };
> > +
> > +                             micfil: audio-controller@30ca0000 {
> > +                                     compatible = "fsl,imx8mp-micfil";
> > +                                     reg = <0x30ca0000 0x10000>;
> > +                                     #sound-dai-cells = <0>;
> > +                                     interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
> > +                                                  <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
> > +                                                  <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
> > +                                                  <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
> > +                                     clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_IPG>,
> > +                                              <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_SEL>,
> > +                                              <&clk IMX8MP_AUDIO_PLL1_OUT>,
> > +                                              <&clk IMX8MP_AUDIO_PLL2_OUT>,
> > +                                              <&clk IMX8MP_CLK_EXT3>;
> > +                                     clock-names = "ipg_clk", "ipg_clk_app",
> > +                                                   "pll8k", "pll11k", "clkext3";
> > +                                     dmas = <&sdma2 24 25 0x80000000>;
> > +                                     dma-names = "rx";
>
> Is dma-names really required if there is only a single DMA channel in DT ?

I would normally agree with you, the DT binding file shows it's
required, and the driver looks like it's searching for a channel name
called 'rx'

adam
Marek Vasut Sept. 1, 2023, 3:49 p.m. UTC | #3
On 9/1/23 13:06, Adam Ford wrote:
> On Thu, Aug 31, 2023 at 4:53 PM Marek Vasut <marex@denx.de> wrote:
>>
>> On 8/31/23 06:44, Adam Ford wrote:
>>> The i.MX8MP has a micfil controller which is used for interfacing
>>> with a pulse density microphone. Add the node and mark it as
>>> disabled by default.
>>>
>>> Signed-off-by: Adam Ford <aford173@gmail.com>
>>> ---
>>> V3:  The AUDIOMIX_PDM_ROOT doesn't exist and the real clock is
>>>        called IMX8MP_CLK_AUDIOMIX_PDM_SEL, so swap it out.
>>>
>>> V2:  No change
>>>
>>> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>> index 3167706d81e1..341fd0369ce9 100644
>>> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
>>> @@ -1479,6 +1479,27 @@ easrc: easrc@30c90000 {
>>>                                        fsl,asrc-format = <2>;
>>>                                        status = "disabled";
>>>                                };
>>> +
>>> +                             micfil: audio-controller@30ca0000 {
>>> +                                     compatible = "fsl,imx8mp-micfil";
>>> +                                     reg = <0x30ca0000 0x10000>;
>>> +                                     #sound-dai-cells = <0>;
>>> +                                     interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
>>> +                                                  <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
>>> +                                                  <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
>>> +                                                  <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
>>> +                                     clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_IPG>,
>>> +                                              <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_SEL>,
>>> +                                              <&clk IMX8MP_AUDIO_PLL1_OUT>,
>>> +                                              <&clk IMX8MP_AUDIO_PLL2_OUT>,
>>> +                                              <&clk IMX8MP_CLK_EXT3>;
>>> +                                     clock-names = "ipg_clk", "ipg_clk_app",
>>> +                                                   "pll8k", "pll11k", "clkext3";
>>> +                                     dmas = <&sdma2 24 25 0x80000000>;
>>> +                                     dma-names = "rx";
>>
>> Is dma-names really required if there is only a single DMA channel in DT ?
> 
> I would normally agree with you, the DT binding file shows it's
> required, and the driver looks like it's searching for a channel name
> called 'rx'

Maybe something that can be improved both in the driver and bindings ?
Shawn Guo Sept. 25, 2023, 1:12 a.m. UTC | #4
On Wed, Aug 30, 2023 at 11:44:30PM -0500, Adam Ford wrote:
> The i.MX8MP has a micfil controller which is used for interfacing
> with a pulse density microphone. Add the node and mark it as
> disabled by default.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>

Applied, thanks!
Fabio Estevam Oct. 4, 2023, 1:12 a.m. UTC | #5
Hi Adam and devicetree folks,

On Thu, Aug 31, 2023 at 1:44 AM Adam Ford <aford173@gmail.com> wrote:
>
> The i.MX8MP has a micfil controller which is used for interfacing
> with a pulse density microphone. Add the node and mark it as
> disabled by default.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
> ---
> V3:  The AUDIOMIX_PDM_ROOT doesn't exist and the real clock is
>      called IMX8MP_CLK_AUDIOMIX_PDM_SEL, so swap it out.
>
> V2:  No change
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> index 3167706d81e1..341fd0369ce9 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> @@ -1479,6 +1479,27 @@ easrc: easrc@30c90000 {
>                                         fsl,asrc-format = <2>;
>                                         status = "disabled";
>                                 };
> +
> +                               micfil: audio-controller@30ca0000 {
> +                                       compatible = "fsl,imx8mp-micfil";
> +                                       reg = <0x30ca0000 0x10000>;
> +                                       #sound-dai-cells = <0>;

After this patch, the following schema warning is seen:

imx8mp-beacon-kit.dtb: audio-controller@30ca0000: '#sound-dai-cells'
does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/sound/fsl,micfil.yaml#

What is the correct way to solve this?

- Document #sound-dai-cells in fsl,micfil.yaml as an optional property
- Remove #sound-dai-cells from imx8mp.dtsi
- Document #sound-dai-cells in fsl,micfil.yaml as a required property
and pass #sound-dai-cells to imx8mm/imx8mn/imx83.dtsi?
Adam Ford Oct. 4, 2023, 12:15 p.m. UTC | #6
On Tue, Oct 3, 2023 at 8:12 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Adam and devicetree folks,
>
> On Thu, Aug 31, 2023 at 1:44 AM Adam Ford <aford173@gmail.com> wrote:
> >
> > The i.MX8MP has a micfil controller which is used for interfacing
> > with a pulse density microphone. Add the node and mark it as
> > disabled by default.
> >
> > Signed-off-by: Adam Ford <aford173@gmail.com>
> > ---
> > V3:  The AUDIOMIX_PDM_ROOT doesn't exist and the real clock is
> >      called IMX8MP_CLK_AUDIOMIX_PDM_SEL, so swap it out.
> >
> > V2:  No change
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > index 3167706d81e1..341fd0369ce9 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
> > @@ -1479,6 +1479,27 @@ easrc: easrc@30c90000 {
> >                                         fsl,asrc-format = <2>;
> >                                         status = "disabled";
> >                                 };
> > +
> > +                               micfil: audio-controller@30ca0000 {
> > +                                       compatible = "fsl,imx8mp-micfil";
> > +                                       reg = <0x30ca0000 0x10000>;
> > +                                       #sound-dai-cells = <0>;
>
> After this patch, the following schema warning is seen:
>
> imx8mp-beacon-kit.dtb: audio-controller@30ca0000: '#sound-dai-cells'
> does not match any of the regexes: 'pinctrl-[0-9]+'
> from schema $id: http://devicetree.org/schemas/sound/fsl,micfil.yaml#
>
> What is the correct way to solve this?
>
> - Document #sound-dai-cells in fsl,micfil.yaml as an optional property
> - Remove #sound-dai-cells from imx8mp.dtsi
> - Document #sound-dai-cells in fsl,micfil.yaml as a required property
> and pass #sound-dai-cells to imx8mm/imx8mn/imx83.dtsi?

I am not an expert on yaml, in fact they quite confuse me, but I
believe the proper solution is likely to document them in the yaml.
When I built the device tree without the sound-dai-cells, it threw a
message indicating that it needed to be there when it is configured to
operate.  I didn't see the schema warning that you noted, but my
schema could have been out of date.  Looking at the sai nodes and the
yaml file, it appears that the sound-dai-cells is listed in the yaml.

adam
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 3167706d81e1..341fd0369ce9 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -1479,6 +1479,27 @@  easrc: easrc@30c90000 {
 					fsl,asrc-format = <2>;
 					status = "disabled";
 				};
+
+				micfil: audio-controller@30ca0000 {
+					compatible = "fsl,imx8mp-micfil";
+					reg = <0x30ca0000 0x10000>;
+					#sound-dai-cells = <0>;
+					interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+						     <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
+						     <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
+						     <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_IPG>,
+						 <&audio_blk_ctrl IMX8MP_CLK_AUDIOMIX_PDM_SEL>,
+						 <&clk IMX8MP_AUDIO_PLL1_OUT>,
+						 <&clk IMX8MP_AUDIO_PLL2_OUT>,
+						 <&clk IMX8MP_CLK_EXT3>;
+					clock-names = "ipg_clk", "ipg_clk_app",
+						      "pll8k", "pll11k", "clkext3";
+					dmas = <&sdma2 24 25 0x80000000>;
+					dma-names = "rx";
+					status = "disabled";
+				};
+
 			};
 
 			sdma3: dma-controller@30e00000 {