Lines Matching refs:indio_dev
474 static int vf610_set_conversion_mode(struct iio_dev *indio_dev, in vf610_set_conversion_mode() argument
478 struct vf610_adc *info = iio_priv(indio_dev); in vf610_set_conversion_mode()
480 mutex_lock(&indio_dev->mlock); in vf610_set_conversion_mode()
484 mutex_unlock(&indio_dev->mlock); in vf610_set_conversion_mode()
489 static int vf610_get_conversion_mode(struct iio_dev *indio_dev, in vf610_get_conversion_mode() argument
492 struct vf610_adc *info = iio_priv(indio_dev); in vf610_get_conversion_mode()
587 struct iio_dev *indio_dev = (struct iio_dev *)dev_id; in vf610_adc_isr() local
588 struct vf610_adc *info = iio_priv(indio_dev); in vf610_adc_isr()
594 if (iio_buffer_enabled(indio_dev)) { in vf610_adc_isr()
596 iio_push_to_buffers_with_timestamp(indio_dev, in vf610_adc_isr()
598 iio_trigger_notify_done(indio_dev->trig); in vf610_adc_isr()
634 static int vf610_read_raw(struct iio_dev *indio_dev, in vf610_read_raw() argument
640 struct vf610_adc *info = iio_priv(indio_dev); in vf610_read_raw()
647 mutex_lock(&indio_dev->mlock); in vf610_read_raw()
648 if (iio_buffer_enabled(indio_dev)) { in vf610_read_raw()
649 mutex_unlock(&indio_dev->mlock); in vf610_read_raw()
660 mutex_unlock(&indio_dev->mlock); in vf610_read_raw()
664 mutex_unlock(&indio_dev->mlock); in vf610_read_raw()
683 mutex_unlock(&indio_dev->mlock); in vf610_read_raw()
687 mutex_unlock(&indio_dev->mlock); in vf610_read_raw()
707 static int vf610_write_raw(struct iio_dev *indio_dev, in vf610_write_raw() argument
713 struct vf610_adc *info = iio_priv(indio_dev); in vf610_write_raw()
735 static int vf610_adc_buffer_postenable(struct iio_dev *indio_dev) in vf610_adc_buffer_postenable() argument
737 struct vf610_adc *info = iio_priv(indio_dev); in vf610_adc_buffer_postenable()
742 ret = iio_triggered_buffer_postenable(indio_dev); in vf610_adc_buffer_postenable()
750 channel = find_first_bit(indio_dev->active_scan_mask, in vf610_adc_buffer_postenable()
751 indio_dev->masklength); in vf610_adc_buffer_postenable()
761 static int vf610_adc_buffer_predisable(struct iio_dev *indio_dev) in vf610_adc_buffer_predisable() argument
763 struct vf610_adc *info = iio_priv(indio_dev); in vf610_adc_buffer_predisable()
776 return iio_triggered_buffer_predisable(indio_dev); in vf610_adc_buffer_predisable()
785 static int vf610_adc_reg_access(struct iio_dev *indio_dev, in vf610_adc_reg_access() argument
789 struct vf610_adc *info = iio_priv(indio_dev); in vf610_adc_reg_access()
817 struct iio_dev *indio_dev; in vf610_adc_probe() local
822 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct vf610_adc)); in vf610_adc_probe()
823 if (!indio_dev) { in vf610_adc_probe()
828 info = iio_priv(indio_dev); in vf610_adc_probe()
844 dev_name(&pdev->dev), indio_dev); in vf610_adc_probe()
875 platform_set_drvdata(pdev, indio_dev); in vf610_adc_probe()
879 indio_dev->name = dev_name(&pdev->dev); in vf610_adc_probe()
880 indio_dev->dev.parent = &pdev->dev; in vf610_adc_probe()
881 indio_dev->dev.of_node = pdev->dev.of_node; in vf610_adc_probe()
882 indio_dev->info = &vf610_adc_iio_info; in vf610_adc_probe()
883 indio_dev->modes = INDIO_DIRECT_MODE; in vf610_adc_probe()
884 indio_dev->channels = vf610_adc_iio_channels; in vf610_adc_probe()
885 indio_dev->num_channels = ARRAY_SIZE(vf610_adc_iio_channels); in vf610_adc_probe()
897 ret = iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time, in vf610_adc_probe()
904 ret = iio_device_register(indio_dev); in vf610_adc_probe()
913 iio_triggered_buffer_cleanup(indio_dev); in vf610_adc_probe()
924 struct iio_dev *indio_dev = platform_get_drvdata(pdev); in vf610_adc_remove() local
925 struct vf610_adc *info = iio_priv(indio_dev); in vf610_adc_remove()
927 iio_device_unregister(indio_dev); in vf610_adc_remove()
928 iio_triggered_buffer_cleanup(indio_dev); in vf610_adc_remove()
938 struct iio_dev *indio_dev = dev_get_drvdata(dev); in vf610_adc_suspend() local
939 struct vf610_adc *info = iio_priv(indio_dev); in vf610_adc_suspend()
955 struct iio_dev *indio_dev = dev_get_drvdata(dev); in vf610_adc_resume() local
956 struct vf610_adc *info = iio_priv(indio_dev); in vf610_adc_resume()