Lines Matching full:x9250
4 * x9250.c -- Renesas X9250 potentiometers IIO driver
25 struct x9250 { struct
35 static int x9250_write8(struct x9250 *x9250, u8 cmd, u8 val) in x9250_write8() argument
43 return spi_write_then_read(x9250->spi, txbuf, ARRAY_SIZE(txbuf), NULL, 0); in x9250_write8()
46 static int x9250_read8(struct x9250 *x9250, u8 cmd, u8 *val) in x9250_read8() argument
53 return spi_write_then_read(x9250->spi, txbuf, ARRAY_SIZE(txbuf), val, 1); in x9250_read8()
76 struct x9250 *x9250 = iio_priv(indio_dev); in x9250_read_raw() local
83 ret = x9250_read8(x9250, X9250_CMD_RD_WCR(ch), &v); in x9250_read_raw()
90 *val = 1000 * x9250->cfg->kohms; in x9250_read_raw()
117 struct x9250 *x9250 = iio_priv(indio_dev); in x9250_write_raw() local
127 gpiod_set_value_cansleep(x9250->wp_gpio, 0); in x9250_write_raw()
128 ret = x9250_write8(x9250, X9250_CMD_WR_WCR(ch), val); in x9250_write_raw()
129 gpiod_set_value_cansleep(x9250->wp_gpio, 1); in x9250_write_raw()
159 struct x9250 *x9250; in x9250_probe() local
168 * The x9250 needs a 5ms maximum delay after the power-supplies are set in x9250_probe()
173 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*x9250)); in x9250_probe()
177 x9250 = iio_priv(indio_dev); in x9250_probe()
178 x9250->spi = spi; in x9250_probe()
179 x9250->cfg = spi_get_device_match_data(spi); in x9250_probe()
180 x9250->wp_gpio = devm_gpiod_get_optional(&spi->dev, "wp", GPIOD_OUT_LOW); in x9250_probe()
181 if (IS_ERR(x9250->wp_gpio)) in x9250_probe()
182 return dev_err_probe(&spi->dev, PTR_ERR(x9250->wp_gpio), in x9250_probe()
188 indio_dev->name = x9250->cfg->name; in x9250_probe()
209 .name = "x9250",
219 MODULE_DESCRIPTION("X9250 ALSA SoC driver");