/linux-2.6.39/arch/mips/ath79/ |
D | clock.c | 40 u32 div; in ar71xx_clocks_init() local 46 div = ((pll >> AR71XX_PLL_DIV_SHIFT) & AR71XX_PLL_DIV_MASK) + 1; in ar71xx_clocks_init() 47 freq = div * ath79_ref_clk.rate; in ar71xx_clocks_init() 49 div = ((pll >> AR71XX_CPU_DIV_SHIFT) & AR71XX_CPU_DIV_MASK) + 1; in ar71xx_clocks_init() 50 ath79_cpu_clk.rate = freq / div; in ar71xx_clocks_init() 52 div = ((pll >> AR71XX_DDR_DIV_SHIFT) & AR71XX_DDR_DIV_MASK) + 1; in ar71xx_clocks_init() 53 ath79_ddr_clk.rate = freq / div; in ar71xx_clocks_init() 55 div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2; in ar71xx_clocks_init() 56 ath79_ahb_clk.rate = ath79_cpu_clk.rate / div; in ar71xx_clocks_init() 66 u32 div; in ar724x_clocks_init() local [all …]
|
/linux-2.6.39/arch/arm/mach-omap2/ |
D | clock_common_data.c | 23 { .div = 1, .val = 0, .flags = RATE_IN_24XX | RATE_IN_3XXX }, 24 { .div = 0 } 28 { .div = 1, .val = 1, .flags = RATE_IN_24XX | RATE_IN_3XXX }, 29 { .div = 0 } 33 { .div = 1, .val = 1, .flags = RATE_IN_24XX | RATE_IN_3XXX }, 34 { .div = 2, .val = 2, .flags = RATE_IN_24XX | RATE_IN_3XXX }, 35 { .div = 3, .val = 3, .flags = RATE_IN_243X | RATE_IN_3XXX }, 36 { .div = 4, .val = 4, .flags = RATE_IN_243X | RATE_IN_3XXX }, 37 { .div = 0 } 41 { .div = 1, .val = 1, .flags = RATE_IN_24XX }, [all …]
|
D | clkt_clksel.c | 116 for (clkr = clks->rates; clkr->div; clkr++) { in _get_div_and_fieldval() 120 if (clkr->div > max_div) { in _get_div_and_fieldval() 121 max_div = clkr->div; in _get_div_and_fieldval() 183 for (clkr = clks->rates; clkr->div; clkr++) { in _clksel_to_divisor() 191 if (!clkr->div) { in _clksel_to_divisor() 198 return clkr->div; in _clksel_to_divisor() 211 static u32 _divisor_to_clksel(struct clk *clk, u32 div) in _divisor_to_clksel() argument 217 WARN_ON(div == 0); in _divisor_to_clksel() 223 for (clkr = clks->rates; clkr->div; clkr++) { in _divisor_to_clksel() 227 if (clkr->div == div) in _divisor_to_clksel() [all …]
|
D | clock3xxx_data.c | 113 { .div = 1, .val = 0, .flags = RATE_IN_3XXX }, 114 { .div = 0 } 118 { .div = 1, .val = 1, .flags = RATE_IN_3XXX }, 119 { .div = 0 } 123 { .div = 1, .val = 5, .flags = RATE_IN_3430ES2PLUS_36XX }, 124 { .div = 0 } 128 { .div = 1, .val = 2, .flags = RATE_IN_3XXX }, 129 { .div = 0 } 133 { .div = 1, .val = 3, .flags = RATE_IN_3XXX }, 134 { .div = 0 } [all …]
|
D | clock2420_data.c | 161 { .div = 1, .val = 0, .flags = RATE_IN_24XX }, 162 { .div = 0 }, 166 { .div = 1, .val = 1, .flags = RATE_IN_24XX }, 167 { .div = 0 }, 207 { .div = 2, .val = 0, .flags = RATE_IN_24XX }, 208 { .div = 0 }, 212 { .div = 1, .val = 1, .flags = RATE_IN_24XX }, 213 { .div = 0 }, 262 { .div = 1, .val = 0, .flags = RATE_IN_24XX }, 263 { .div = 0 } [all …]
|
D | clock2430_data.c | 161 { .div = 1, .val = 0, .flags = RATE_IN_24XX }, 162 { .div = 0 }, 166 { .div = 1, .val = 1, .flags = RATE_IN_24XX }, 167 { .div = 0 }, 198 { .div = 1, .val = 0, .flags = RATE_IN_24XX }, 199 { .div = 0 }, 203 { .div = 1, .val = 1, .flags = RATE_IN_243X }, 204 { .div = 0 }, 228 { .div = 2, .val = 0, .flags = RATE_IN_24XX }, 229 { .div = 0 }, [all …]
|
D | clkt2xxx_sys.c | 36 u32 div; in omap2xxx_get_sysclkdiv() local 38 div = __raw_readl(prcm_clksrc_ctrl); in omap2xxx_get_sysclkdiv() 39 div &= OMAP_SYSCLKDIV_MASK; in omap2xxx_get_sysclkdiv() 40 div >>= OMAP_SYSCLKDIV_SHIFT; in omap2xxx_get_sysclkdiv() 42 return div; in omap2xxx_get_sysclkdiv()
|
/linux-2.6.39/arch/mips/jz4740/ |
D | clock.c | 243 int div; in jz_clk_main_round_rate() local 245 div = parent_rate / rate; in jz_clk_main_round_rate() 246 if (div > 32) in jz_clk_main_round_rate() 248 else if (div < 1) in jz_clk_main_round_rate() 251 div &= (0x3 << (ffs(div) - 1)); in jz_clk_main_round_rate() 253 return parent_rate / div; in jz_clk_main_round_rate() 259 uint32_t div; in jz_clk_main_get_rate() local 261 div = jz_clk_reg_read(JZ_REG_CLOCK_CTRL); in jz_clk_main_get_rate() 263 div >>= mclk->div_offset; in jz_clk_main_get_rate() 264 div &= 0xf; in jz_clk_main_get_rate() [all …]
|
/linux-2.6.39/arch/arm/mach-imx/ |
D | clock-imx1.c | 101 int div; in _clk_simple_round_rate() local 106 div = parent_rate / rate; in _clk_simple_round_rate() 108 div++; in _clk_simple_round_rate() 110 if (div > limit) in _clk_simple_round_rate() 111 div = limit; in _clk_simple_round_rate() 113 return parent_rate / div; in _clk_simple_round_rate() 247 unsigned int div; in hclk_set_rate() local 253 div = parent_rate / rate; in hclk_set_rate() 255 if (div > 16 || div < 1 || ((parent_rate / div) != rate)) in hclk_set_rate() 258 div--; in hclk_set_rate() [all …]
|
/linux-2.6.39/arch/arm/plat-s3c24xx/ |
D | clock-dclk.c | 75 unsigned long div; in s3c24xx_calc_div() local 80 div = clk_get_rate(clk->parent) / rate; in s3c24xx_calc_div() 81 if (div < 2) in s3c24xx_calc_div() 82 div = 2; in s3c24xx_calc_div() 83 else if (div > 16) in s3c24xx_calc_div() 84 div = 16; in s3c24xx_calc_div() 86 return div; in s3c24xx_calc_div() 92 unsigned long div = s3c24xx_calc_div(clk, rate); in s3c24xx_round_dclk_rate() local 94 if (div == 0) in s3c24xx_round_dclk_rate() 97 return clk_get_rate(clk->parent) / div; in s3c24xx_round_dclk_rate() [all …]
|
/linux-2.6.39/sound/aoa/soundbus/i2sbus/ |
D | interface.h | 90 # define I2S_SF_MCLKDIV_OTHER(div) (((div/2-1)<<I2S_SF_MCLKDIV_SHIFT)&I2S_SF_MCLKDIV_MASK) argument 91 static inline int i2s_sf_mclkdiv(int div, int *out) in i2s_sf_mclkdiv() argument 95 switch(div) { in i2s_sf_mclkdiv() 101 if (div%2) return -1; in i2s_sf_mclkdiv() 102 d = div/2-1; in i2s_sf_mclkdiv() 105 *out |= I2S_SF_MCLKDIV_OTHER(div); in i2s_sf_mclkdiv() 117 # define I2S_SF_SCLKDIV_OTHER(div) (((div/2-1)<<I2S_SF_SCLKDIV_SHIFT)&I2S_SF_SCLKDIV_MASK) argument 118 static inline int i2s_sf_sclkdiv(int div, int *out) in i2s_sf_sclkdiv() argument 122 switch(div) { in i2s_sf_sclkdiv() 126 if (div%2) return -1; in i2s_sf_sclkdiv() [all …]
|
/linux-2.6.39/drivers/mmc/host/ |
D | sdhci-cns3xxx.c | 31 int div = 1; in sdhci_cns3xxx_set_clock() local 43 while (host->max_clk / div > clock) { in sdhci_cns3xxx_set_clock() 48 if (div < 4) in sdhci_cns3xxx_set_clock() 49 div += 1; in sdhci_cns3xxx_set_clock() 50 else if (div < 256) in sdhci_cns3xxx_set_clock() 51 div *= 2; in sdhci_cns3xxx_set_clock() 57 clock, host->max_clk / div); in sdhci_cns3xxx_set_clock() 60 if (div != 3) in sdhci_cns3xxx_set_clock() 61 div >>= 1; in sdhci_cns3xxx_set_clock() 63 clk = div << SDHCI_DIVIDER_SHIFT; in sdhci_cns3xxx_set_clock()
|
D | sdhci-esdhc.h | 48 int div = 1; in esdhc_set_clock() local 62 while (host->max_clk / pre_div / div > clock && div < 16) in esdhc_set_clock() 63 div++; in esdhc_set_clock() 66 clock, host->max_clk / pre_div / div); in esdhc_set_clock() 69 div--; in esdhc_set_clock() 73 | (div << ESDHC_DIVIDER_SHIFT) in esdhc_set_clock()
|
/linux-2.6.39/arch/h8300/include/asm/ |
D | timer.h | 11 #define calc_param(cnt, div, rate, limit) \ argument 14 for (div = 0; div < ARRAY_SIZE(divide_rate); div++) { \ 15 if (rate[div] == 0) \ 17 if ((cnt / rate[div]) > limit) \ 20 if (div == ARRAY_SIZE(divide_rate)) \ 22 cnt /= divide_rate[div]; \
|
/linux-2.6.39/drivers/media/common/tuners/ |
D | tea5767.c | 136 unsigned int div, frq; in tea5767_status_dump() local 148 div = ((buffer[0] & 0x3f) << 8) | buffer[1]; in tea5767_status_dump() 152 frq = (div * 50000 - 700000 - 225000) / 4; /* Freq in KHz */ in tea5767_status_dump() 155 frq = (div * 50000 + 700000 + 225000) / 4; /* Freq in KHz */ in tea5767_status_dump() 158 frq = (div * 32768 + 700000 + 225000) / 4; /* Freq in KHz */ in tea5767_status_dump() 162 frq = (div * 32768 - 700000 - 225000) / 4; /* Freq in KHz */ in tea5767_status_dump() 165 buffer[0] = (div >> 8) & 0x3f; in tea5767_status_dump() 166 buffer[1] = div & 0xff; in tea5767_status_dump() 169 frq / 1000, frq % 1000, div); in tea5767_status_dump() 194 unsigned div; in set_radio_freq() local [all …]
|
/linux-2.6.39/arch/arm/mach-mx3/ |
D | clock-imx35.c | 49 static void calc_dividers(u32 div, u32 *pre, u32 *post, u32 maxpost) in calc_dividers() argument 53 min_pre = (div - 1) / maxpost + 1; in calc_dividers() 57 if (div > (temp_pre * maxpost)) in calc_dividers() 60 if (div < (temp_pre * temp_pre)) in calc_dividers() 63 err = div % temp_pre; in calc_dividers() 78 *post = (div + *pre - 1) / *pre; in calc_dividers() 82 static void calc_dividers_3_6(u32 div, u32 *pre, u32 *post) in calc_dividers_3_6() argument 84 if (div >= 512) { in calc_dividers_3_6() 87 } else if (div >= 64) { in calc_dividers_3_6() 88 calc_dividers(div, pre, post, 64); in calc_dividers_3_6() [all …]
|
/linux-2.6.39/arch/arm/mach-s3c2440/ |
D | s3c2442.c | 59 int div; in s3c2442_camif_upll_round() local 64 div = parent_rate / rate; in s3c2442_camif_upll_round() 66 if (div == 3) in s3c2442_camif_upll_round() 71 div /= 2; in s3c2442_camif_upll_round() 73 if (div < 1) in s3c2442_camif_upll_round() 74 div = 1; in s3c2442_camif_upll_round() 75 else if (div > 16) in s3c2442_camif_upll_round() 76 div = 16; in s3c2442_camif_upll_round() 78 return parent_rate / (div * 2); in s3c2442_camif_upll_round()
|
/linux-2.6.39/arch/mips/alchemy/devboards/db1200/ |
D | setup.c | 23 unsigned long freq0, clksrc, div, pfc; in board_setup() local 45 div = (get_au1x00_speed() + 25000000) / 50000000; in board_setup() 46 if (div & 1) in board_setup() 47 div++; in board_setup() 48 div = ((div >> 1) - 1) & 0xff; in board_setup() 50 freq0 = div << SYS_FC_FRDIV0_BIT; in board_setup()
|
/linux-2.6.39/arch/arm/mach-tegra/ |
D | clock.c | 87 if (c->mul != 0 && c->div != 0) { in clk_predict_rate_from_parent() 89 rate += c->div - 1; /* round up */ in clk_predict_rate_from_parent() 90 do_div(rate, c->div); in clk_predict_rate_from_parent() 285 int div = 1; in clk_get_rate_all_locked() local 290 if (c->mul != 0 && c->div != 0) { in clk_get_rate_all_locked() 292 div *= c->div; in clk_get_rate_all_locked() 299 do_div(rate, div); in clk_get_rate_all_locked() 490 char div[8] = {0}; in clock_tree_show_one() local 497 if (c->mul != 0 && c->div != 0) { in clock_tree_show_one() 498 if (c->mul > c->div) { in clock_tree_show_one() [all …]
|
/linux-2.6.39/drivers/usb/host/ |
D | octeon2-common.c | 21 u64 div; in octeon2_usb_clocks_start() local 63 div = octeon_get_io_clock_rate() / 130000000ull; in octeon2_usb_clocks_start() 65 switch (div) { in octeon2_usb_clocks_start() 67 div = 1; in octeon2_usb_clocks_start() 75 div = 4; in octeon2_usb_clocks_start() 79 div = 6; in octeon2_usb_clocks_start() 85 div = 8; in octeon2_usb_clocks_start() 88 div = 12; in octeon2_usb_clocks_start() 91 clk_rst_ctl.s.h_div = div; in octeon2_usb_clocks_start()
|
/linux-2.6.39/arch/arm/mach-rpc/include/mach/ |
D | acornfb.h | 85 u_int div; in acornfb_vidc20_find_rates() local 88 div = var->pixclock / 9090; /*9921*/ in acornfb_vidc20_find_rates() 91 if (div == 0) in acornfb_vidc20_find_rates() 92 div = 1; in acornfb_vidc20_find_rates() 93 if (div > 8) in acornfb_vidc20_find_rates() 94 div = 8; in acornfb_vidc20_find_rates() 97 switch (div) { in acornfb_vidc20_find_rates() 136 vidc->pll_ctl = acornfb_vidc20_find_pll(var->pixclock / div); in acornfb_vidc20_find_rates()
|
/linux-2.6.39/arch/arm/mach-s3c2412/ |
D | clock.c | 165 int div; in s3c2412_roundrate_usbsrc() local 170 div = parent_rate / rate; in s3c2412_roundrate_usbsrc() 171 if (div > 2) in s3c2412_roundrate_usbsrc() 172 div = 2; in s3c2412_roundrate_usbsrc() 174 return parent_rate / div; in s3c2412_roundrate_usbsrc() 180 unsigned long div = __raw_readl(S3C2410_CLKDIVN); in s3c2412_getrate_usbsrc() local 182 return parent_rate / ((div & S3C2412_CLKDIVN_USB48DIV) ? 2 : 1); in s3c2412_getrate_usbsrc() 286 int div; in s3c2412_roundrate_clksrc() local 293 div = (rate / parent_rate); in s3c2412_roundrate_clksrc() 295 if (div < 1) in s3c2412_roundrate_clksrc() [all …]
|
/linux-2.6.39/arch/arm/mach-mxs/ |
D | clock-mx23.c | 120 u32 reg, div; \ 123 div = (reg >> BP_CLKCTRL_##sr##_##ss##FRAC) & 0x3f; \ 127 div, PARENT_RATE_SHIFT); \ 169 u32 reg, div; \ 174 div = (reg & BM_CLKCTRL_##rs##_DIV_XTAL) >> \ 177 div = (reg & BM_CLKCTRL_##rs##_DIV_##rs) >> \ 180 if (!div) \ 183 return clk_get_rate(clk->parent) / div; \ 192 u32 reg, div; \ in _CLK_GET_RATE() 195 div = (reg & BM_CLKCTRL_##rs##_DIV) >> BP_CLKCTRL_##rs##_DIV; \ in _CLK_GET_RATE() [all …]
|
/linux-2.6.39/arch/arm/plat-samsung/ |
D | clock-clksrc.c | 57 unsigned int div; in s3c_setrate_clksrc() local 62 div = clk_get_rate(clk->parent) / rate; in s3c_setrate_clksrc() 63 if (div > (1 << sclk->reg_div.size)) in s3c_setrate_clksrc() 68 val |= (div - 1) << sclk->reg_div.shift; in s3c_setrate_clksrc() 108 int div; in s3c_roundrate_clksrc() local 113 div = parent_rate / rate; in s3c_roundrate_clksrc() 115 div++; in s3c_roundrate_clksrc() 117 if (div == 0) in s3c_roundrate_clksrc() 118 div = 1; in s3c_roundrate_clksrc() 119 if (div > max_div) in s3c_roundrate_clksrc() [all …]
|
/linux-2.6.39/drivers/video/omap2/dss/ |
D | rfbi.c | 384 static inline unsigned long round_to_extif_ticks(unsigned long ps, int div) in round_to_extif_ticks() argument 386 int bus_tick = extif_clk_period * div; in round_to_extif_ticks() 390 static int calc_reg_timing(struct rfbi_timings *t, int div) in calc_reg_timing() argument 392 t->clk_div = div; in calc_reg_timing() 394 t->cs_on_time = round_to_extif_ticks(t->cs_on_time, div); in calc_reg_timing() 396 t->we_on_time = round_to_extif_ticks(t->we_on_time, div); in calc_reg_timing() 397 t->we_off_time = round_to_extif_ticks(t->we_off_time, div); in calc_reg_timing() 398 t->we_cycle_time = round_to_extif_ticks(t->we_cycle_time, div); in calc_reg_timing() 400 t->re_on_time = round_to_extif_ticks(t->re_on_time, div); in calc_reg_timing() 401 t->re_off_time = round_to_extif_ticks(t->re_off_time, div); in calc_reg_timing() [all …]
|