Lines Matching refs:mux

26 static void i2c_mux_gpio_set(const struct gpiomux *mux, unsigned val)  in i2c_mux_gpio_set()  argument
32 gpiod_set_array_value_cansleep(mux->ngpios, mux->gpios, NULL, values); in i2c_mux_gpio_set()
37 struct gpiomux *mux = i2c_mux_priv(muxc); in i2c_mux_gpio_select() local
39 i2c_mux_gpio_set(mux, chan); in i2c_mux_gpio_select()
46 struct gpiomux *mux = i2c_mux_priv(muxc); in i2c_mux_gpio_deselect() local
48 i2c_mux_gpio_set(mux, mux->data.idle); in i2c_mux_gpio_deselect()
53 static int i2c_mux_gpio_probe_fw(struct gpiomux *mux, in i2c_mux_gpio_probe_fw() argument
90 mux->data.parent = i2c_adapter_id(adapter); in i2c_mux_gpio_probe_fw()
93 mux->data.n_values = device_get_child_node_count(dev); in i2c_mux_gpio_probe_fw()
95 mux->data.n_values, sizeof(*mux->data.values), in i2c_mux_gpio_probe_fw()
116 mux->data.values = values; in i2c_mux_gpio_probe_fw()
118 if (device_property_read_u32(dev, "idle-state", &mux->data.idle)) in i2c_mux_gpio_probe_fw()
119 mux->data.idle = I2C_MUX_GPIO_NO_IDLE; in i2c_mux_gpio_probe_fw()
127 struct gpiomux *mux; in i2c_mux_gpio_probe() local
133 mux = devm_kzalloc(&pdev->dev, sizeof(*mux), GFP_KERNEL); in i2c_mux_gpio_probe()
134 if (!mux) in i2c_mux_gpio_probe()
138 ret = i2c_mux_gpio_probe_fw(mux, pdev); in i2c_mux_gpio_probe()
142 memcpy(&mux->data, dev_get_platdata(&pdev->dev), in i2c_mux_gpio_probe()
143 sizeof(mux->data)); in i2c_mux_gpio_probe()
151 mux->ngpios = ngpios; in i2c_mux_gpio_probe()
153 parent = i2c_get_adapter(mux->data.parent); in i2c_mux_gpio_probe()
157 muxc = i2c_mux_alloc(parent, &pdev->dev, mux->data.n_values, in i2c_mux_gpio_probe()
158 array_size(ngpios, sizeof(*mux->gpios)), 0, in i2c_mux_gpio_probe()
164 mux->gpios = muxc->priv; in i2c_mux_gpio_probe()
165 muxc->priv = mux; in i2c_mux_gpio_probe()
173 if (mux->data.idle != I2C_MUX_GPIO_NO_IDLE) { in i2c_mux_gpio_probe()
174 initial_state = mux->data.idle; in i2c_mux_gpio_probe()
177 initial_state = mux->data.values[0]; in i2c_mux_gpio_probe()
195 mux->gpios[i] = gpiod; in i2c_mux_gpio_probe()
208 for (i = 0; i < mux->data.n_values; i++) { in i2c_mux_gpio_probe()
209 u32 nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0; in i2c_mux_gpio_probe()
210 unsigned int class = mux->data.classes ? mux->data.classes[i] : 0; in i2c_mux_gpio_probe()
212 ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], class); in i2c_mux_gpio_probe()
218 mux->data.n_values, parent->name); in i2c_mux_gpio_probe()