Home
last modified time | relevance | path

Searched refs:mux (Results 1 – 25 of 1122) sorted by relevance

12345678910>>...45

/OK3568_Linux_fs/kernel/drivers/clk/mediatek/
H A Dclk-mux.c22 struct mtk_clk_mux *mux = to_mtk_clk_mux(hw); in mtk_clk_mux_enable() local
23 u32 mask = BIT(mux->data->gate_shift); in mtk_clk_mux_enable()
25 return regmap_update_bits(mux->regmap, mux->data->mux_ofs, in mtk_clk_mux_enable()
31 struct mtk_clk_mux *mux = to_mtk_clk_mux(hw); in mtk_clk_mux_disable() local
32 u32 mask = BIT(mux->data->gate_shift); in mtk_clk_mux_disable()
34 regmap_update_bits(mux->regmap, mux->data->mux_ofs, mask, mask); in mtk_clk_mux_disable()
39 struct mtk_clk_mux *mux = to_mtk_clk_mux(hw); in mtk_clk_mux_enable_setclr() local
41 return regmap_write(mux->regmap, mux->data->clr_ofs, in mtk_clk_mux_enable_setclr()
42 BIT(mux->data->gate_shift)); in mtk_clk_mux_enable_setclr()
47 struct mtk_clk_mux *mux = to_mtk_clk_mux(hw); in mtk_clk_mux_disable_setclr() local
[all …]
H A Dclk-cpumux.c21 struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw); in clk_cpumux_get_parent() local
24 regmap_read(mux->regmap, mux->reg, &val); in clk_cpumux_get_parent()
26 val >>= mux->shift; in clk_cpumux_get_parent()
27 val &= mux->mask; in clk_cpumux_get_parent()
34 struct mtk_clk_cpumux *mux = to_mtk_clk_cpumux(hw); in clk_cpumux_set_parent() local
37 val = index << mux->shift; in clk_cpumux_set_parent()
38 mask = mux->mask << mux->shift; in clk_cpumux_set_parent()
40 return regmap_update_bits(mux->regmap, mux->reg, mask, val); in clk_cpumux_set_parent()
49 mtk_clk_register_cpumux(const struct mtk_composite *mux, in mtk_clk_register_cpumux() argument
60 init.name = mux->name; in mtk_clk_register_cpumux()
[all …]
/OK3568_Linux_fs/kernel/drivers/clk/ti/
H A Dmux.c31 struct clk_omap_mux *mux = to_clk_omap_mux(hw); in ti_clk_mux_get_parent() local
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()
54 if (val && (mux->flags & CLK_MUX_INDEX_BIT)) in ti_clk_mux_get_parent()
57 if (val && (mux->flags & CLK_MUX_INDEX_ONE)) in ti_clk_mux_get_parent()
68 struct clk_omap_mux *mux = to_clk_omap_mux(hw); in ti_clk_mux_set_parent() local
71 if (mux->table) { in ti_clk_mux_set_parent()
72 index = mux->table[index]; in ti_clk_mux_set_parent()
[all …]
/OK3568_Linux_fs/kernel/drivers/i2c/muxes/
H A Di2c-mux-reg.c23 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()
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()
40 if (!mux->data.write_only) in i2c_mux_reg_set()
41 ioread32(mux->data.reg); in i2c_mux_reg_set()
44 if (mux->data.little_endian) in i2c_mux_reg_set()
45 iowrite16(chan_id, mux->data.reg); in i2c_mux_reg_set()
[all …]
H A Di2c-mux-gpio.c25 static void i2c_mux_gpio_set(const struct gpiomux *mux, unsigned val) in i2c_mux_gpio_set() argument
31 gpiod_set_array_value_cansleep(mux->ngpios, mux->gpios, NULL, values); in i2c_mux_gpio_set()
36 struct gpiomux *mux = i2c_mux_priv(muxc); in i2c_mux_gpio_select() local
38 i2c_mux_gpio_set(mux, chan); in i2c_mux_gpio_select()
45 struct gpiomux *mux = i2c_mux_priv(muxc); in i2c_mux_gpio_deselect() local
47 i2c_mux_gpio_set(mux, mux->data.idle); in i2c_mux_gpio_deselect()
53 static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, in i2c_mux_gpio_probe_dt() argument
75 mux->data.parent = i2c_adapter_id(adapter); in i2c_mux_gpio_probe_dt()
78 mux->data.n_values = of_get_child_count(np); in i2c_mux_gpio_probe_dt()
81 mux->data.n_values, sizeof(*mux->data.values), in i2c_mux_gpio_probe_dt()
[all …]
/OK3568_Linux_fs/kernel/drivers/iio/multiplexer/
H A Diio-mux.c28 struct mux { struct
38 static int iio_mux_select(struct mux *mux, int idx) in iio_mux_select() argument
40 struct mux_child *child = &mux->child[idx]; in iio_mux_select()
41 struct iio_chan_spec const *chan = &mux->chan[idx]; in iio_mux_select()
45 ret = mux_control_select(mux->control, chan->channel); in iio_mux_select()
47 mux->cached_state = -1; in iio_mux_select()
51 if (mux->cached_state == chan->channel) in iio_mux_select()
64 ret = iio_write_channel_ext_info(mux->parent, attr, in iio_mux_select()
69 mux_control_deselect(mux->control); in iio_mux_select()
70 mux->cached_state = -1; in iio_mux_select()
[all …]
/OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/mux/
H A Dmux-controller.txt4 A multiplexer (or mux) controller will have one, or several, consumer devices
5 that uses the mux controller. Thus, a mux controller can possibly control
7 multiplexer needed by each consumer, but a single mux controller can of course
10 A mux controller provides a number of states to its consumers, and the state
18 Mux controller consumers should specify a list of mux controllers that they
19 want to use with a property containing a 'mux-ctrl-list':
21 mux-ctrl-list ::= <single-mux-ctrl> [mux-ctrl-list]
22 single-mux-ctrl ::= <mux-ctrl-phandle> [mux-ctrl-specifier]
23 mux-ctrl-phandle : phandle to mux controller node
24 mux-ctrl-specifier : array of #mux-control-cells specifying the
[all …]
H A Dreg-mux.txt8 "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
21 pair in the mux-reg-masks array.
24 The parent device of mux controller is not a syscon device.
32 mux: mux-controller {
33 compatible = "reg-mux";
[all …]
H A Dadi,adg792a.txt5 - #mux-control-cells : <0> if parallel (the three muxes are bound together
6 with a single mux controller controlling all three muxes), or <1> if
7 not (one mux controller for each mux).
8 * Standard mux-controller bindings as described in mux-controller.txt
18 - idle-state : if present, array of states that the mux controllers will have
27 * Three independent mux controllers (of which one is used).
28 * Mux 0 is disconnected when idle, mux 1 idles in the previously
29 * selected state and mux 2 idles with signal B.
32 mux: mux-controller@50 {
35 #mux-control-cells = <1>;
[all …]
H A Dgpio-mux.txt7 - compatible : "gpio-mux"
8 - mux-gpios : list of gpios used to control the multiplexer, least
10 - #mux-control-cells : <0>
11 * Standard mux-controller bindings as decribed in mux-controller.txt
14 - idle-state : if present, the state the mux will have when idle. The
23 mux: mux-controller {
24 compatible = "gpio-mux";
25 #mux-control-cells = <0>;
27 mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
31 adc-mux {
[all …]
/OK3568_Linux_fs/kernel/drivers/clk/
H A Dclk-mux.c26 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()
31 return readl(mux->reg); in clk_mux_readl()
34 static inline void clk_mux_writel(struct clk_mux *mux, u32 val) in clk_mux_writel() argument
36 if (mux->flags & CLK_MUX_BIG_ENDIAN) in clk_mux_writel()
37 iowrite32be(val, mux->reg); in clk_mux_writel()
39 writel(val, mux->reg); in clk_mux_writel()
89 struct clk_mux *mux = to_clk_mux(hw); in clk_mux_get_parent() local
92 val = clk_mux_readl(mux) >> mux->shift; in clk_mux_get_parent()
[all …]
/OK3568_Linux_fs/kernel/drivers/mux/
H A Dcore.c89 controllers * sizeof(*mux_chip->mux) + in mux_chip_alloc()
94 mux_chip->mux = (struct mux_control *)(mux_chip + 1); in mux_chip_alloc()
113 struct mux_control *mux = &mux_chip->mux[i]; in mux_chip_alloc() local
115 mux->chip = mux_chip; in mux_chip_alloc()
116 sema_init(&mux->lock, 1); in mux_chip_alloc()
117 mux->cached_state = MUX_CACHE_UNKNOWN; in mux_chip_alloc()
118 mux->idle_state = MUX_IDLE_AS_IS; in mux_chip_alloc()
127 static int mux_control_set(struct mux_control *mux, int state) in mux_control_set() argument
129 int ret = mux->chip->ops->set(mux, state); in mux_control_set()
131 mux->cached_state = ret < 0 ? MUX_CACHE_UNKNOWN : state; in mux_control_set()
[all …]
/OK3568_Linux_fs/kernel/drivers/clk/rockchip/regmap/
H A Dclk-regmap-mux.c24 struct clk_regmap_mux *mux = to_clk_regmap_mux(hw); in clk_regmap_mux_get_parent() local
28 regmap_read(mux->regmap, mux->reg, &val); in clk_regmap_mux_get_parent()
30 index = val >> mux->shift; in clk_regmap_mux_get_parent()
31 index &= mux->mask; in clk_regmap_mux_get_parent()
38 struct clk_regmap_mux *mux = to_clk_regmap_mux(hw); in clk_regmap_mux_set_parent() local
40 return regmap_write(mux->regmap, mux->reg, (index << mux->shift) | in clk_regmap_mux_set_parent()
41 (mux->mask << (mux->shift + 16))); in clk_regmap_mux_set_parent()
57 struct clk_regmap_mux *mux; in devm_clk_regmap_register_mux() local
60 mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL); in devm_clk_regmap_register_mux()
61 if (!mux) in devm_clk_regmap_register_mux()
[all …]
/OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/net/
H A Dmdio-mux-multiplexer.txt3 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
17 Documentation/devicetree/bindings/mux/mux-controller.txt
18 and Documentation/devicetree/bindings/net/mdio-mux.txt
29 mux: mux-controller { // Mux Producer
30 compatible = "reg-mux";
31 #mux-control-cells = <1>;
[all …]
/OK3568_Linux_fs/kernel/net/kcm/
H A Dkcmsock.c57 struct kcm_mux *mux = psock->mux; in kcm_abort_tx_psock() local
61 spin_lock_bh(&mux->lock); in kcm_abort_tx_psock()
64 spin_unlock_bh(&mux->lock); in kcm_abort_tx_psock()
85 spin_unlock_bh(&mux->lock); in kcm_abort_tx_psock()
92 static void kcm_update_rx_mux_stats(struct kcm_mux *mux, in kcm_update_rx_mux_stats() argument
95 STRP_STATS_ADD(mux->stats.rx_bytes, in kcm_update_rx_mux_stats()
98 mux->stats.rx_msgs += in kcm_update_rx_mux_stats()
104 static void kcm_update_tx_mux_stats(struct kcm_mux *mux, in kcm_update_tx_mux_stats() argument
107 KCM_STATS_ADD(mux->stats.tx_bytes, in kcm_update_tx_mux_stats()
109 mux->stats.tx_msgs += in kcm_update_tx_mux_stats()
[all …]
/OK3568_Linux_fs/kernel/drivers/clk/uniphier/
H A Dclk-uniphier-mux.c25 struct uniphier_clk_mux *mux = to_uniphier_clk_mux(hw); in uniphier_clk_mux_set_parent() local
27 return regmap_write_bits(mux->regmap, mux->reg, mux->masks[index], in uniphier_clk_mux_set_parent()
28 mux->vals[index]); in uniphier_clk_mux_set_parent()
33 struct uniphier_clk_mux *mux = to_uniphier_clk_mux(hw); in uniphier_clk_mux_get_parent() local
39 ret = regmap_read(mux->regmap, mux->reg, &val); in uniphier_clk_mux_get_parent()
44 if ((mux->masks[i] & val) == mux->vals[i]) in uniphier_clk_mux_get_parent()
61 struct uniphier_clk_mux *mux; in uniphier_clk_register_mux() local
65 mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL); in uniphier_clk_register_mux()
66 if (!mux) in uniphier_clk_register_mux()
75 mux->regmap = regmap; in uniphier_clk_register_mux()
[all …]
/OK3568_Linux_fs/kernel/drivers/usb/typec/
H A Dmux.c261 struct typec_mux *mux; in fwnode_typec_mux_get() local
263 mux = fwnode_connection_find_match(fwnode, "mode-switch", (void *)desc, in fwnode_typec_mux_get()
265 if (!IS_ERR_OR_NULL(mux)) in fwnode_typec_mux_get()
266 WARN_ON(!try_module_get(mux->dev.parent->driver->owner)); in fwnode_typec_mux_get()
268 return mux; in fwnode_typec_mux_get()
278 void typec_mux_put(struct typec_mux *mux) in typec_mux_put() argument
280 if (!IS_ERR_OR_NULL(mux)) { in typec_mux_put()
281 module_put(mux->dev.parent->driver->owner); in typec_mux_put()
282 put_device(&mux->dev); in typec_mux_put()
287 int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state) in typec_mux_set() argument
[all …]
/OK3568_Linux_fs/kernel/drivers/clk/qcom/
H A Dclk-krait.c21 static void __krait_mux_set_sel(struct krait_mux_clk *mux, int sel) in __krait_mux_set_sel() argument
27 regval = krait_get_l2_indirect_reg(mux->offset); in __krait_mux_set_sel()
28 regval &= ~(mux->mask << mux->shift); in __krait_mux_set_sel()
29 regval |= (sel & mux->mask) << mux->shift; in __krait_mux_set_sel()
30 if (mux->lpl) { in __krait_mux_set_sel()
31 regval &= ~(mux->mask << (mux->shift + LPL_SHIFT)); in __krait_mux_set_sel()
32 regval |= (sel & mux->mask) << (mux->shift + LPL_SHIFT); in __krait_mux_set_sel()
34 krait_set_l2_indirect_reg(mux->offset, regval); in __krait_mux_set_sel()
49 struct krait_mux_clk *mux = to_krait_mux_clk(hw); in krait_mux_set_parent() local
52 sel = clk_mux_index_to_val(mux->parent_map, 0, index); in krait_mux_set_parent()
[all …]
H A Dkrait-cc.c38 struct krait_mux_clk *mux = container_of(nb, struct krait_mux_clk, in krait_notifier_cb() local
42 mux->old_index = krait_mux_clk_ops.get_parent(&mux->hw); in krait_notifier_cb()
43 ret = krait_mux_clk_ops.set_parent(&mux->hw, mux->safe_sel); in krait_notifier_cb()
44 mux->reparent = false; in krait_notifier_cb()
51 if (!mux->reparent) in krait_notifier_cb()
52 ret = krait_mux_clk_ops.set_parent(&mux->hw, in krait_notifier_cb()
53 mux->old_index); in krait_notifier_cb()
60 struct krait_mux_clk *mux) in krait_notifier_register() argument
64 mux->clk_nb.notifier_call = krait_notifier_cb; in krait_notifier_register()
65 ret = clk_notifier_register(clk, &mux->clk_nb); in krait_notifier_register()
[all …]
/OK3568_Linux_fs/kernel/Documentation/i2c/
H A Di2c-topology.rst8 1. A mux may be needed on the bus to prevent address collisions.
23 I2C transfers, and all adapters with a parent are part of an "i2c-mux"
26 Depending of the particular mux driver, something happens when there is
27 an I2C transfer on one of its child adapters. The mux driver can
28 obviously operate a mux, but it can also do arbitration with an external
29 bus master or open a gate. The mux driver has two operations for this,
38 mux-locked or parent-locked muxes. As is evident from below, it can be
39 useful to know if a mux is mux-locked or if it is parent-locked. The
46 i2c-mux-gpio Normally parent-locked, mux-locked iff
48 same I2C root adapter that they mux.
[all …]
/OK3568_Linux_fs/u-boot/drivers/clk/uniphier/
H A Dclk-uniphier-core.c56 for (p = priv->data->mux; p->id != UNIPHIER_CLK_ID_END; p++) { in uniphier_clk_get_mux_data()
67 const struct uniphier_clk_mux_data *mux; in uniphier_clk_get_rate() local
71 mux = uniphier_clk_get_mux_data(priv, clk->id); in uniphier_clk_get_rate()
72 if (!mux) in uniphier_clk_get_rate()
75 if (!mux->nr_muxs) /* fixed-rate */ in uniphier_clk_get_rate()
76 return mux->rates[0]; in uniphier_clk_get_rate()
78 val = readl(priv->base + mux->reg); in uniphier_clk_get_rate()
80 for (i = 0; i < mux->nr_muxs; i++) in uniphier_clk_get_rate()
81 if ((mux->masks[i] & val) == mux->vals[i]) in uniphier_clk_get_rate()
82 return mux->rates[i]; in uniphier_clk_get_rate()
[all …]
/OK3568_Linux_fs/kernel/arch/arm64/boot/dts/amlogic/
H A Dmeson-gxl.dtsi156 reg-names = "mux", "pull", "gpio";
163 mux {
171 mux {
180 mux {
188 mux {
196 mux {
205 mux {
213 mux {
222 mux {
230 mux {
[all …]
H A Dmeson-gxbb.dtsi98 reg-names = "mux", "pull", "gpio";
105 mux {
113 mux {
122 mux {
130 mux {
139 mux {
147 mux {
156 mux {
164 mux {
172 mux {
[all …]
H A Dmeson-g12-common.dtsi329 "mux",
337 mux {
345 mux {
353 mux-0 {
360 mux-1 {
369 mux-0 {
381 mux-0 {
397 mux {
406 mux {
415 mux {
[all …]
/OK3568_Linux_fs/kernel/drivers/clk/imx/
H A Dclk-fixup-mux.c23 struct clk_mux mux; member
30 struct clk_mux *mux = to_clk_mux(hw); in to_clk_fixup_mux() local
32 return container_of(mux, struct clk_fixup_mux, mux); in to_clk_fixup_mux()
39 return fixup_mux->ops->get_parent(&fixup_mux->mux.hw); in clk_fixup_mux_get_parent()
45 struct clk_mux *mux = to_clk_mux(hw); in clk_fixup_mux_set_parent() local
49 spin_lock_irqsave(mux->lock, flags); in clk_fixup_mux_set_parent()
51 val = readl(mux->reg); in clk_fixup_mux_set_parent()
52 val &= ~(mux->mask << mux->shift); in clk_fixup_mux_set_parent()
53 val |= index << mux->shift; in clk_fixup_mux_set_parent()
55 writel(val, mux->reg); in clk_fixup_mux_set_parent()
[all …]

12345678910>>...45