Lines Matching +full:mux +full:- +full:states

1 // SPDX-License-Identifier: GPL-2.0
3 * Multiplexer driver for Analog Devices ADG792A/G Triple 4:1 mux
13 #include <linux/mux/driver.h>
18 #define ADG792A_DISABLE(mux) (0x50 | (mux)) argument
20 #define ADG792A_MUX(mux, state) (0xc0 | (((mux) + 1) << 2) | (state)) argument
34 static int adg792a_set(struct mux_control *mux, int state) in adg792a_set() argument
36 struct i2c_client *i2c = to_i2c_client(mux->chip->dev.parent); in adg792a_set()
39 if (mux->chip->controllers == 1) { in adg792a_set()
40 /* parallel mux controller operation */ in adg792a_set()
46 unsigned int controller = mux_control_get_index(mux); in adg792a_set()
63 struct device *dev = &i2c->dev; in adg792a_probe()
70 if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in adg792a_probe()
71 return -ENODEV; in adg792a_probe()
73 ret = device_property_read_u32(dev, "#mux-control-cells", &cells); in adg792a_probe()
77 return -EINVAL; in adg792a_probe()
83 mux_chip->ops = &adg792a_ops; in adg792a_probe()
89 ret = device_property_read_u32_array(dev, "idle-state", in adg792a_probe()
91 mux_chip->controllers); in adg792a_probe()
98 for (i = 0; i < mux_chip->controllers; ++i) { in adg792a_probe()
99 struct mux_control *mux = &mux_chip->mux[i]; in adg792a_probe() local
101 mux->states = 4; in adg792a_probe()
107 mux->idle_state = idle_state[i]; in adg792a_probe()
110 dev_err(dev, "invalid idle-state %d\n", idle_state[i]); in adg792a_probe()
111 return -EINVAL; in adg792a_probe()
122 dev_info(dev, "triple pole quadruple throw mux registered\n"); in adg792a_probe()
151 MODULE_DESCRIPTION("Analog Devices ADG792A/G Triple 4:1 mux driver");