diff mbox series

dtoverlays: Added DT overlay file for MAX98090 and the detailed steps for its usage is included in https://github.com/Poojaa-Rangaiah/DeviceTreeOverlay-for-MAX98090 .

Message ID 20241218065848.12254-1-poojaamonica94@gmail.com (mailing list archive)
State New
Headers show
Series dtoverlays: Added DT overlay file for MAX98090 and the detailed steps for its usage is included in https://github.com/Poojaa-Rangaiah/DeviceTreeOverlay-for-MAX98090 . | expand

Commit Message

Poojaa R Dec. 18, 2024, 6:58 a.m. UTC
Only the driver files were existing for max98090 audio codec (playback and capture) but now the max98090.dts file is also included in linux/arch/arm/boot/dts/overlays/.
new file:   arch/arm/boot/dts/overlays/max98090.dts

Signed-off-by: Poojaa R <poojaamonica94@gmail.com>
---
 arch/arm/boot/dts/overlays/max98090.dts | 96 +++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 arch/arm/boot/dts/overlays/max98090.dts

Comments

Conor Dooley Dec. 18, 2024, 2:28 p.m. UTC | #1
On Wed, Dec 18, 2024 at 12:28:48PM +0530, Poojaa R wrote:
> Only the driver files were existing for max98090 audio codec (playback and capture) but now the max98090.dts file is also included in linux/arch/arm/boot/dts/overlays/.
> new file:   arch/arm/boot/dts/overlays/max98090.dts
> 
> Signed-off-by: Poojaa R <poojaamonica94@gmail.com>

Why have you send this patch for your random github tree to lkml?

Thanks,
Conor.

> ---
>  arch/arm/boot/dts/overlays/max98090.dts | 96 +++++++++++++++++++++++++
>  1 file changed, 96 insertions(+)
>  create mode 100644 arch/arm/boot/dts/overlays/max98090.dts
> 
> diff --git a/arch/arm/boot/dts/overlays/max98090.dts b/arch/arm/boot/dts/overlays/max98090.dts
> new file mode 100644
> index 000000000000..eaf197384edb
> --- /dev/null
> +++ b/arch/arm/boot/dts/overlays/max98090.dts
> @@ -0,0 +1,96 @@
> +/*
> + * Device Tree Overlay for MAX98090, MAX98091 Audio Codec.
> + * https://github.com/Poojaa-Rangaiah/DeviceTreeOverlay-for-MAX98090 => for more details.
> + * MAX98090 audio codec as master and Raspberry Pi as slave.
> + */
> +
> +/dts-v1/;
> +/plugin/;
> +
> +/ {
> +    compatible = "brcm,bcm2835", "brcm,bcm2711";
> +
> +    fragment@0 {
> +        target = <&i2s_clk_consumer>;
> +        __overlay__ {
> +            status = "okay";
> +        };
> +    };
> +
> +    fragment@1 {
> +        target = <&i2c1>;
> +        __overlay__ {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            status = "okay";
> +            max98090_codec: max98090@10 {
> +                #sound-dai-cells = <0>;
> +                compatible = "maxim,max98090","maxim,max98091";
> +                reg = <0x10>;
> +                interrupt-parent = <&gpio>;
> +                interrupts = <27 2>;	/* GPIO 27 as Edge_Falling_IRQ (2) */
> +                maxim,micbias = <3>;
> +                status = "okay";
> +            };
> +        };
> +    };
> +
> +    fragment@2 {
> +        target-path = "/";
> +        __overlay__ {
> +            clk_oscillator: oscillator {
> +                compatible = "fixed-clock";
> +                #clock-cells = <0>;
> +                clock-frequency = <12288000>;  /* Frequency of the external oscillator (mclk = 12.288 MHz) but can also be 11.2896 MHz/12 MHz/13 MHz/26 MHz/19.2 MHz. */
> +                clock-output-names = "mclk";
> +            };
> +        };
> +    };
> +
> +    fragment@3 {
> +        target = <&sound>;
> +        sound_overlay: __overlay__ {
> +            compatible = "simple-audio-card";
> +            simple-audio-card,format = "i2s";
> +            simple-audio-card,name = "MAX98090-Codec";
> +            simple-audio-card,bitclock-master = <&dailink0_master>;
> +            simple-audio-card,frame-master = <&dailink0_master>;
> +
> +            simple-audio-card,widgets =
> +                "Microphone", "Mic Jack",
> +                "Speaker", "Speaker",
> +                "Line", "Line In",
> +                "Line", "Line Out",
> +                "Headphone", "Headphone Jack";
> +
> +            simple-audio-card,routing =
> +                "Headphone Jack", "HPL",
> +                "Headphone Jack", "HPR",
> +                "Line Out", "RCVL",
> +                "Line Out", "RCVR", 
> +                /* Uncomment any of these below lines if the Line Input(s) is(are) used else leave it as such. */
> +                //"IN5", "Line In",  /* IN1/IN2/IN3/IN4/IN6 (For single ended input) */
> +                //"IN56", "Line In", /* IN34 (For differential inputs) */
> +                "MIC1", "Mic Jack",
> +                "MIC2", "Mic Jack",
> +                "Speaker", "SPKL",
> +                "Speaker", "SPKR";
> +
> +            status = "okay";
> +
> +            simple-audio-card,cpu {
> +                sound-dai = <&i2s_clk_consumer>;
> +            };
> +
> +            dailink0_master: simple-audio-card,codec {
> +                sound-dai = <&max98090_codec>;
> +                clocks = <&clk_oscillator>;
> +            };
> +        };
> +    };
> +    
> +    __overrides__ {
> +        card-name = <&sound_overlay>, "simple-audio-card,name";
> +    };
> +};
> +
> -- 
> 2.34.1
> 
>
Conor Dooley Dec. 18, 2024, 4:10 p.m. UTC | #2
On Wed, Dec 18, 2024 at 09:25:13PM +0530, Poojaa Rangaiah wrote:
> 
> On Wed, Dec 18, 2024, 7:58 PM Conor Dooley <conor@kernel.org> wrote:
> 
> > On Wed, Dec 18, 2024 at 12:28:48PM +0530, Poojaa R wrote:
> > > Only the driver files were existing for max98090 audio codec (playback
> > and capture) but now the max98090.dts file is also included in
> > linux/arch/arm/boot/dts/overlays/.
> > > new file:   arch/arm/boot/dts/overlays/max98090.dts
> > >
> > > Signed-off-by: Poojaa R <poojaamonica94@gmail.com>
> >
> > Why have you send this patch for your random github tree to lkml?

> Sorry for that, I wanted it to be just mentioned in commits so people who
> don't have an idea can refer to it. But I didn't expect that to be
> mentioned in the subject.

Right, so it is not a random patch but one you want included in
mainline? Given this is something only usable on the RPi, you should
move this file to the broadcom directory and CC the relevant
maintainers.

Additionally, the correct filetype for overlays is .dtso nor should
there be dtso files in the kernel tree that are never built.

Cheers,
Conor.

> >
> > Thanks,
> > Conor.
> >
> > > ---
> > >  arch/arm/boot/dts/overlays/max98090.dts | 96 +++++++++++++++++++++++++
> > >  1 file changed, 96 insertions(+)
> > >  create mode 100644 arch/arm/boot/dts/overlays/max98090.dts
> > >
> > > diff --git a/arch/arm/boot/dts/overlays/max98090.dts
> > b/arch/arm/boot/dts/overlays/max98090.dts
> > > new file mode 100644
> > > index 000000000000..eaf197384edb
> > > --- /dev/null
> > > +++ b/arch/arm/boot/dts/overlays/max98090.dts
> > > @@ -0,0 +1,96 @@
> > > +/*
> > > + * Device Tree Overlay for MAX98090, MAX98091 Audio Codec.
> > > + * https://github.com/Poojaa-Rangaiah/DeviceTreeOverlay-for-MAX98090
> > => for more details.
> > > + * MAX98090 audio codec as master and Raspberry Pi as slave.
> > > + */
> > > +
> > > +/dts-v1/;
> > > +/plugin/;
> > > +
> > > +/ {
> > > +    compatible = "brcm,bcm2835", "brcm,bcm2711";
> > > +
> > > +    fragment@0 {
> > > +        target = <&i2s_clk_consumer>;
> > > +        __overlay__ {
> > > +            status = "okay";
> > > +        };
> > > +    };
> > > +
> > > +    fragment@1 {
> > > +        target = <&i2c1>;
> > > +        __overlay__ {
> > > +            #address-cells = <1>;
> > > +            #size-cells = <0>;
> > > +            status = "okay";
> > > +            max98090_codec: max98090@10 {
> > > +                #sound-dai-cells = <0>;
> > > +                compatible = "maxim,max98090","maxim,max98091";
> > > +                reg = <0x10>;
> > > +                interrupt-parent = <&gpio>;
> > > +                interrupts = <27 2>; /* GPIO 27 as Edge_Falling_IRQ (2)
> > */
> > > +                maxim,micbias = <3>;
> > > +                status = "okay";
> > > +            };
> > > +        };
> > > +    };
> > > +
> > > +    fragment@2 {
> > > +        target-path = "/";
> > > +        __overlay__ {
> > > +            clk_oscillator: oscillator {
> > > +                compatible = "fixed-clock";
> > > +                #clock-cells = <0>;
> > > +                clock-frequency = <12288000>;  /* Frequency of the
> > external oscillator (mclk = 12.288 MHz) but can also be 11.2896 MHz/12
> > MHz/13 MHz/26 MHz/19.2 MHz. */
> > > +                clock-output-names = "mclk";
> > > +            };
> > > +        };
> > > +    };
> > > +
> > > +    fragment@3 {
> > > +        target = <&sound>;
> > > +        sound_overlay: __overlay__ {
> > > +            compatible = "simple-audio-card";
> > > +            simple-audio-card,format = "i2s";
> > > +            simple-audio-card,name = "MAX98090-Codec";
> > > +            simple-audio-card,bitclock-master = <&dailink0_master>;
> > > +            simple-audio-card,frame-master = <&dailink0_master>;
> > > +
> > > +            simple-audio-card,widgets =
> > > +                "Microphone", "Mic Jack",
> > > +                "Speaker", "Speaker",
> > > +                "Line", "Line In",
> > > +                "Line", "Line Out",
> > > +                "Headphone", "Headphone Jack";
> > > +
> > > +            simple-audio-card,routing =
> > > +                "Headphone Jack", "HPL",
> > > +                "Headphone Jack", "HPR",
> > > +                "Line Out", "RCVL",
> > > +                "Line Out", "RCVR",
> > > +                /* Uncomment any of these below lines if the Line
> > Input(s) is(are) used else leave it as such. */
> > > +                //"IN5", "Line In",  /* IN1/IN2/IN3/IN4/IN6 (For single
> > ended input) */
> > > +                //"IN56", "Line In", /* IN34 (For differential inputs)
> > */
> > > +                "MIC1", "Mic Jack",
> > > +                "MIC2", "Mic Jack",
> > > +                "Speaker", "SPKL",
> > > +                "Speaker", "SPKR";
> > > +
> > > +            status = "okay";
> > > +
> > > +            simple-audio-card,cpu {
> > > +                sound-dai = <&i2s_clk_consumer>;
> > > +            };
> > > +
> > > +            dailink0_master: simple-audio-card,codec {
> > > +                sound-dai = <&max98090_codec>;
> > > +                clocks = <&clk_oscillator>;
> > > +            };
> > > +        };
> > > +    };
> > > +
> > > +    __overrides__ {
> > > +        card-name = <&sound_overlay>, "simple-audio-card,name";
> > > +    };
> > > +};
> > > +
> > > --
> > > 2.34.1
> > >
> > >
> >
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/overlays/max98090.dts b/arch/arm/boot/dts/overlays/max98090.dts
new file mode 100644
index 000000000000..eaf197384edb
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/max98090.dts
@@ -0,0 +1,96 @@ 
+/*
+ * Device Tree Overlay for MAX98090, MAX98091 Audio Codec.
+ * https://github.com/Poojaa-Rangaiah/DeviceTreeOverlay-for-MAX98090 => for more details.
+ * MAX98090 audio codec as master and Raspberry Pi as slave.
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+    compatible = "brcm,bcm2835", "brcm,bcm2711";
+
+    fragment@0 {
+        target = <&i2s_clk_consumer>;
+        __overlay__ {
+            status = "okay";
+        };
+    };
+
+    fragment@1 {
+        target = <&i2c1>;
+        __overlay__ {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            status = "okay";
+            max98090_codec: max98090@10 {
+                #sound-dai-cells = <0>;
+                compatible = "maxim,max98090","maxim,max98091";
+                reg = <0x10>;
+                interrupt-parent = <&gpio>;
+                interrupts = <27 2>;	/* GPIO 27 as Edge_Falling_IRQ (2) */
+                maxim,micbias = <3>;
+                status = "okay";
+            };
+        };
+    };
+
+    fragment@2 {
+        target-path = "/";
+        __overlay__ {
+            clk_oscillator: oscillator {
+                compatible = "fixed-clock";
+                #clock-cells = <0>;
+                clock-frequency = <12288000>;  /* Frequency of the external oscillator (mclk = 12.288 MHz) but can also be 11.2896 MHz/12 MHz/13 MHz/26 MHz/19.2 MHz. */
+                clock-output-names = "mclk";
+            };
+        };
+    };
+
+    fragment@3 {
+        target = <&sound>;
+        sound_overlay: __overlay__ {
+            compatible = "simple-audio-card";
+            simple-audio-card,format = "i2s";
+            simple-audio-card,name = "MAX98090-Codec";
+            simple-audio-card,bitclock-master = <&dailink0_master>;
+            simple-audio-card,frame-master = <&dailink0_master>;
+
+            simple-audio-card,widgets =
+                "Microphone", "Mic Jack",
+                "Speaker", "Speaker",
+                "Line", "Line In",
+                "Line", "Line Out",
+                "Headphone", "Headphone Jack";
+
+            simple-audio-card,routing =
+                "Headphone Jack", "HPL",
+                "Headphone Jack", "HPR",
+                "Line Out", "RCVL",
+                "Line Out", "RCVR", 
+                /* Uncomment any of these below lines if the Line Input(s) is(are) used else leave it as such. */
+                //"IN5", "Line In",  /* IN1/IN2/IN3/IN4/IN6 (For single ended input) */
+                //"IN56", "Line In", /* IN34 (For differential inputs) */
+                "MIC1", "Mic Jack",
+                "MIC2", "Mic Jack",
+                "Speaker", "SPKL",
+                "Speaker", "SPKR";
+
+            status = "okay";
+
+            simple-audio-card,cpu {
+                sound-dai = <&i2s_clk_consumer>;
+            };
+
+            dailink0_master: simple-audio-card,codec {
+                sound-dai = <&max98090_codec>;
+                clocks = <&clk_oscillator>;
+            };
+        };
+    };
+    
+    __overrides__ {
+        card-name = <&sound_overlay>, "simple-audio-card,name";
+    };
+};
+