This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCM1865: Driver

Part Number: PCM1865

I am using iMX8M dev board with PCM1865 ADC. Kernel version - Linux 4.19.35

I am not able to get the PCM1865 codec under ALSA driver list. Below is my device tree configuration with simple-audio-card.

sound-pcm1865 {
                compatible = "simple-audio-card";
                simple-audio-card,name = "pcm1865-audio";
                simple-audio-card,widgets =
                        "Line", "Line In Jack 1",
                        "Line", "Line In Jack 2",
                        "Line", "Line In Jack 3",
                        "Line", "Line In Jack 4";
                simple-audio-card,routing =
                        "Line In Jack 1", "VINL1",
                        "Line In Jack 1", "VINR1",
                        "Line In Jack 2", "VINL2",
                        "Line In Jack 2", "VINR2",
                        "Line In Jack 3", "VINL3",
                        "Line In Jack 3", "VINR3",
                        "Line In Jack 4", "VINL4",
                        "Line In Jack 4", "VINR4";
                simple-audio-card,format = "i2s";
                simple-audio-card,bitclock-master = <&sound_master>;
                simple-audio-card,frame-master = <&sound_master>;

                sound_master: simple-audio-card,cpu {
                        sound-dai = <&sai2>;
                };

                simple-audio-card,codec {
                        sound-dai = <&pcm1865>;
                        system-clock-frequency = <12288000>;
                };
        };

&sai2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sai2>;
        assigned-clocks = <&clk IMX8MM_CLK_SAI2>;
        assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
        assigned-clock-rates = <12288000>;
        status = "okay";
};

&i2c4 {
        clock-frequency = <100000>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2c4>;
        status = "okay";

        pcm1865: codec@4a {
                #sound-dai-cells = <1>;
                compatible = "ti,pcm1865";
                reg = <0x4a>;
                clock-names = "mclk";
                avdd-supply = <&ldo1_reg>;
                dvdd-supply = <&ldo1_reg>;
                iovdd-supply = <&ldo1_reg>;
                status = "okay";
        };
};

I am also not sure about the HW wiring required for the ALSA driver. Currently, I have connected I2C (SCL, SDA) lines to iMX8M board only. Separate power is given with common ground. 

Is I2S connection (BCLK, LRCK, DOUT also MCLK) required to get the PCM1865 codec detected under ALSA driver list ?

  • Hi Malay,

    It is not necessary to connect the I2S lines for the ADC to be detected since all communication between the ADC and driver happen over I2C.

    You may first want to verify that the PCM1865 is being powered up properly.

    I am not a Linux expert, but you may also need to check your setup of I2C and verify that the PCM186x address is correct. MD0 should be pulled low to put the device in I2C mode and then the address will depend on the state of the MS/AD pin. You can verify the I2C connection by using an i2cget command to attempt to read a register on the device

    Best,

    Zak

  • Thank you Zak for this clarification.