/Linux-v5.10/drivers/clk/tegra/ |
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 …]
|
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 …]
|
/Linux-v5.10/drivers/clk/ti/ |
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 …]
|
D | clk-dra7-atl.c | 57 u32 divider; /* Cached divider value */ member 93 cdesc->divider - 1); in atl_clk_enable() 128 return parent_rate / cdesc->divider; in atl_clk_recalc_rate() 134 unsigned divider; in atl_clk_round_rate() local 136 divider = (*parent_rate + rate / 2) / rate; in atl_clk_round_rate() 137 if (divider > DRA7_ATL_DIVIDER_MASK + 1) in atl_clk_round_rate() 138 divider = DRA7_ATL_DIVIDER_MASK + 1; in atl_clk_round_rate() 140 return *parent_rate / divider; in atl_clk_round_rate() 147 u32 divider; in atl_clk_set_rate() local 153 divider = ((parent_rate + rate / 2) / rate) - 1; in atl_clk_set_rate() [all …]
|
/Linux-v5.10/drivers/clk/baikal-t1/ |
D | ccu-div.h | 17 * CCU Divider private flags 18 * @CCU_DIV_SKIP_ONE: Due to some reason divider can't be set to 1. 20 * @CCU_DIV_SKIP_ONE_TO_THREE: For some reason divider can't be within [1,3]. 31 * enum ccu_div_type - CCU Divider types 32 * @CCU_DIV_VAR: Clocks gate with variable divider. 33 * @CCU_DIV_GATE: Clocks gate with fixed divider. 34 * @CCU_DIV_FIXED: Ungateable clock with fixed divider. 43 * struct ccu_div_init_data - CCU Divider initialization data 47 * @base: Divider register base address with respect to the sys_regs base. 50 * @type: CCU divider type (variable, fixed with and without gate). [all …]
|
D | ccu-div.c | 78 unsigned long divider) in ccu_div_var_update_clkdiv() argument 85 nd = ccu_div_lock_delay_ns(parent_rate, divider); in ccu_div_var_update_clkdiv() 135 pr_err("Divider '%s' lock timed out\n", clk_hw_get_name(hw)); in ccu_div_var_enable() 177 unsigned long divider; in ccu_div_var_recalc_rate() local 181 divider = ccu_div_get(div->mask, val); in ccu_div_var_recalc_rate() 183 return ccu_div_calc_freq(parent_rate, divider); in ccu_div_var_recalc_rate() 190 unsigned long divider; in ccu_div_var_calc_divider() local 192 divider = parent_rate / rate; in ccu_div_var_calc_divider() 193 return clamp_t(unsigned long, divider, CCU_DIV_CLKDIV_MIN, in ccu_div_var_calc_divider() 201 unsigned long divider; in ccu_div_var_round_rate() local [all …]
|
/Linux-v5.10/drivers/clk/qcom/ |
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 …]
|
/Linux-v5.10/drivers/clk/mvebu/ |
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 …]
|
/Linux-v5.10/drivers/clk/zynqmp/ |
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 …]
|
/Linux-v5.10/drivers/clk/ |
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 …]
|
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 …]
|
/Linux-v5.10/drivers/clk/imx/ |
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 …]
|
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 …]
|
D | clk-divider-gate.c | 15 struct clk_divider divider; member 23 return container_of(div, struct clk_divider_gate, divider); in to_clk_divider_gate() 170 * NOTE: In order to reuse the most code from the common divider, 171 * we also design our divider following the way that provids an extra 201 div_gate->divider.reg = reg; in imx_clk_hw_divider_gate() 202 div_gate->divider.shift = shift; in imx_clk_hw_divider_gate() 203 div_gate->divider.width = width; in imx_clk_hw_divider_gate() 204 div_gate->divider.lock = lock; in imx_clk_hw_divider_gate() 205 div_gate->divider.table = table; in imx_clk_hw_divider_gate() 206 div_gate->divider.hw.init = &init; in imx_clk_hw_divider_gate() [all …]
|
/Linux-v5.10/drivers/clk/mxs/ |
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 …]
|
/Linux-v5.10/drivers/clk/rockchip/ |
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() 70 * parent rate, so return the divider immediately. in clk_half_divider_bestdiv() 98 struct clk_divider *divider = to_clk_divider(hw); in clk_half_divider_round_rate() local 102 divider->width, in clk_half_divider_round_rate() 103 divider->flags); in clk_half_divider_round_rate() 111 struct clk_divider *divider = to_clk_divider(hw); in clk_half_divider_set_rate() local 118 value = min_t(unsigned int, value, div_mask(divider->width)); in clk_half_divider_set_rate() [all …]
|
/Linux-v5.10/drivers/media/tuners/ |
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 …]
|
/Linux-v5.10/Documentation/devicetree/bindings/clock/ti/ |
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 …]
|
/Linux-v5.10/Documentation/devicetree/bindings/clock/ |
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>;
|
D | keystone-pll.txt | 4 a divider and a post divider. The additional PLL IPs like ARMPLL, DDRPLL 18 - reg-names : control, multiplier and post-divider. The multiplier and 19 post-divider registers are applicable only for main pll clock 20 - fixed-postdiv : fixed post divider value. If absent, use clkod register bits 29 reg-names = "control", "multiplier", "post-divider"; 66 - compatible : shall be "ti,keystone,pll-divider-clock" 70 - bit-mask : arbitrary bitmask for programming the divider 78 compatible = "ti,keystone,pll-divider-clock";
|
/Linux-v5.10/drivers/gpu/drm/amd/amdgpu/ |
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 …]
|
/Linux-v5.10/drivers/clk/ingenic/ |
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 …]
|
/Linux-v5.10/drivers/clk/bcm/ |
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 …]
|
/Linux-v5.10/Documentation/devicetree/bindings/iio/afe/ |
D | voltage-divider.txt | 1 Voltage divider 4 When an io-channel measures the midpoint of a voltage divider, the 6 of the divider. This binding describes the voltage divider in such 24 - compatible : "voltage-divider" 28 - full-ohms : Resistance R + Rout for the full divider. The io-channel 33 voltage divider (R = 200 Ohms, Rout = 22 Ohms) and fed to an ADC. 36 compatible = "voltage-divider";
|
/Linux-v5.10/include/linux/iio/frequency/ |
D | ad9523.h | 44 * @use_alt_clock_src: Channel divider uses alternative clk source. 47 * @divider_phase: Divider initial phase after a SYNC. Range 0..63 48 LSB = 1/2 of a period of the divider input clock. 49 * @channel_divider: 10-bit channel divider. 117 * @refa_r_div: PLL1 10-bit REFA R divider. 118 * @refb_r_div: PLL1 10-bit REFB R divider. 119 * @pll1_feedback_div: PLL1 10-bit Feedback N divider. 127 * @pll2_ndiv_a_cnt: PLL2 Feedback N-divider, A Counter, range 0..4. 128 * @pll2_ndiv_b_cnt: PLL2 Feedback N-divider, B Counter, range 0..63. 130 * @pll2_r2_div: PLL2 R2 divider, range 0..31. [all …]
|