Maria Kuzmina

Problem with ssi i.mx35

Discussion created by Maria Kuzmina on Jul 25, 2012

Hi everyone! I write driver for SSI and Ac97 of i.mx35. I can not update sacadd, satag and sacdat registers.

My code

void imx_ac97_write( struct wm97xx *wm9705,unsigned  int  reg, unsigned int val)

  wm9705->hwc->ssi->sacadd=reg;

 wm9705->hwc->ssi->sacdat=val;  

wm9705->hwc->ssi->satag=0xC000;

 wm9705->hwc->ssi->sacnt|=WM9705_WRITE;  

wm9705->hwc->ssi->sacnt&=~WM9705_READ;

 fprintf(stderr,"write :scr=0x%8X\t sacadd=0x%8X\t sacdat=0x%8X\t satag=0x%8X\t sacnt=0x%8X\t\n",in32(base+SSI_SCR),wm9705->hwc->ssi->sacadd,     wm9705->hwc->ssi->sacdat,wm9705->hwc->ssi->satag,wm9705->hwc->ssi->sacnt);

 usleep((useconds_t)DELAYRG);

}

 int AudmuxInit(HW_CONTEXT_T * mx35_exm32, ccm_t * ccm)

{  

mx35_exm32->audmux->ptcr1=0;  


  mx35_exm32->audmux->ptcr1=0;
  mx35_exm32->audmux>ptcr1=AUDMUX_TCLK_DIROUT|AUDMUX_TFS_PORT4;

mx35_exm32->audmux>ptcr1|=AUDMUX_TCLK_PORT4|AUDMUX_SYNC;


  mx35_exm32->audmux->pdcr1=AUDMUX_RXDSEL_PORT4;

  mx35_exm32->audmux->ptcr4 = AUDMUX_SYNC|AUDMUX_TFS_DIROUT;  

  mx35_exm32->audmux->pdcr4 = 0; // 

  ccm->pdr2|=0x141;  

  ccm->cosr=0x7d00002d;  

   ccm->acmr|=0x11;  

   ccm->cosr=0x7d00002d;  

mx35_exm32->ssi->scr=0;  

   mx35_exm32->ssi->scr|=SCR_SSI_EN;  

mx35_exm32->ssi->stccr|=(1<<18);  

mx35_exm32->ssi->stccr|=(9<<13);  

mx35_exm32->ssi->stccr|=(12<<8);   

usleep((useconds_t)DELAYRG);

  mx35_exm32->ssi->sacnt=1;  

mx35_exm32->ssi->scr|=SCR_TX_EN|SCR_TX_EN;  

 

 fprintf(stderr," scr=0x%8X\t",in32(base+SSI_SCR));  

return 0;

}

I see always sacadd, sacdat and satag =0. WHY,

Outcomes