Lines Matching refs:indio_dev

255 static int ad7793_setup(struct iio_dev *indio_dev,  in ad7793_setup()  argument
259 struct ad7793_state *st = iio_priv(indio_dev); in ad7793_setup()
355 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in ad7793_read_frequency() local
356 struct ad7793_state *st = iio_priv(indio_dev); in ad7793_read_frequency()
367 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in ad7793_write_frequency() local
368 struct ad7793_state *st = iio_priv(indio_dev); in ad7793_write_frequency()
372 mutex_lock(&indio_dev->mlock); in ad7793_write_frequency()
373 if (iio_buffer_enabled(indio_dev)) { in ad7793_write_frequency()
374 mutex_unlock(&indio_dev->mlock); in ad7793_write_frequency()
377 mutex_unlock(&indio_dev->mlock); in ad7793_write_frequency()
390 mutex_lock(&indio_dev->mlock); in ad7793_write_frequency()
395 mutex_unlock(&indio_dev->mlock); in ad7793_write_frequency()
415 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in ad7793_show_scale_available() local
416 struct ad7793_state *st = iio_priv(indio_dev); in ad7793_show_scale_available()
453 static int ad7793_read_raw(struct iio_dev *indio_dev, in ad7793_read_raw() argument
459 struct ad7793_state *st = iio_priv(indio_dev); in ad7793_read_raw()
466 ret = ad_sigma_delta_single_conversion(indio_dev, chan, val); in ad7793_read_raw()
519 static int ad7793_write_raw(struct iio_dev *indio_dev, in ad7793_write_raw() argument
525 struct ad7793_state *st = iio_priv(indio_dev); in ad7793_write_raw()
529 mutex_lock(&indio_dev->mlock); in ad7793_write_raw()
530 if (iio_buffer_enabled(indio_dev)) { in ad7793_write_raw()
531 mutex_unlock(&indio_dev->mlock); in ad7793_write_raw()
558 mutex_unlock(&indio_dev->mlock); in ad7793_write_raw()
562 static int ad7793_write_raw_get_fmt(struct iio_dev *indio_dev, in ad7793_write_raw_get_fmt() argument
747 struct iio_dev *indio_dev; in ad7793_probe() local
760 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); in ad7793_probe()
761 if (indio_dev == NULL) in ad7793_probe()
764 st = iio_priv(indio_dev); in ad7793_probe()
766 ad_sd_init(&st->sd, indio_dev, spi, &ad7793_sigma_delta_info); in ad7793_probe()
791 spi_set_drvdata(spi, indio_dev); in ad7793_probe()
793 indio_dev->dev.parent = &spi->dev; in ad7793_probe()
794 indio_dev->name = spi_get_device_id(spi)->name; in ad7793_probe()
795 indio_dev->modes = INDIO_DIRECT_MODE; in ad7793_probe()
796 indio_dev->channels = st->chip_info->channels; in ad7793_probe()
797 indio_dev->num_channels = st->chip_info->num_channels; in ad7793_probe()
798 indio_dev->info = st->chip_info->iio_info; in ad7793_probe()
800 ret = ad_sd_setup_buffer_and_trigger(indio_dev); in ad7793_probe()
804 ret = ad7793_setup(indio_dev, pdata, vref_mv); in ad7793_probe()
808 ret = iio_device_register(indio_dev); in ad7793_probe()
815 ad_sd_cleanup_buffer_and_trigger(indio_dev); in ad7793_probe()
826 struct iio_dev *indio_dev = spi_get_drvdata(spi); in ad7793_remove() local
827 struct ad7793_state *st = iio_priv(indio_dev); in ad7793_remove()
829 iio_device_unregister(indio_dev); in ad7793_remove()
830 ad_sd_cleanup_buffer_and_trigger(indio_dev); in ad7793_remove()