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.

TLV320ADC3140: Please configure a driver code according to the information provided

Part Number: TLV320ADC3140
Other Parts Discussed in Thread: TLV320ADC5140

hi,

      please see the attached file and information below to configure a driver code, thanks! 

      Slave mode, DSP provide MClk =12288000, simple-audio-card, mclk-fs = <256>; 48k sampling,

      4 analog microphones,single end,I2S interface, TDM protocol

BR,

Jeremy Woo

  • Hi Jeremy,

    You can find drivers for the TLV320ADC3140 on our website here:  

    or upstream in the Linux kernels here: 

    https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/sound/soc/codecs/tlv320adcx140.c?h=v5.9.6

    https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/sound/soc/codecs/tlv320adcx140.h?h=v5.9.6

    with documentation here:

    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/sound/tlv320adcx140.yaml

    We do not provide custom driver configurations, it is up to the user to configure the driver as needed.

    Best,

    Zak

  • Jeremy,

    The DTS usually has two areas that need the device to be described: i2c and sound. For i2C you would have the following entry with options specific to a device. These options are typically documented in the yaml or txt file for the driver. For example for tlv320adcx140:

    &i2c0 {

    tlv320adc5140: tlv320adc5140@4c {

    compatible = "ti,tlv320adc5140";
    #sound-dai-cells = <0>;
    reg = <0x4c>;
    /* Digital Mics */

    ti,mic-bias-source = <0>;
    ti,pdm-edge-select = <1 1 1 1>;
    ti,gpio-config = <0 0>;
    ti,gpi-config = <4 5 6 7>;
    ti,gpo-config-1 = <4 1>;
    ti,gpo-config-2 = <4 1>;
    ti,gpo-config-3 = <4 1>;
    ti,gpo-config-4 = <4 1>;
    ti,slot-mapping = <0 1 2 3>;
    ti,asi-tx-driver = <0>;

    reset-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;

    };

    };
    Also the DTS must describe the pins connected to the processor TDM or I2S bus. For a BeagleBone Black with a Sitara class processor using the McASP0 as the TDM bus peripheral with 32-bit data and TDM bus (dsp_a). Using the same example for tlv320adc5140 using only four channels:
    &mcasp0 {
    #sound-dai-cells = <0>;
    pinctrl-names = "default";
    pinctrl-0 = <&mcasp0_pins>;
    status = "okay";
    op-mode = <0>; /* MCASP_IIS_MODE */
    tdm-slots = <4>;
    serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
                         2 0 1 0
                       >;
    tx-num-evt = <32>;
    rx-num-evt = <32>;
    };
    / {
    clk_mcasp0_fixed: clk_mcasp0_fixed {
    #clock-cells = <0>;
    compatible = "fixed-clock";
    clock-frequency = <24576000>;
    };
    clk_mcasp0: clk_mcasp0 {
    #clock-cells = <0>;
    compatible = "gpio-gate-clock";
    clocks = <&clk_mcasp0_fixed>;
    enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
    };
    sound {
    compatible = "simple-audio-card";
    simple-audio-card,name = "TI BeagleBone Black";
    #sound-dai-cells = <0>;
    simple-audio-card,dai-link@0 {
    format = "dsp_a";
    bitclock-master = <&sound0_master>;
    frame-master = <&sound0_master>;
    sound0_master: cpu {
    sound-dai = <&mcasp0>;
    clocks = <&clk_mcasp0>;

    dai-tdm-slot-num = <4>;
    dai-tdm-slot-width = <32>;
    dai-tdm-slot-tx-mask = <1 1 1 1>;
    dai-tdm-slot-rx-mask = <1 1 1 1>;

    };

    codec {

    sound-dai = <&tlv320adc5140>;

    };

    };
    };
    };
    Note that our TI ADC devices typically use the "dsp_a" bus format for TDM bus. For I2S bus, use "i2s" as the bus format. This is specified in the format command on the sound portion of the DTS.
    Note that the clock frequency is set in clock-frequency above. Sampling rates are passed by the arecord command. For more information, see my FAQ page with example linux commands, the latest version, and also the same documentation pointed by Zak.

    Best regards,
    Pedro