Lines Matching defs:divisor
153 * they are the same bits in both cases. The divisor values go into the
518 * prescalar and divisor bits in the real register. We'll start with
556 uint32_t divisor, freq, prescale, val32;
572 * sdhci driver will use the original 8-bit divisor field and
573 * the "base / 2^N" divisor scheme.
580 divisor = (val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK;
581 freq = sc->baseclk_hz >> ffs(divisor);
590 * divisor using the "base / 2*N" divisor scheme.
594 divisor = ((val >> SDHCI_DIVIDER_SHIFT) & SDHCI_DIVIDER_MASK) |
597 if (divisor == 0)
600 freq = sc->baseclk_hz / (2 * divisor);
604 * Get a prescaler and final divisor to achieve the desired frequency.
609 for (divisor = 1; freq < sc->baseclk_hz / (prescale * divisor);)
610 ++divisor;
614 "desired SD freq: %d, actual: %d; base %d prescale %d divisor %d\n",
615 freq, sc->baseclk_hz / (prescale * divisor), sc->baseclk_hz,
616 prescale, divisor);
623 divisor -= 1;
626 val32 |= divisor << SDHC_CLK_DIVISOR_SHIFT;