| /OK3568_Linux_fs/kernel/drivers/clk/ti/ |
| H A D | divider.c | 2 * TI Divider Clock 40 static void _setup_mask(struct clk_omap_divider *divider) in _setup_mask() argument 46 if (divider->table) { in _setup_mask() 49 for (clkt = divider->table; clkt->div; clkt++) in _setup_mask() 53 max_val = divider->max; in _setup_mask() 55 if (!(divider->flags & CLK_DIVIDER_ONE_BASED) && in _setup_mask() 56 !(divider->flags & CLK_DIVIDER_POWER_OF_TWO)) in _setup_mask() 60 if (divider->flags & CLK_DIVIDER_POWER_OF_TWO) in _setup_mask() 65 divider->mask = (1 << fls(mask)) - 1; in _setup_mask() 68 static unsigned int _get_div(struct clk_omap_divider *divider, unsigned int val) in _get_div() argument [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/tegra/ |
| H A D | clk-divider.c | 21 static int get_div(struct tegra_clk_frac_div *divider, unsigned long rate, in get_div() argument 26 div = div_frac_get(rate, parent_rate, divider->width, in get_div() 27 divider->frac_width, divider->flags); in get_div() 38 struct tegra_clk_frac_div *divider = to_clk_frac_div(hw); in clk_frac_div_recalc_rate() local 43 reg = readl_relaxed(divider->reg); in clk_frac_div_recalc_rate() 45 if ((divider->flags & TEGRA_DIVIDER_UART) && in clk_frac_div_recalc_rate() 49 div = (reg >> divider->shift) & div_mask(divider); in clk_frac_div_recalc_rate() 51 mul = get_mul(divider); in clk_frac_div_recalc_rate() 64 struct tegra_clk_frac_div *divider = to_clk_frac_div(hw); in clk_frac_div_round_rate() local 71 div = get_div(divider, rate, output_rate); in clk_frac_div_round_rate() [all …]
|
| H A D | clk.h | 95 * struct tegra_clk_frac_div - fractional divider clock 98 * @reg: register containing divider 100 * @shift: shift to the divider bit field 101 * @width: width of the divider bit field 106 * TEGRA_DIVIDER_ROUND_UP - This flags indicates to round up the divider value. 108 * flag indicates that this divider is for fixed rate PLL. 110 * fraction bit is set. This flags indicates to calculate divider for which 112 * TEGRA_DIVIDER_UART - UART module divider has additional enable bit which is 113 * set when divider value is not 0. This flags indicates that the divider 158 * @n: feedback divider [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/baikal-t1/ |
| H A D | ccu-div.h | 17 * CCU Divider private clock IDs 25 * CCU Divider private flags 26 * @CCU_DIV_SKIP_ONE: Due to some reason divider can't be set to 1. 28 * @CCU_DIV_SKIP_ONE_TO_THREE: For some reason divider can't be within [1,3]. 39 * enum ccu_div_type - CCU Divider types 40 * @CCU_DIV_VAR: Clocks gate with variable divider. 41 * @CCU_DIV_GATE: Clocks gate with fixed divider. 42 * @CCU_DIV_BUF: Clock gate with no divider. 43 * @CCU_DIV_FIXED: Ungateable clock with fixed divider. 53 * struct ccu_div_init_data - CCU Divider initialization data [all …]
|
| H A D | ccu-div.c | 79 unsigned long divider) in ccu_div_var_update_clkdiv() argument 86 nd = ccu_div_lock_delay_ns(parent_rate, divider); in ccu_div_var_update_clkdiv() 136 pr_err("Divider '%s' lock timed out\n", clk_hw_get_name(hw)); in ccu_div_var_enable() 212 unsigned long divider; in ccu_div_var_recalc_rate() local 216 divider = ccu_div_get(div->mask, val); in ccu_div_var_recalc_rate() 218 return ccu_div_calc_freq(parent_rate, divider); in ccu_div_var_recalc_rate() 225 unsigned long divider; in ccu_div_var_calc_divider() local 227 divider = parent_rate / rate; in ccu_div_var_calc_divider() 228 return clamp_t(unsigned long, divider, CCU_DIV_CLKDIV_MIN, in ccu_div_var_calc_divider() 236 unsigned long divider; in ccu_div_var_round_rate() local [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/rockchip/regmap/ |
| H A D | clk-regmap-divider.c | 4 * Base on code in drivers/clk/clk-divider.c. 5 * See clk-divider.c for further copyright information. 28 struct clk_regmap_divider *divider = to_clk_regmap_divider(hw); in clk_regmap_divider_recalc_rate() local 31 regmap_read(divider->regmap, divider->reg, &val); in clk_regmap_divider_recalc_rate() 33 div = val >> divider->shift; in clk_regmap_divider_recalc_rate() 34 div &= div_mask(divider->width); in clk_regmap_divider_recalc_rate() 37 CLK_DIVIDER_ROUND_CLOSEST, divider->width); in clk_regmap_divider_recalc_rate() 44 struct clk_regmap_divider *divider = to_clk_regmap_divider(hw); in clk_regmap_divider_round_rate() local 46 return divider_round_rate(hw, rate, prate, NULL, divider->width, in clk_regmap_divider_round_rate() 68 struct clk_regmap_divider *divider = to_clk_regmap_divider(hw); in clk_regmap_divider_set_rate() local [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/mvebu/ |
| H A D | dove-divider.c | 3 * Marvell Dove PMU Core PLL divider driver 15 #include "dove-divider.h" 53 unsigned int divider; in dove_get_divider() local 59 divider = val & ~(~0 << dc->div_bit_size); in dove_get_divider() 62 divider = dc->divider_table[divider]; in dove_get_divider() 64 return divider; in dove_get_divider() 70 unsigned int divider, max; in dove_calc_divider() local 72 divider = DIV_ROUND_CLOSEST(parent_rate, rate); in dove_calc_divider() 78 if (divider == dc->divider_table[i]) { in dove_calc_divider() 79 divider = i; in dove_calc_divider() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/zynqmp/ |
| H A D | divider.c | 3 * Zynq UltraScale+ MPSoC Divider support 7 * Adjustable divider clock implementation 16 * DOC: basic adjustable divider clock that cannot gate 32 * struct zynqmp_clk_divider - adjustable divider clock 35 * @is_frac: The divider is a fractional divider 72 * zynqmp_clk_divider_recalc_rate() - Recalc rate of divider clock 81 struct zynqmp_clk_divider *divider = to_zynqmp_clk_divider(hw); in zynqmp_clk_divider_recalc_rate() local 83 u32 clk_id = divider->clk_id; in zynqmp_clk_divider_recalc_rate() 84 u32 div_type = divider->div_type; in zynqmp_clk_divider_recalc_rate() 91 pr_warn_once("%s() get divider failed for %s, ret = %d\n", in zynqmp_clk_divider_recalc_rate() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/ |
| H A D | clk-divider.c | 7 * Adjustable divider clock implementation 19 * DOC: basic adjustable divider clock that cannot gate 28 static inline u32 clk_div_readl(struct clk_divider *divider) in clk_div_readl() argument 30 if (divider->flags & CLK_DIVIDER_BIG_ENDIAN) in clk_div_readl() 31 return ioread32be(divider->reg); in clk_div_readl() 33 return readl(divider->reg); in clk_div_readl() 36 static inline void clk_div_writel(struct clk_divider *divider, u32 val) in clk_div_writel() argument 38 if (divider->flags & CLK_DIVIDER_BIG_ENDIAN) in clk_div_writel() 39 iowrite32be(val, divider->reg); in clk_div_writel() 41 writel(val, divider->reg); in clk_div_writel() [all …]
|
| H A D | clk-milbeaut.c | 379 struct m10v_clk_divider *divider = to_m10v_div(hw); in m10v_clk_divider_recalc_rate() local 382 val = readl(divider->reg) >> divider->shift; in m10v_clk_divider_recalc_rate() 383 val &= clk_div_mask(divider->width); in m10v_clk_divider_recalc_rate() 385 return divider_recalc_rate(hw, parent_rate, val, divider->table, in m10v_clk_divider_recalc_rate() 386 divider->flags, divider->width); in m10v_clk_divider_recalc_rate() 392 struct m10v_clk_divider *divider = to_m10v_div(hw); in m10v_clk_divider_round_rate() local 395 if (divider->flags & CLK_DIVIDER_READ_ONLY) { in m10v_clk_divider_round_rate() 398 val = readl(divider->reg) >> divider->shift; in m10v_clk_divider_round_rate() 399 val &= clk_div_mask(divider->width); in m10v_clk_divider_round_rate() 401 return divider_ro_round_rate(hw, rate, prate, divider->table, in m10v_clk_divider_round_rate() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/qcom/ |
| H A D | clk-regmap-divider.c | 11 #include "clk-regmap-divider.h" 21 struct clk_regmap_div *divider = to_clk_regmap_div(hw); in div_round_ro_rate() local 22 struct clk_regmap *clkr = ÷r->clkr; in div_round_ro_rate() 25 regmap_read(clkr->regmap, divider->reg, &val); in div_round_ro_rate() 26 val >>= divider->shift; in div_round_ro_rate() 27 val &= BIT(divider->width) - 1; in div_round_ro_rate() 29 return divider_ro_round_rate(hw, rate, prate, NULL, divider->width, in div_round_ro_rate() 36 struct clk_regmap_div *divider = to_clk_regmap_div(hw); in div_round_rate() local 38 return divider_round_rate(hw, rate, prate, NULL, divider->width, in div_round_rate() 45 struct clk_regmap_div *divider = to_clk_regmap_div(hw); in div_set_rate() local [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/rockchip/ |
| H A D | clk-dclk-divider.c | 18 struct clk_divider *divider = to_clk_divider(hw); in clk_dclk_recalc_rate() local 21 val = clk_readl(divider->reg) >> divider->shift; in clk_dclk_recalc_rate() 22 val &= div_mask(divider->width); in clk_dclk_recalc_rate() 30 struct clk_divider *divider = to_clk_divider(hw); in clk_dclk_round_rate() local 31 int div, maxdiv = div_mask(divider->width) + 1; in clk_dclk_round_rate() 33 div = DIV_ROUND_UP_ULL(divider->max_prate, rate); in clk_dclk_round_rate() 44 struct clk_divider *divider = to_clk_divider(hw); in clk_dclk_set_rate() local 49 value = divider_get_val(rate, parent_rate, divider->table, in clk_dclk_set_rate() 50 divider->width, divider->flags); in clk_dclk_set_rate() 52 if (divider->lock) in clk_dclk_set_rate() [all …]
|
| H A D | clk-half-divider.c | 25 struct clk_divider *divider = to_clk_divider(hw); in clk_half_divider_recalc_rate() local 28 val = readl(divider->reg) >> divider->shift; in clk_half_divider_recalc_rate() 29 val &= div_mask(divider->width); in clk_half_divider_recalc_rate() 60 * The maximum divider we can use without overflowing in clk_half_divider_bestdiv() 90 struct clk_divider *divider = to_clk_divider(hw); in clk_half_divider_round_rate() local 94 divider->width, in clk_half_divider_round_rate() 95 divider->flags); in clk_half_divider_round_rate() 103 struct clk_divider *divider = to_clk_divider(hw); in clk_half_divider_set_rate() local 110 value = min_t(unsigned int, value, div_mask(divider->width)); in clk_half_divider_set_rate() 112 if (divider->lock) in clk_half_divider_set_rate() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/imx/ |
| H A D | clk-fixup-div.c | 15 * struct clk_fixup_div - imx integer fixup divider clock 16 * @divider: the parent class 20 * The imx fixup divider clock is a subclass of basic clk_divider 24 struct clk_divider divider; member 31 struct clk_divider *divider = to_clk_divider(hw); in to_clk_fixup_div() local 33 return container_of(divider, struct clk_fixup_div, divider); in to_clk_fixup_div() 41 return fixup_div->ops->recalc_rate(&fixup_div->divider.hw, parent_rate); in clk_fixup_div_recalc_rate() 49 return fixup_div->ops->round_rate(&fixup_div->divider.hw, rate, prate); in clk_fixup_div_round_rate() 57 unsigned int divider, value; in clk_fixup_div_set_rate() local 61 divider = parent_rate / rate; in clk_fixup_div_set_rate() [all …]
|
| H A D | clk-composite-8m.c | 31 struct clk_divider *divider = to_clk_divider(hw); in imx8m_clk_composite_divider_recalc_rate() local 36 prediv_value = readl(divider->reg) >> divider->shift; in imx8m_clk_composite_divider_recalc_rate() 37 prediv_value &= clk_div_mask(divider->width); in imx8m_clk_composite_divider_recalc_rate() 40 NULL, divider->flags, in imx8m_clk_composite_divider_recalc_rate() 41 divider->width); in imx8m_clk_composite_divider_recalc_rate() 43 div_value = readl(divider->reg) >> PCG_DIV_SHIFT; in imx8m_clk_composite_divider_recalc_rate() 47 divider->flags, PCG_DIV_WIDTH); in imx8m_clk_composite_divider_recalc_rate() 95 struct clk_divider *divider = to_clk_divider(hw); in imx8m_clk_composite_divider_set_rate() local 107 spin_lock_irqsave(divider->lock, flags); in imx8m_clk_composite_divider_set_rate() 109 val = readl(divider->reg); in imx8m_clk_composite_divider_set_rate() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/mxs/ |
| H A D | clk-div.c | 12 * struct clk_div - mxs integer divider clock 13 * @divider: the parent class 18 * The mxs divider clock is a subclass of basic clk_divider with an 22 struct clk_divider divider; member 30 struct clk_divider *divider = to_clk_divider(hw); in to_clk_div() local 32 return container_of(divider, struct clk_div, divider); in to_clk_div() 40 return div->ops->recalc_rate(&div->divider.hw, parent_rate); in clk_div_recalc_rate() 48 return div->ops->round_rate(&div->divider.hw, rate, prate); in clk_div_round_rate() 57 ret = div->ops->set_rate(&div->divider.hw, rate, parent_rate); in clk_div_set_rate() 90 div->divider.reg = reg; in mxs_clk_div() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/media/tuners/ |
| H A D | tda18218_priv.h | 20 #define R07_MD1 0x07 /* Main divider byte 1 */ 22 #define R09_MD2 0x09 /* Main divider byte 2 */ 23 #define R0A_MD3 0x0a /* Main divider byte 1 */ 24 #define R0B_MD4 0x0b /* Main divider byte 4 */ 25 #define R0C_MD5 0x0c /* Main divider byte 5 */ 26 #define R0D_MD6 0x0d /* Main divider byte 6 */ 27 #define R0E_MD7 0x0e /* Main divider byte 7 */ 28 #define R0F_MD8 0x0f /* Main divider byte 8 */ 29 #define R10_CD1 0x10 /* Call divider byte 1 */ 30 #define R11_CD2 0x11 /* Call divider byte 2 */ [all …]
|
| /OK3568_Linux_fs/u-boot/arch/arm/cpu/armv7/bcm235xx/ |
| H A D | clk-core.h | 64 /* programmable divider. 0 means fixed ratio to parent clock */ 228 * output rate of the clock. Each divider can be either fixed or 229 * variable. If there are two dividers, they are the "pre-divider" 230 * and the "regular" or "downstream" divider. If there is only one, 231 * there is no pre-divider. 233 * A fixed divider is any non-zero (positive) value, and it 234 * indicates how the input rate is affected by the divider. 236 * The value of a variable divider is maintained in a sub-field of a 237 * 32-bit divider register. The position of the field in the 241 * In addition, a variable divider can indicate that some subset [all …]
|
| /OK3568_Linux_fs/u-boot/arch/arm/cpu/armv7/bcm281xx/ |
| H A D | clk-core.h | 64 /* programmable divider. 0 means fixed ratio to parent clock */ 228 * output rate of the clock. Each divider can be either fixed or 229 * variable. If there are two dividers, they are the "pre-divider" 230 * and the "regular" or "downstream" divider. If there is only one, 231 * there is no pre-divider. 233 * A fixed divider is any non-zero (positive) value, and it 234 * indicates how the input rate is affected by the divider. 236 * The value of a variable divider is maintained in a sub-field of a 237 * 32-bit divider register. The position of the field in the 241 * In addition, a variable divider can indicate that some subset [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/clock/ti/ |
| H A D | divider.txt | 1 Binding for TI divider clock 6 register-mapped adjustable clock rate divider that does not gate and has 44 The binding must also provide the register to control the divider and 45 unless the divider array is provided, min and max dividers. Optionally 56 - compatible : shall be "ti,divider-clock" or "ti,composite-divider-clock". 59 - reg : offset for register controlling adjustable divider 64 - ti,bit-shift : number of bits to shift the divider value, defaults to 0 78 - ti,latch-bit : latch the divider value to HW, only needed if the register 79 access requires this. As an example dra76x DPLL_GMAC H14 divider implements 85 compatible = "ti,divider-clock"; [all …]
|
| /OK3568_Linux_fs/kernel/drivers/gpu/drm/amd/amdgpu/ |
| H A D | amdgpu_pll.c | 70 * amdgpu_pll_get_fb_ref_div - feedback and ref divider calculation 74 * @post_div: post divider 75 * @fb_div_max: feedback divider maximum 76 * @ref_div_max: reference divider maximum 77 * @fb_div: resulting feedback divider 78 * @ref_div: resulting reference divider 80 * Calculate feedback and reference divider for a given post divider. Makes 87 /* limit reference * post divider to a maximum */ in amdgpu_pll_get_fb_ref_div() 90 /* get matching reference and feedback divider */ in amdgpu_pll_get_fb_ref_div() 94 /* limit fb divider to its maximum */ in amdgpu_pll_get_fb_ref_div() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/bcm/ |
| H A D | clk-kona.h | 228 * output rate of the clock. Each divider can be either fixed or 229 * variable. If there are two dividers, they are the "pre-divider" 230 * and the "regular" or "downstream" divider. If there is only one, 231 * there is no pre-divider. 233 * A fixed divider is any non-zero (positive) value, and it 234 * indicates how the input rate is affected by the divider. 236 * The value of a variable divider is maintained in a sub-field of a 237 * 32-bit divider register. The position of the field in the 241 * In addition, a variable divider can indicate that some subset 242 * of its bits represent a "fractional" part of the divider. Such [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/clock/ |
| H A D | xgene.txt | 37 reset and/or the divider. Either may be omitted, but at least 55 - divider-offset : Offset to the divider CSR register from the divider base. 57 - divider-width : Width of the divider register. Default is 0. 58 - divider-shift : Bit shift of the divider register. Default is 0. 107 divider-offset = <0x238>; 108 divider-width = <0x9>; 109 divider-shift = <0x0>; 125 divider-offset = <0x10>; 126 divider-width = <0x2>; 127 divider-shift = <0x0>;
|
| /OK3568_Linux_fs/u-boot/arch/m68k/cpu/mcf532x/ |
| H A D | speed.c | 31 /* Low Power Divider specifications */ 32 #define MIN_LPD (0) /* Divider (not encoded) */ 33 #define MAX_LPD (15) /* Divider (not encoded) */ 34 #define DEFAULT_LPD (0) /* Divider (not encoded) */ 42 /* Low Power Divider specifications */ 43 #define MIN_LPD (1 << 0) /* Divider (not encoded) */ 44 #define MAX_LPD (1 << 15) /* Divider (not encoded) */ 45 #define DEFAULT_LPD (1 << 1) /* Divider (not encoded) */ 48 #define BUSDIV 6 /* Divider */ 55 int divider; in get_sys_clock() local [all …]
|
| /OK3568_Linux_fs/kernel/drivers/clk/ingenic/ |
| H A D | cgu.h | 27 * @n_shift: the number of bits to shift the divider value by (ie. the 28 * index of the lowest bit of the divider value in the PLL's 30 * @n_bits: the size of the divider field in bits 31 * @n_offset: the divider value which encodes to 0 in the PLL's control 33 * @od_shift: the number of bits to shift the post-VCO divider value by (ie. 34 * the index of the lowest bit of the post-VCO divider value in 36 * @od_bits: the size of the post-VCO divider field in bits 37 * @od_max: the maximum post-VCO divider value 38 * @od_encoding: a pointer to an array mapping post-VCO divider values to 75 * struct ingenic_cgu_div_info - information about a divider [all …]
|