Lines Matching refs:divisor
158 * they are the same bits in both cases. The divisor values go into the
527 * prescalar and divisor bits in the real register. We'll start with
568 uint32_t divisor, freq, prescale, val32;
584 * the sdhci driver will use the original 8-bit divisor field
585 * and the "base / 2^N" divisor scheme.
595 divisor = (val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK;
596 freq = sc->baseclk_hz >> ffs(divisor);
605 * divisor using the "base / 2*N" divisor scheme.
609 divisor = ((val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK) |
612 if (divisor == 0)
615 freq = sc->baseclk_hz / (2 * divisor);
619 * Get a prescaler and final divisor to achieve the desired frequency.
624 for (divisor = 1; freq < sc->baseclk_hz / (prescale * divisor);)
625 ++divisor;
629 "desired SD freq: %d, actual: %d; base %d prescale %d divisor %d\n",
630 freq, sc->baseclk_hz / (prescale * divisor), sc->baseclk_hz,
631 prescale, divisor);
638 divisor -= 1;
641 val32 |= divisor << SDHC_CLK_DIVISOR_SHIFT;