1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 22:30:37 +02:00

libubb/mmcclk.c: use symbolic bit/field definitions for MSC_*

This commit is contained in:
Werner Almesberger 2013-01-20 17:34:17 -03:00
parent 8509c1f7b9
commit 4cb68b7ece

View File

@ -70,15 +70,16 @@ void mmcclk_start(struct mmcclk *dsc)
MSCCDR = dsc->clkdiv; /* set controller clock */
CLKGR &= ~(1 << 7); /* enable MSC clock */
MSC_STRPCL = 1 << 3; /* reset the MSC */
while (MSC_STAT & (1 << 15)); /* wait until reset finishes */
MSC_STRPCL = MSC_STRPCRL_RESET; /* reset the MSC */
while (MSC_STAT & MSC_STAT_IS_RESETTING);
/* wait until reset finishes */
MSC_CLKRT = dsc->clkrt; /* set bus clock */
MSC_STRPCL = 2; /* start MMC bus clock output */
MSC_STRPCL = MSC_STRPCRL_START_CLOCK;
}
void mmcclk_stop(void)
{
MSC_STRPCL = 1; /* stop MMC bus clock output */
MSC_STRPCL = MSC_STRPCRL_STOP_CLOCK;
}