Lines Matching +full:reg +full:- +full:names
2 * drivers/i2c/muxes/i2c-mux-mlxcpld.c
14 * 3. Neither the names of the copyright holders nor the names of its
37 #include <linux/i2c-mux.h>
47 /* mlxcpld_mux - mux control structure:
48 * @last_chan - last register value
49 * @client - I2C device client
62 * i2c-mlxcpld Digital Analog
64 * *--------* * -> mux1 (virt bus2) -> mux -> |
65 * | I2CLPC | i2c physical * -> mux2 (virt bus3) -> mux -> |
66 * | bridge | bus 1 *---------* |
67 * | logic |---------------------> * mux reg * |
68 * | in CPLD| *---------* |
69 * *--------* i2c-mux-mlxpcld ^ * -> muxn (virt busn) -> mux -> |
71 * | *---------------* | Devices
73 * | * registers for *--------*
75 * | *---------------*
77 * <--------> <----------->
78 * i2c cntrl Board cntrl reg
79 * reg space space (mux select,
96 struct mlxcpld_mux_plat_data *pdata = dev_get_platdata(&client->dev); in mlxcpld_mux_reg_write()
99 return __i2c_smbus_xfer(adap, client->addr, client->flags, in mlxcpld_mux_reg_write()
100 I2C_SMBUS_WRITE, pdata->sel_reg_addr, in mlxcpld_mux_reg_write()
107 struct i2c_client *client = data->client; in mlxcpld_mux_select_chan()
112 if (data->last_chan != regval) { in mlxcpld_mux_select_chan()
113 err = mlxcpld_mux_reg_write(muxc->parent, client, regval); in mlxcpld_mux_select_chan()
114 data->last_chan = err < 0 ? 0 : regval; in mlxcpld_mux_select_chan()
123 struct i2c_client *client = data->client; in mlxcpld_mux_deselect()
126 data->last_chan = 0; in mlxcpld_mux_deselect()
128 return mlxcpld_mux_reg_write(muxc->parent, client, data->last_chan); in mlxcpld_mux_deselect()
135 struct i2c_adapter *adap = client->adapter; in mlxcpld_mux_probe()
136 struct mlxcpld_mux_plat_data *pdata = dev_get_platdata(&client->dev); in mlxcpld_mux_probe()
143 return -EINVAL; in mlxcpld_mux_probe()
146 return -ENODEV; in mlxcpld_mux_probe()
148 muxc = i2c_mux_alloc(adap, &client->dev, CPLD_MUX_MAX_NCHANS, in mlxcpld_mux_probe()
152 return -ENOMEM; in mlxcpld_mux_probe()
156 data->client = client; in mlxcpld_mux_probe()
157 data->last_chan = 0; /* force the first selection */ in mlxcpld_mux_probe()
161 if (num >= pdata->num_adaps) in mlxcpld_mux_probe()
165 force = pdata->adap_ids[num]; in mlxcpld_mux_probe()
189 .name = "mlxcpld-mux",
199 MODULE_DESCRIPTION("Mellanox I2C-CPLD-MUX driver");
201 MODULE_ALIAS("platform:i2c-mux-mlxcpld");