Lines Matching refs:div
397 uint32_t div; in rpi3_sdhost_set_clock() local
405 div = max_clk / clk; in rpi3_sdhost_set_clock()
406 if (div < 2) in rpi3_sdhost_set_clock()
407 div = 2; in rpi3_sdhost_set_clock()
409 if ((max_clk / div) > clk) in rpi3_sdhost_set_clock()
410 div++; in rpi3_sdhost_set_clock()
412 div -= 2; in rpi3_sdhost_set_clock()
413 if (div > HC_CLOCKDIVISOR_MAXVAL) in rpi3_sdhost_set_clock()
414 div = HC_CLOCKDIVISOR_MAXVAL; in rpi3_sdhost_set_clock()
416 rpi3_sdhost_params.clk_rate = max_clk / (div + 2); in rpi3_sdhost_set_clock()
421 mmio_write_32(reg_base + HC_CLOCKDIVISOR, div); in rpi3_sdhost_set_clock()