how to set SSI work in network mode, how the SSI connect to AUDMUX

cancel
Showing results for 
Search instead for 
Did you mean: 

how to set SSI work in network mode, how the SSI connect to AUDMUX

Jump to solution
1,535 Views
Contributor III

Hi All,

Does the freescale has some documents for the SSI how to set as a network mode, i want set SSI working in network mode, with 2.048MHZ T/R clock, with 8K sync clock. also, i checked the source codes of BSP for support codec wm8962 (smart device), they used SSI 1 for AUDMUX, internal port of AUDMUX is 2, external port is 4, i can saw how to configure the AUDMUX for port2 and 4, but i don't found how the SSI 1 to connect to AUDMUX internal port 2.

thank you

Labels (6)
0 Kudos
1 Solution
22 Views
Contributor II

I suspect you have fallen into the numbering trap ... linux counts the

ports from 0 upwards, while the documentation starts counting at 1 upwards.

So, from the perspective of Linux, ssi1 connects to port 0, ssi2 to port 1

etc. Not sure which kernel version you are using, but when you call

mxc_audmux_v2_configure_port

(it is called imx_audmux_v2_configure_port in my version) you are passing

zero-based port numbers. So to connect AUDMUX port2 to AUDMUX port5, you

would call configure_port on port 1 and then port 4. Each port has 2

registers (each of 4 bytes), so multiply the zero-based port number by 8 to

get the PTCR, and add another 4 to get to the PDCR. This caught me out at

first too...

View solution in original post

0 Kudos
6 Replies
22 Views
Contributor III

Hi Uolli,

I have a similar requirement of 2.048MHZ T/R clock, with 8K frame sync clock. But while configuring 2.048MHz of TX/RX clock i am getting frame sync of 32Khz.

Is there any way to get 8Khz of Frame sync clock with 2.048 MHz of bit clock in i.MX6D?

Please suggest any solution.

Thanks

Sumit

0 Kudos
22 Views
Contributor II

As I understand it, SSI1 is permanently connected to AUDMUX port 1, SSI2 to port 2, and SSI3 (if applicable) to AUDMUX port 7. You can't change these assignments.Also, note that there is a difference between SSI modes and AUDMUX modes ... both have a "Normal" mode, but they are very different! The SSI mode bits allow you to select between "Normal", I2S master and I2S slave. The AUDMUX modes are normal (point to point) and network (1 to many).

Hope that helps.

0 Kudos
22 Views
Contributor III

Hi Nick,

Thank you.

I thought just same to your mentioned as i checked some documents, but compared to sabrelite board setting as my post mentioned, they used SSI 1, but used AUDMUX2 for internal port, not AUDMUX1(as they defined src_port is 2, ext_port is 4, so, comparing to codes as following shows, they must used audmux2 not audmux1). i am confusing for that. i have checked the datasheet too, but there is no any clue for explain how the SSI connect to AUDMUX internal port.

---------

#define MXC_AUDMUX_V2_PTCR(x)           ((x) * 8)

#define MXC_AUDMUX_V2_PDCR(x)           ((x) * 8 + 4)

int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,

                unsigned int pdcr)

{

        if (!audmux_base)

                return -ENOSYS;

        if (audmux_clk)

                clk_enable(audmux_clk);

        writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port));

        writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port));

        if (audmux_clk)

                clk_disable(audmux_clk);

        return 0;

}

EXPORT_SYMBOL_GPL(mxc_audmux_v2_configure_port);

---------------------

0 Kudos
23 Views
Contributor II

I suspect you have fallen into the numbering trap ... linux counts the

ports from 0 upwards, while the documentation starts counting at 1 upwards.

So, from the perspective of Linux, ssi1 connects to port 0, ssi2 to port 1

etc. Not sure which kernel version you are using, but when you call

mxc_audmux_v2_configure_port

(it is called imx_audmux_v2_configure_port in my version) you are passing

zero-based port numbers. So to connect AUDMUX port2 to AUDMUX port5, you

would call configure_port on port 1 and then port 4. Each port has 2

registers (each of 4 bytes), so multiply the zero-based port number by 8 to

get the PTCR, and add another 4 to get to the PDCR. This caught me out at

first too...

View solution in original post

0 Kudos
22 Views
Contributor III

Thank you, Nick. i used linux 3.0.15-g108480f-dirty kernel.

For example, if i want connect the SSI1 to a physical codec through AUDMUX3 (external port), can i configure the audmux as following

--------------------------------

static int imx_audmux_config(int slave, int master)

{

  unsigned int ptcr, pdcr;

  slave = slave - 1;

  master = master - 1;

  ptcr = MXC_AUDMUX_V2_PTCR_SYN |

  MXC_AUDMUX_V2_PTCR_TFSDIR |

  MXC_AUDMUX_V2_PTCR_TFSEL(master) |

  MXC_AUDMUX_V2_PTCR_TCLKDIR |

  MXC_AUDMUX_V2_PTCR_TCSEL(master);

  pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(master);

  mxc_audmux_v2_configure_port(slave, ptcr, pdcr);//configure internal port

  ptcr = MXC_AUDMUX_V2_PTCR_SYN;

  pdcr = MXC_AUDMUX_V2_PDCR_RXDSEL(slave);

  mxc_audmux_v2_configure_port(master, ptcr, pdcr);//configure external port

  return 0;

}

.

.....

static void audmux_test(void){

imx_audmux_config(1,3);//1 is internal port of audmux, 3 is external port of audmux

}

Thank you

0 Kudos
22 Views
Contributor II

Looks right to me ....

0 Kudos