Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4730

Linux Kernel • Writing a DTS file for the audio codec.

$
0
0
Hello,
I'm a beginner in writing a .dts file for the audio codec (MAX98090), and although I faced many challenges in writing a .dts file, I was finally nearing completion, but could not complete it. I need your help in completing the code as I have none of them to guide me through this.
I'm not able to hear any sound in the speaker or in the headphones while playing the audio through the GPIO I2S interface of the RPi4.
When I checked using the logic analyzer, it showed that the RPi4 was capturing the audio, although tried configuring the codec as master and RPi4 as the slave, it didn't work.
Kindly help me with the corrections in the .dts file.

I'm attaching the datasheet and the source file link below.
https://www.analog.com/media/en/technic ... X98090.pdf
https://github.com/raspberrypi/linux/bl ... max98090.c

The max98090.dts file,

Code:

/dts-v1/;/plugin/;/ {    compatible = "brcm,bcm2835";    fragment@0 {        target = <&i2s>;        __overlay__ {            status = "okay";            bitclock-master = <&i2s>;            frame-master = <&i2s>;            clock-frequency = <12288000>;        };    };    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>;// edge falling interrupt (2) in GPIO 27                clocks = <&clk_oscillator>;                 clock-names = "mclk";                      maxim,micbias = <3>;                status = "okay";            };        };    };    fragment@2 {        target-path = "/";        __overlay__ {            clk_oscillator: oscillator {                compatible = "fixed-clock";                #clock-cells = <0>;                clock-frequency = <12288000>;                 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 = <&i2s>;              simple-audio-card,frame-master = <&i2s>;               simple-audio-card,widgets =                "Microphone", "Mic Jack",                "Speaker", "Speaker",                "Headphone", "Headphone Jack";            simple-audio-card,routing =                "Headphone Jack", "HPL",                "Headphone Jack", "HPR",                "Speaker", "SPKL",                "Speaker", "SPKR",                "IN1", "Mic Jack",                "IN2", "Mic Jack",                "IN3", "Mic Jack",                "IN4", "Mic Jack";            status = "okay";            simple-audio-card,cpu {                sound-dai = <&i2s>;                dai-name = "HiFi";              };            dailink_master: simple-audio-card,codec {                sound-dai = <&max98090_codec>;                 dai-name = "HiFi";             };        };    };        __overrides__ {        card-name = <&sound_overlay>, "simple-audio-card,name";    };};
The dmesg log

Code:

pi@raspberrypi:~ $ dmesg | grep max98090[    8.529478] max98090 1-0010: MAX98090 REVID=0x43
No other logs like "Headphone detected", etc., appear here other than this.
Please Help! :cry:
Your help means a lot to me...

Statistics: Posted by electronics_enthu — Sat Dec 07, 2024 11:44 am — Replies 0 — Views 5



Viewing all articles
Browse latest Browse all 4730

Trending Articles