| /kernel/linux/linux-5.10/drivers/i2c/muxes/ |
| D | i2c-mux-reg.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 10 #include <linux/i2c-mux.h> 15 #include <linux/platform_data/i2c-mux-reg.h> 23 static int i2c_mux_reg_set(const struct regmux *mux, unsigned int chan_id) in i2c_mux_reg_set() argument 25 if (!mux->data.reg) in i2c_mux_reg_set() 26 return -EINVAL; in i2c_mux_reg_set() 34 switch (mux->data.reg_size) { in i2c_mux_reg_set() 36 if (mux->data.little_endian) in i2c_mux_reg_set() 37 iowrite32(chan_id, mux->data.reg); in i2c_mux_reg_set() 39 iowrite32be(chan_id, mux->data.reg); in i2c_mux_reg_set() [all …]
|
| /kernel/linux/linux-5.10/Documentation/devicetree/bindings/mux/ |
| D | reg-mux.txt | 1 Generic register bitfield-based multiplexer controller bindings 7 - compatible : should be one of 8 "reg-mux" : if parent device of mux controller is not syscon device 9 "mmio-mux" : if parent device of mux controller is syscon device 10 - #mux-control-cells : <1> 11 - mux-reg-masks : an array of register offset and pre-shifted bitfield mask 12 pairs, each describing a single mux control. 13 * Standard mux-controller bindings as decribed in mux-controller.txt 16 - idle-states : if present, the state the muxes will have when idle. The 21 pair in the mux-reg-masks array. [all …]
|
| /kernel/linux/linux-4.19/drivers/clk/ti/ |
| D | mux.c | 6 * Tero Kristo <t-kristo@ti.com> 18 #include <linux/clk-provider.h> 31 struct clk_omap_mux *mux = to_clk_omap_mux(hw); in ti_clk_mux_get_parent() local 36 * FIXME need a mux-specific flag to determine if val is bitwise or in ti_clk_mux_get_parent() 42 val = ti_clk_ll_ops->clk_readl(&mux->reg) >> mux->shift; in ti_clk_mux_get_parent() 43 val &= mux->mask; in ti_clk_mux_get_parent() 45 if (mux->table) { in ti_clk_mux_get_parent() 49 if (mux->table[i] == val) in ti_clk_mux_get_parent() 51 return -EINVAL; in ti_clk_mux_get_parent() 54 if (val && (mux->flags & CLK_MUX_INDEX_BIT)) in ti_clk_mux_get_parent() [all …]
|
| /kernel/linux/linux-4.19/drivers/i2c/muxes/ |
| D | i2c-mux-reg.c | 14 #include <linux/i2c-mux.h> 19 #include <linux/platform_data/i2c-mux-reg.h> 27 static int i2c_mux_reg_set(const struct regmux *mux, unsigned int chan_id) in i2c_mux_reg_set() argument 29 if (!mux->data.reg) in i2c_mux_reg_set() 30 return -EINVAL; in i2c_mux_reg_set() 38 switch (mux->data.reg_size) { in i2c_mux_reg_set() 40 if (mux->data.little_endian) in i2c_mux_reg_set() 41 iowrite32(chan_id, mux->data.reg); in i2c_mux_reg_set() 43 iowrite32be(chan_id, mux->data.reg); in i2c_mux_reg_set() 44 if (!mux->data.write_only) in i2c_mux_reg_set() [all …]
|
| /kernel/linux/linux-5.10/drivers/clk/ |
| D | clk-mux.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2011-2012 Mike Turquette, Linaro Ltd <mturquette@linaro.org> 10 #include <linux/clk-provider.h> 20 * prepare - clk_prepare only ensures that parents are prepared 21 * enable - clk_enable only ensures that parents are enabled 22 * rate - rate is only affected by parent switching. No clk_set_rate support 23 * parent - parent is adjustable through clk_set_parent 26 static inline u32 clk_mux_readl(struct clk_mux *mux) in clk_mux_readl() argument 28 if (mux->flags & CLK_MUX_BIG_ENDIAN) in clk_mux_readl() 29 return ioread32be(mux->reg); in clk_mux_readl() [all …]
|
| /kernel/linux/linux-4.19/drivers/clk/ |
| D | clk-mux.c | 4 * Copyright (C) 2011-2012 Mike Turquette, Linaro Ltd <mturquette@linaro.org> 13 #include <linux/clk-provider.h> 23 * prepare - clk_prepare only ensures that parents are prepared 24 * enable - clk_enable only ensures that parents are enabled 25 * rate - rate is only affected by parent switching. No clk_set_rate support 26 * parent - parent is adjustable through clk_set_parent 40 return -EINVAL; in clk_mux_val_to_index() 44 val = ffs(val) - 1; in clk_mux_val_to_index() 47 val--; in clk_mux_val_to_index() 50 return -EINVAL; in clk_mux_val_to_index() [all …]
|
| /kernel/linux/linux-5.10/drivers/clk/ti/ |
| D | mux.c | 6 * Tero Kristo <t-kristo@ti.com> 18 #include <linux/clk-provider.h> 31 struct clk_omap_mux *mux = to_clk_omap_mux(hw); in ti_clk_mux_get_parent() local 36 * FIXME need a mux-specific flag to determine if val is bitwise or in ti_clk_mux_get_parent() 42 val = ti_clk_ll_ops->clk_readl(&mux->reg) >> mux->shift; in ti_clk_mux_get_parent() 43 val &= mux->mask; in ti_clk_mux_get_parent() 45 if (mux->table) { in ti_clk_mux_get_parent() 49 if (mux->table[i] == val) in ti_clk_mux_get_parent() 51 return -EINVAL; in ti_clk_mux_get_parent() 54 if (val && (mux->flags & CLK_MUX_INDEX_BIT)) in ti_clk_mux_get_parent() [all …]
|
| /kernel/linux/linux-5.10/Documentation/devicetree/bindings/net/ |
| D | mdio-mux-multiplexer.txt | 3 This is a special case of MDIO mux when MDIO mux is defined as a consumer 4 of a mux producer device. The mux producer can be of any type like mmio mux 5 producer, gpio mux producer or generic register based mux producer. 9 - compatible : should be "mmio-mux-multiplexer" 10 - mux-controls : mux controller node to use for operating the mux 11 - mdio-parent-bus : phandle to the parent MDIO bus. 17 Documentation/devicetree/bindings/mux/mux-controller.txt 18 and Documentation/devicetree/bindings/net/mdio-mux.txt 21 In below example the Mux producer and consumer are separate nodes. 25 compatible = "fsl,lx2160aqds-fpga", "fsl,fpga-qixis-i2c", [all …]
|
| /kernel/linux/linux-4.19/arch/arm64/boot/dts/amlogic/ |
| D | meson-axg.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 6 #include <dt-bindings/gpio/gpio.h> 7 #include <dt-bindings/interrupt-controller/irq.h> 8 #include <dt-bindings/interrupt-controller/arm-gic.h> 9 #include <dt-bindings/clock/axg-audio-clkc.h> 10 #include <dt-bindings/clock/axg-clkc.h> 11 #include <dt-bindings/clock/axg-aoclkc.h> 12 #include <dt-bindings/gpio/meson-axg-gpio.h> 13 #include <dt-bindings/reset/amlogic,meson-axg-reset.h> 16 compatible = "amlogic,meson-axg"; [all …]
|
| /kernel/linux/linux-4.19/Documentation/devicetree/bindings/mux/ |
| D | mmio-mux.txt | 1 MMIO register bitfield-based multiplexer controller bindings 7 - compatible : "mmio-mux" 8 - #mux-control-cells : <1> 9 - mux-reg-masks : an array of register offset and pre-shifted bitfield mask 10 pairs, each describing a single mux control. 11 * Standard mux-controller bindings as decribed in mux-controller.txt 14 - idle-states : if present, the state the muxes will have when idle. The 19 in the mux-reg-masks array, accessed through the parent syscon. 26 mux: mux-controller { 27 compatible = "mmio-mux"; [all …]
|
| /kernel/linux/linux-5.10/arch/arm/boot/dts/ |
| D | at91-natte.dtsi | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * at91-natte.dts - Device Tree include file for the Natte board 11 mux: mux-controller { label 12 compatible = "gpio-mux"; 13 #mux-control-cells = <0>; 15 mux-gpios = <&ioexp 0 GPIO_ACTIVE_HIGH>, 20 batntc-mux { 21 compatible = "io-channel-mux"; 22 io-channels = <&adc 5>; 23 io-channel-names = "parent"; [all …]
|
| D | mmp3.dtsi | 1 // SPDX-License-Identifier: GPL-2.0+ OR MIT 6 #include <dt-bindings/clock/marvell,mmp2.h> 7 #include <dt-bindings/power/marvell,mmp2.h> 8 #include <dt-bindings/interrupt-controller/arm-gic.h> 11 #address-cells = <1>; 12 #size-cells = <1>; 15 #address-cells = <1>; 16 #size-cells = <0>; 17 enable-method = "marvell,mmp3-smp"; 22 next-level-cache = <&l2>; [all …]
|
| /kernel/linux/linux-4.19/arch/arm/boot/dts/ |
| D | at91-natte.dtsi | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * at91-natte.dts - Device Tree include file for the Natte board 11 mux: mux-controller { label 12 compatible = "gpio-mux"; 13 #mux-control-cells = <0>; 15 mux-gpios = <&ioexp 0 GPIO_ACTIVE_HIGH>, 20 batntc-mux { 21 compatible = "io-channel-mux"; 22 io-channels = <&adc 5>; 23 io-channel-names = "parent"; [all …]
|
| D | mmp2.dtsi | 11 #include <dt-bindings/clock/marvell,mmp2.h> 24 #address-cells = <1>; 25 #size-cells = <1>; 26 compatible = "simple-bus"; 27 interrupt-parent = <&intc>; 30 L2: l2-cache { 31 compatible = "marvell,tauros2-cache"; 32 marvell,tauros2-cache-features = <0x3>; 36 compatible = "mrvl,axi-bus", "simple-bus"; 37 #address-cells = <1>; [all …]
|
| /kernel/linux/linux-5.10/drivers/clk/imx/ |
| D | clk-composite-8m.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include <linux/clk-provider.h> 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() 56 int ret = -EINVAL; in imx8m_clk_composite_compute_dividers() 63 int new_error = ((parent_rate / div1) / div2) - rate; in imx8m_clk_composite_compute_dividers() [all …]
|
| /kernel/linux/linux-5.10/arch/arm64/boot/dts/amlogic/ |
| D | meson-axg.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 6 #include <dt-bindings/clock/axg-aoclkc.h> 7 #include <dt-bindings/clock/axg-audio-clkc.h> 8 #include <dt-bindings/clock/axg-clkc.h> 9 #include <dt-bindings/gpio/gpio.h> 10 #include <dt-bindings/gpio/meson-axg-gpio.h> 11 #include <dt-bindings/interrupt-controller/irq.h> 12 #include <dt-bindings/interrupt-controller/arm-gic.h> 13 #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h> 14 #include <dt-bindings/reset/amlogic,meson-axg-reset.h> [all …]
|
| D | meson-g12-common.dtsi | 1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 6 #include <dt-bindings/phy/phy.h> 7 #include <dt-bindings/gpio/gpio.h> 8 #include <dt-bindings/clock/g12a-clkc.h> 9 #include <dt-bindings/clock/g12a-aoclkc.h> 10 #include <dt-bindings/interrupt-controller/irq.h> 11 #include <dt-bindings/interrupt-controller/arm-gic.h> 12 #include <dt-bindings/reset/amlogic,meson-g12a-reset.h> 13 #include <dt-bindings/thermal/thermal.h> 16 interrupt-parent = <&gic>; [all …]
|
| /kernel/linux/linux-5.10/drivers/clk/sprd/ |
| D | mux.c | 1 // SPDX-License-Identifier: GPL-2.0 9 #include <linux/clk-provider.h> 12 #include "mux.h" 15 const struct sprd_mux_ssel *mux) in sprd_mux_helper_get_parent() argument 17 unsigned int reg; in sprd_mux_helper_get_parent() local 22 regmap_read(common->regmap, common->reg, ®); in sprd_mux_helper_get_parent() 23 parent = reg >> mux->shift; in sprd_mux_helper_get_parent() 24 parent &= (1 << mux->width) - 1; in sprd_mux_helper_get_parent() 26 if (!mux->table) in sprd_mux_helper_get_parent() 29 num_parents = clk_hw_get_num_parents(&common->hw); in sprd_mux_helper_get_parent() [all …]
|
| /kernel/linux/linux-4.19/drivers/clk/sprd/ |
| D | mux.c | 1 // SPDX-License-Identifier: GPL-2.0 9 #include <linux/clk-provider.h> 12 #include "mux.h" 15 const struct sprd_mux_ssel *mux) in sprd_mux_helper_get_parent() argument 17 unsigned int reg; in sprd_mux_helper_get_parent() local 22 regmap_read(common->regmap, common->reg, ®); in sprd_mux_helper_get_parent() 23 parent = reg >> mux->shift; in sprd_mux_helper_get_parent() 24 parent &= (1 << mux->width) - 1; in sprd_mux_helper_get_parent() 26 if (!mux->table) in sprd_mux_helper_get_parent() 29 num_parents = clk_hw_get_num_parents(&common->hw); in sprd_mux_helper_get_parent() [all …]
|
| /kernel/linux/linux-5.10/drivers/clk/sunxi/ |
| D | clk-factors.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Adjustable factor-based clock implementation 8 #include <linux/clk-provider.h> 16 #include "clk-factors.h" 19 * DOC: basic adjustable factor-based clock 22 * prepare - clk_prepare only ensures that parents are prepared 23 * enable - clk_enable only ensures that parents are enabled 24 * rate - rate is adjustable. 25 * clk->rate = (parent->rate * N * (K + 1) >> P) / (M + 1) 26 * parent - fixed parent. No clk_set_parent support [all …]
|
| /kernel/linux/linux-4.19/drivers/clk/sunxi/ |
| D | clk-factors.c | 8 * Adjustable factor-based clock implementation 11 #include <linux/clk-provider.h> 19 #include "clk-factors.h" 22 * DOC: basic adjustable factor-based clock 25 * prepare - clk_prepare only ensures that parents are prepared 26 * enable - clk_enable only ensures that parents are enabled 27 * rate - rate is adjustable. 28 * clk->rate = (parent->rate * N * (K + 1) >> P) / (M + 1) 29 * parent - fixed parent. No clk_set_parent support 36 #define SETMASK(len, pos) (((1U << (len)) - 1) << (pos)) [all …]
|
| /kernel/linux/linux-4.19/drivers/clk/tegra/ |
| D | clk-super.c | 22 #include <linux/clk-provider.h> 39 #define super_state_to_src_shift(m, s) ((m->width * s)) 40 #define super_state_to_src_mask(m) (((1 << m->width) - 1)) 44 struct tegra_clk_super_mux *mux = to_clk_super_mux(hw); in clk_super_get_parent() local 48 val = readl_relaxed(mux->reg); in clk_super_get_parent() 55 super_state_to_src_shift(mux, SUPER_STATE_IDLE) : in clk_super_get_parent() 56 super_state_to_src_shift(mux, SUPER_STATE_RUN); in clk_super_get_parent() 58 source = (val >> shift) & super_state_to_src_mask(mux); in clk_super_get_parent() 64 if ((mux->flags & TEGRA_DIVIDER_2) && !(val & SUPER_LP_DIV2_BYPASS) && in clk_super_get_parent() 65 (source == mux->pllx_index)) in clk_super_get_parent() [all …]
|
| /kernel/linux/linux-5.10/drivers/clk/x86/ |
| D | clk-cgu.c | 1 // SPDX-License-Identifier: GPL-2.0 7 #include <linux/clk-provider.h> 11 #include "clk-cgu.h" 13 #define GATE_HW_REG_STAT(reg) ((reg) + 0x0) argument 14 #define GATE_HW_REG_EN(reg) ((reg) + 0x4) argument 15 #define GATE_HW_REG_DIS(reg) ((reg) + 0x8) argument 29 if (list->div_flags & CLOCK_FLAG_VAL_INIT) { in lgm_clk_register_fixed() 30 spin_lock_irqsave(&ctx->lock, flags); in lgm_clk_register_fixed() 31 lgm_set_clk_val(ctx->membase, list->div_off, list->div_shift, in lgm_clk_register_fixed() 32 list->div_width, list->div_val); in lgm_clk_register_fixed() [all …]
|
| /kernel/linux/linux-5.10/drivers/mux/ |
| D | mmio.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * MMIO register bitfield-controlled multiplexer driver 12 #include <linux/mux/driver.h> 18 static int mux_mmio_set(struct mux_control *mux, int state) in mux_mmio_set() argument 20 struct regmap_field **fields = mux_chip_priv(mux->chip); in mux_mmio_set() 22 return regmap_field_write(fields[mux_control_get_index(mux)], state); in mux_mmio_set() 30 { .compatible = "mmio-mux", }, 31 { .compatible = "reg-mux", }, 38 struct device *dev = &pdev->dev; in mux_mmio_probe() 39 struct device_node *np = dev->of_node; in mux_mmio_probe() [all …]
|
| /kernel/linux/linux-5.10/drivers/clk/tegra/ |
| D | clk-super.c | 1 // SPDX-License-Identifier: GPL-2.0-only 11 #include <linux/clk-provider.h> 28 #define super_state_to_src_shift(m, s) ((m->width * s)) 29 #define super_state_to_src_mask(m) (((1 << m->width) - 1)) 36 struct tegra_clk_super_mux *mux = to_clk_super_mux(hw); in clk_super_get_parent() local 40 val = readl_relaxed(mux->reg); in clk_super_get_parent() 47 super_state_to_src_shift(mux, SUPER_STATE_IDLE) : in clk_super_get_parent() 48 super_state_to_src_shift(mux, SUPER_STATE_RUN); in clk_super_get_parent() 50 source = (val >> shift) & super_state_to_src_mask(mux); in clk_super_get_parent() 56 if ((mux->flags & TEGRA_DIVIDER_2) && !(val & SUPER_LP_DIV2_BYPASS) && in clk_super_get_parent() [all …]
|