Lines Matching +full:angle +full:- +full:measurement

1 // SPDX-License-Identifier: GPL-2.0-or-later
19 #define ADIS16260_SUPPLY_OUT 0x02 /* Power supply measurement */
20 #define ADIS16260_GYRO_OUT 0x04 /* X-axis gyroscope output */
21 #define ADIS16260_AUX_ADC 0x0A /* analog input channel measurement */
22 #define ADIS16260_TEMP_OUT 0x0C /* internal temperature measurement */
23 #define ADIS16260_ANGL_OUT 0x0E /* angle displacement */
33 #define ADIS16260_MSC_CTRL 0x34 /* Control, data ready, self-test settings */
50 /* Internal self-test enable */
175 ret = adis_write_reg_16(&adis16260->adis, ADIS16260_SLP_CNT, val); in adis16260_stop_device()
177 dev_err(&indio_dev->dev, "problem with turning device off: SLP_CNT"); in adis16260_stop_device()
192 const struct adis16260_chip_info *info = adis16260->info; in adis16260_read_raw()
193 struct adis *adis = &adis16260->adis; in adis16260_read_raw()
203 switch (chan->type) { in adis16260_read_raw()
205 *val = info->gyro_max_scale; in adis16260_read_raw()
206 *val2 = info->gyro_max_val; in adis16260_read_raw()
213 if (chan->channel == 0) { in adis16260_read_raw()
226 return -EINVAL; in adis16260_read_raw()
232 addr = adis16260_addresses[chan->scan_index][0]; in adis16260_read_raw()
240 addr = adis16260_addresses[chan->scan_index][1]; in adis16260_read_raw()
252 if (spi_get_device_id(adis->spi)->driver_data) in adis16260_read_raw()
262 return -EINVAL; in adis16260_read_raw()
272 struct adis *adis = &adis16260->adis; in adis16260_write_raw()
278 if (val < -2048 || val >= 2048) in adis16260_write_raw()
279 return -EINVAL; in adis16260_write_raw()
281 addr = adis16260_addresses[chan->scan_index][0]; in adis16260_write_raw()
285 return -EINVAL; in adis16260_write_raw()
287 addr = adis16260_addresses[chan->scan_index][1]; in adis16260_write_raw()
290 if (spi_get_device_id(adis->spi)->driver_data) in adis16260_write_raw()
298 t--; in adis16260_write_raw()
301 adis->spi->max_speed_hz = ADIS16260_SPI_SLOW; in adis16260_write_raw()
303 adis->spi->max_speed_hz = ADIS16260_SPI_FAST; in adis16260_write_raw()
308 return -EINVAL; in adis16260_write_raw()
368 return -ENODEV; in adis16260_probe()
371 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adis16260)); in adis16260_probe()
373 return -ENOMEM; in adis16260_probe()
378 adis16260->info = &adis16260_chip_info_table[id->driver_data]; in adis16260_probe()
380 indio_dev->name = id->name; in adis16260_probe()
381 indio_dev->info = &adis16260_info; in adis16260_probe()
382 indio_dev->channels = adis16260->info->channels; in adis16260_probe()
383 indio_dev->num_channels = adis16260->info->num_channels; in adis16260_probe()
384 indio_dev->modes = INDIO_DIRECT_MODE; in adis16260_probe()
386 ret = adis_init(&adis16260->adis, indio_dev, spi, &adis16260_data); in adis16260_probe()
390 ret = devm_adis_setup_buffer_and_trigger(&adis16260->adis, indio_dev, NULL); in adis16260_probe()
395 ret = __adis_initial_startup(&adis16260->adis); in adis16260_probe()
399 ret = devm_add_action_or_reset(&spi->dev, adis16260_stop, indio_dev); in adis16260_probe()
403 return devm_iio_device_register(&spi->dev, indio_dev); in adis16260_probe()