Lines Matching +full:0 +full:- +full:indexed
1 // SPDX-License-Identifier: GPL-2.0-or-later
19 #define ADIS16080_DIN_GYRO (0 << 10) /* Gyroscope output */
26 * 0: No changes to control register.
37 * struct adis16080_state - device instance specific data
58 .tx_buf = &st->buf, in adis16080_read_sample()
62 .rx_buf = &st->buf, in adis16080_read_sample()
67 st->buf = cpu_to_be16(addr | ADIS16080_DIN_WRITE); in adis16080_read_sample()
69 ret = spi_sync_transfer(st->us, t, ARRAY_SIZE(t)); in adis16080_read_sample()
70 if (ret == 0) in adis16080_read_sample()
71 *val = sign_extend32(be16_to_cpu(st->buf), 11); in adis16080_read_sample()
87 mutex_lock(&st->lock); in adis16080_read_raw()
88 ret = adis16080_read_sample(indio_dev, chan->address, val); in adis16080_read_raw()
89 mutex_unlock(&st->lock); in adis16080_read_raw()
92 switch (chan->type) { in adis16080_read_raw()
94 *val = st->info->scale_val; in adis16080_read_raw()
95 *val2 = st->info->scale_val2; in adis16080_read_raw()
103 /* 85 C = 585, 25 C = 0 */ in adis16080_read_raw()
104 *val = 85000 - 25000; in adis16080_read_raw()
108 return -EINVAL; in adis16080_read_raw()
111 switch (chan->type) { in adis16080_read_raw()
113 /* 2.5 V = 0 */ in adis16080_read_raw()
117 /* 85 C = 585, 25 C = 0 */ in adis16080_read_raw()
118 *val = DIV_ROUND_CLOSEST(25 * 585, 85 - 25); in adis16080_read_raw()
121 return -EINVAL; in adis16080_read_raw()
127 return -EINVAL; in adis16080_read_raw()
140 .indexed = 1,
141 .channel = 0,
148 .indexed = 1,
156 .indexed = 1,
157 .channel = 0,
194 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); in adis16080_probe()
196 return -ENOMEM; in adis16080_probe()
201 mutex_init(&st->lock); in adis16080_probe()
204 st->us = spi; in adis16080_probe()
205 st->info = &adis16080_chip_info[id->driver_data]; in adis16080_probe()
207 indio_dev->name = spi->dev.driver->name; in adis16080_probe()
208 indio_dev->channels = adis16080_channels; in adis16080_probe()
209 indio_dev->num_channels = ARRAY_SIZE(adis16080_channels); in adis16080_probe()
210 indio_dev->info = &adis16080_info; in adis16080_probe()
211 indio_dev->modes = INDIO_DIRECT_MODE; in adis16080_probe()
219 return 0; in adis16080_remove()