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()
114 mux->data.values = values; in i2c_mux_gpio_probe_fw()
116 if (device_property_read_u32(dev, "idle-state", &mux->data.idle)) in i2c_mux_gpio_probe_fw()
117 mux->data.idle = I2C_MUX_GPIO_NO_IDLE; in i2c_mux_gpio_probe_fw()
125 struct gpiomux *mux; in i2c_mux_gpio_probe() local
131 mux = devm_kzalloc(&pdev->dev, sizeof(*mux), GFP_KERNEL); in i2c_mux_gpio_probe()
132 if (!mux) in i2c_mux_gpio_probe()
136 ret = i2c_mux_gpio_probe_fw(mux, pdev); in i2c_mux_gpio_probe()
140 memcpy(&mux->data, dev_get_platdata(&pdev->dev), in i2c_mux_gpio_probe()
141 sizeof(mux->data)); in i2c_mux_gpio_probe()
149 mux->ngpios = ngpios; in i2c_mux_gpio_probe()
151 parent = i2c_get_adapter(mux->data.parent); in i2c_mux_gpio_probe()
155 muxc = i2c_mux_alloc(parent, &pdev->dev, mux->data.n_values, in i2c_mux_gpio_probe()
156 array_size(ngpios, sizeof(*mux->gpios)), 0, in i2c_mux_gpio_probe()
162 mux->gpios = muxc->priv; in i2c_mux_gpio_probe()
163 muxc->priv = mux; in i2c_mux_gpio_probe()
171 if (mux->data.idle != I2C_MUX_GPIO_NO_IDLE) { in i2c_mux_gpio_probe()
172 initial_state = mux->data.idle; in i2c_mux_gpio_probe()
175 initial_state = mux->data.values[0]; in i2c_mux_gpio_probe()
193 mux->gpios[i] = gpiod; in i2c_mux_gpio_probe()
206 for (i = 0; i < mux->data.n_values; i++) { in i2c_mux_gpio_probe()
207 u32 nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0; in i2c_mux_gpio_probe()
208 unsigned int class = mux->data.classes ? mux->data.classes[i] : 0; in i2c_mux_gpio_probe()
210 ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], class); in i2c_mux_gpio_probe()
216 mux->data.n_values, parent->name); in i2c_mux_gpio_probe()