-static void glamo_mci_fix_card_div(struct glamo_mci_host *host, int div)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&host->pdata->core->lock, flags);
-
- if (div < 0) {
- /* stop clock - remove clock from divider input */
- writew(readw(host->pdata->core->base +
- GLAMO_REG_CLOCK_GEN5_1) & (~GLAMO_CLOCK_GEN51_EN_DIV_TCLK),
- host->pdata->core->base + GLAMO_REG_CLOCK_GEN5_1);
- } else {
-
- if (host->force_slow_during_powerup)
- div = host->clk_rate / sd_post_power_clock;
- else if (host->pdata->glamo_mmc_use_slow &&
- host->pdata->glamo_mmc_use_slow())
- div = div * sd_slow_ratio;
-
- if (div > 255)
- div = 255;
- /*
- * set the nearest prescaler factor
- *
- * register shared with SCLK divisor -- no chance of race because
- * we don't use sensor interface
- */
- writew((readw(host->pdata->core->base +
- GLAMO_REG_CLOCK_GEN8) & 0xff00) | div,
- host->pdata->core->base + GLAMO_REG_CLOCK_GEN8);
- /* enable clock to divider input */
- writew(readw(host->pdata->core->base +
- GLAMO_REG_CLOCK_GEN5_1) | GLAMO_CLOCK_GEN51_EN_DIV_TCLK,
- host->pdata->core->base + GLAMO_REG_CLOCK_GEN5_1);
- }
- spin_unlock_irqrestore(&host->pdata->core->lock, flags);
- mdelay(5);
-}
-