Lines Matching +full:mux +full:- +full:states
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ADGS1408/ADGS1409 SPI MUX driver
11 #include <linux/mux/driver.h>
36 static int adgs1408_set(struct mux_control *mux, int state) in adgs1408_set() argument
38 struct spi_device *spi = to_spi_device(mux->chip->dev.parent); in adgs1408_set()
55 struct device *dev = &spi->dev; in adgs1408_probe()
58 struct mux_control *mux; in adgs1408_probe() local
64 chip_id = spi_get_device_id(spi)->driver_data; in adgs1408_probe()
70 mux_chip->ops = &adgs1408_ops; in adgs1408_probe()
76 ret = device_property_read_u32(dev, "idle-state", (u32 *)&idle_state); in adgs1408_probe()
80 mux = mux_chip->mux; in adgs1408_probe()
83 mux->states = 8; in adgs1408_probe()
85 mux->states = 4; in adgs1408_probe()
91 /* adgs1409 supports only 4 states */ in adgs1408_probe()
92 if (idle_state < mux->states) { in adgs1408_probe()
93 mux->idle_state = idle_state; in adgs1408_probe()
98 dev_err(dev, "invalid idle-state %d\n", idle_state); in adgs1408_probe()
99 return -EINVAL; in adgs1408_probe()
130 MODULE_DESCRIPTION("Analog Devices ADGS1408 MUX driver");