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