Lines Matching full:mux
3 * Mellanox i2c mux driver
10 #include <linux/i2c-mux.h>
18 /* mlxcpld_mux - mux control structure:
19 * @last_val - last selected register value or -1 if mux deselected
29 /* MUX logic description.
30 * Driver can support different mux control logic, according to CPLD
37 * *--------* * -> mux1 (virt bus2) -> mux -> |
38 * | I2CLPC | i2c physical * -> mux2 (virt bus3) -> mux -> |
40 * | logic |---------------------> * mux reg * |
42 * *--------* i2c-mux-mlxpcld ^ * -> muxn (virt busn) -> mux -> |
47 * | * mux selection * deselect
52 * reg space space (mux select,
57 /* Write to mux register. Don't use i2c_transfer() and i2c_smbus_xfer()
61 struct mlxcpld_mux *mux, u32 val) in mlxcpld_mux_reg_write() argument
63 struct i2c_client *client = mux->client; in mlxcpld_mux_reg_write()
68 switch (mux->pdata.reg_size) { in mlxcpld_mux_reg_write()
72 I2C_SMBUS_WRITE, mux->pdata.sel_reg_addr, in mlxcpld_mux_reg_write()
75 buf[0] = mux->pdata.sel_reg_addr >> 8; in mlxcpld_mux_reg_write()
76 buf[1] = mux->pdata.sel_reg_addr; in mlxcpld_mux_reg_write()
80 msg.len = mux->pdata.reg_size + 1; in mlxcpld_mux_reg_write()
90 struct mlxcpld_mux *mux = i2c_mux_priv(muxc); in mlxcpld_mux_select_chan() local
94 if (mux->pdata.reg_size == 1) in mlxcpld_mux_select_chan()
98 if (mux->last_val != regval) { in mlxcpld_mux_select_chan()
99 err = mlxcpld_mux_reg_write(muxc->parent, mux, regval); in mlxcpld_mux_select_chan()
100 mux->last_val = err < 0 ? -1 : regval; in mlxcpld_mux_select_chan()
108 struct mlxcpld_mux *mux = i2c_mux_priv(muxc); in mlxcpld_mux_deselect() local
111 mux->last_val = -1; in mlxcpld_mux_deselect()
113 return mlxcpld_mux_reg_write(muxc->parent, mux, 0); in mlxcpld_mux_deselect()
183 .name = "i2c-mux-mlxcpld",
192 MODULE_DESCRIPTION("Mellanox I2C-CPLD-MUX driver");
194 MODULE_ALIAS("platform:i2c-mux-mlxcpld");