Lines Matching full:gpadc

3  * DA9150 GPADC Driver
86 struct da9150_gpadc *gpadc = data; in da9150_gpadc_irq() local
88 complete(&gpadc->complete); in da9150_gpadc_irq()
93 static int da9150_gpadc_read_adc(struct da9150_gpadc *gpadc, int hw_chan) in da9150_gpadc_read_adc() argument
98 mutex_lock(&gpadc->lock); in da9150_gpadc_read_adc()
101 da9150_reg_write(gpadc->da9150, DA9150_GPADC_MAN, in da9150_gpadc_read_adc()
106 try_wait_for_completion(&gpadc->complete); in da9150_gpadc_read_adc()
109 wait_for_completion_timeout(&gpadc->complete, msecs_to_jiffies(5)); in da9150_gpadc_read_adc()
112 da9150_bulk_read(gpadc->da9150, DA9150_GPADC_RES_A, 2, result_regs); in da9150_gpadc_read_adc()
114 mutex_unlock(&gpadc->lock); in da9150_gpadc_read_adc()
118 dev_err(gpadc->dev, "Timeout on channel %d of GPADC\n", in da9150_gpadc_read_adc()
156 static int da9150_gpadc_read_processed(struct da9150_gpadc *gpadc, int channel, in da9150_gpadc_read_processed() argument
161 raw_val = da9150_gpadc_read_adc(gpadc, hw_chan); in da9150_gpadc_read_processed()
226 struct da9150_gpadc *gpadc = iio_priv(indio_dev); in da9150_gpadc_read_raw() local
235 return da9150_gpadc_read_processed(gpadc, chan->channel, in da9150_gpadc_read_raw()
322 struct da9150_gpadc *gpadc; in da9150_gpadc_probe() local
326 indio_dev = devm_iio_device_alloc(dev, sizeof(*gpadc)); in da9150_gpadc_probe()
331 gpadc = iio_priv(indio_dev); in da9150_gpadc_probe()
333 gpadc->da9150 = da9150; in da9150_gpadc_probe()
334 gpadc->dev = dev; in da9150_gpadc_probe()
335 mutex_init(&gpadc->lock); in da9150_gpadc_probe()
336 init_completion(&gpadc->complete); in da9150_gpadc_probe()
338 irq = platform_get_irq_byname(pdev, "GPADC"); in da9150_gpadc_probe()
343 IRQF_ONESHOT, "GPADC", gpadc); in da9150_gpadc_probe()
366 .name = "da9150-gpadc",
373 MODULE_DESCRIPTION("GPADC Driver for DA9150");