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.

How to integrate IDT821034DST Codec with MCASP for a Sitara AM3358 processor?

Other Parts Discussed in Thread: AM3358, PCM5102A

Hello Everybody

I am a newbie and have a IDT821034DST and a AM3358 processor

I want to do following these from scratch:

  - connect between codec and mcasp and set pins

  - write correct device drivers (linux)

  - and write an application for using of mcasp

But I do not know, how can do above items

Please guide me

Best Regards,

Davood

  • Hi,

    I will ask the software team to help.
  • Hi,

    Davood Rezaei said:
    - connect between codec and mcasp and set pins

     

    I. For this you'll need to modify your device tree file. Here is an example using MCASP0. 

    You will need to do the following configurations: 
      1. Configure McASP pinmux: 

    &am33xx_pinmux {
    +            mcasp0_pins: mcasp0_pins {
    +               pinctrl-single,pins = <
    +                        0x190 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mcasp0_aclkx */
    +                        0x194 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mcasp0_fsx*/
    +                        0x198 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* mcasp0_axr0 */
    +               >;
    + }; };

      2. Add dts node that configures & enables McASP0: 
    +  &mcasp0 { 
    +              pinctrl-names = "default"; 

    +              pinctrl-0 = <&mcasp0_pins>;

    +             status = "okay";

    +           op-mode = <0>; /* MCASP_IIS_MODE, or whichever mode suits your use case */

    +           tdm-slots = <2>;

    +           /* 16 serializer */

    +           serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */

    +                     1 0 0 0

    +           >;

    +           tx-num-evt = <32>;

    +           rx-num-evt = <32>;

    +};

      3. Add a codec node in the dts

    / {

    +          pcm5102a: pcm5102a {
    +                     compatible = "ti,pcm5102a";      /*this should be clued with your custom idt821034dst driver, which should have .compatilbe = value*/
    +          };

      4. Add a sound node, which glues the mcasp0 & the codec together. 

    / {

                idt821034dst: idt821034dst {
                          compatible = "ti,idt821034dsta";                 
                };

    +            sound {
    +                    compatible = "ti,idt821034dst-evm-audio";
    +                     ti,model = "TI IDT821034DTS";
    +                     ti,audio-codec = <&idt821034dst>;
    +                     ti,mcasp-controller = <&mcasp0>;
    +                     ti,codec-clock-rate = <24000000>;
    +           };

    };

    Davood Rezaei said:
    - write correct device drivers (linux)

    II. You need to configure:

    1. The alsa machine layer

    2. Create DAI structure

    3. Create the codec HW params structure

    4. Fill the codec ops structure

    For the above four points & dts configuration see the following step by step gudie: http://processors.wiki.ti.com/index.php/Sitara_Linux_Audio_DAC_Example 

    For the IDT821034DST driver itself, you'll need to create it by following the instrucions/recommendations in the codec datasheet. Or you could ask the vendor, if they have a ready to use driver or sample code. 

    Davood Rezaei said:
    - and write an application for using of mcasp

    III. This is very use case dependent. I cannot be of much help here. 

    Best Regards, 

    Yordan

  • Hi and good morning

    Thank you so much Yordan for the reply

    This is very useful for start point.
    But if i have any question later, can i ask?

    Best Regards
    Davood
  • Hi,

    Yes you can start a thread on the forum.

    Best Regards,
    Yordan