imx233: always start SSPCLK before ungating the spp blocks

This should fix some boot hang issues which appeared at random.

Change-Id: I5430690a61c042b45ed26b58f485a1cc5d82987f
This commit is contained in:
Amaury Pouly 2013-09-26 20:12:42 +02:00
parent f75310598c
commit 120701646f

View file

@ -117,16 +117,8 @@ void imx233_ssp_init(void)
}
}
void imx233_ssp_start(int ssp)
static void start_ssp_clock(void)
{
ASSERT_SSP(ssp)
if(ssp_in_use[ssp - 1])
return;
ssp_in_use[ssp - 1] = true;
/* Gate block */
imx233_ssp_softreset(ssp);
/* Gate dma channel */
imx233_dma_clkgate_channel(APB_SSP(ssp), true);
/* If first block to start, start SSP clock */
if(ssp_nr_in_use == 0)
{
@ -140,6 +132,20 @@ void imx233_ssp_start(int ssp)
#endif
imx233_clkctrl_enable(CLK_SSP, true);
}
}
void imx233_ssp_start(int ssp)
{
ASSERT_SSP(ssp)
if(ssp_in_use[ssp - 1])
return;
ssp_in_use[ssp - 1] = true;
/* Enable SSP clock (need to start block) */
start_ssp_clock();
/* Gate block */
imx233_ssp_softreset(ssp);
/* Gate dma channel */
imx233_dma_clkgate_channel(APB_SSP(ssp), true);
ssp_nr_in_use++;
}