Post Go back to editing

ALSA Implementation Questions with adau1761 codec

Thread Summary

The user encountered I2C and ALSA hw_params errors while implementing the ADAU1761 codec on a SoC using Synopsys I2C/I2S IP. The I2C issue was resolved by changing the device address from 0x70 to 0x38. However, the user is still facing issues with the firmware upload from the kernel, despite the firmware working correctly when loaded via a converter. The user asks if a custom firmware download algorithm is required in the machine driver.
AI Generated Content
Category: Software
Product Number: ADAU1761
Below are some of the dts I wrote.
I want to implement ALSA by applying it as above, but the parts that are not applied well are as follows

1. ADAU1761 probe error occurred
: : Unable to sync register 0x4002-0x4002

2. hw_params error during aplay test
: : ASoC: can't set adau-hifi hw params: -121
: : Unable to install hw_params
3. # cat /proc/asound/card0/pcm0p/sub0/hw_params  : closed 
I used synopsys i2c/i2s IP on SoC Chip.
I need your help.  
  codec_clk: codec-clock {
        #clock-cells = <0>;
        compatible = "fixed-clock";
        clock-frequency = <12288000>;
    };  
       
sound {
            compatible ="simple-audio-card";
            i2s-controller = <&i2s0>;
            status = "okay";

            simple-audio-card.name = "adau1761";
            simple-audio-card,format = "i2s";
            simple-audio-card,bitclock-master = <&dailink0_master>;
            simple-audio-card,frame-master = <&dailink0_master>;

            simple-audio-card,widgets =
            "Headphone", "Headphones",
            "Line" , "Line In",
            "Line", "Line Out",
            "Microphone", "Mic In";

            simple-audio-card,routing =
            "Headphones", "LHP",
            "Headphones", "RHP",
            "Line Out", "LOUT",
            "Line Out", "ROUT",
            "Mic In", "MICBIAS",
            "LINN", "Mic In",
            "RINN", "Mic In",
            "LINP", "Mic In",
            "RINP", "Mic In",
            "LAUX", "Line In",
            "RAUX", "Line In";

            simple-audio-card,cpu {
                status = "okay";
                sound-dai = <&i2s0>;
            };
            dailink0_master: simple-audio-card,codec {
                status = "okay";
                sound-dai = <&adau1761>;
            };
        };

        i2s: i2s@reg_addr {
            compatible = "snps,designware-i2s";
            reg = <0x0 reg_addr 0x0 0x4000>;
            #sound-dai-cells = <0>;
            clocks = <&clock CLKEN_I2S_APB>;
            clock-names = "i2sclk";
            dmas = <&pdma0 0>, <&pdma0 1>;
            dma-names = "tx", "rx";
            status = "okay";
        };
        i2c: i2c@reg_addr {
            compatible = "snps,designware-i2c";
            reg = <0x0 reg_addr 0x0 0x4000>;
            #address-cells = <1>;
            #size-cells = <0>;
            clock-frequency = <400000>;
            clock-names = "ic_clk", "pclk";
            clocks = <&clock CLKEN_I2C6_CORE>, <&clock CLKEN_I2C6_APB>;
            pinctrl-0 = <&pinctrl_i2c6_default>;
            pinctrl-names = "default";
            status = "okay";

            adau1761:adau1761@70{
                compatible = "adi,adau1761";
                #sound-dai-cells = <0>;
                reg = <0x70>;
                clocks = <&codec_clk>;
                clock-names = "mclk";
            };

        };

Thread Notes