Lines Matching +full:adc +full:- +full:chan

1 // SPDX-License-Identifier: GPL-2.0-only
48 struct iio_chan_spec const *chan, in z188_iio_read_raw() argument
53 struct z188_adc *adc = iio_priv(iio_dev); in z188_iio_read_raw() local
59 tmp = readw(adc->base + chan->channel * 4); in z188_iio_read_raw()
62 dev_info(&iio_dev->dev, in z188_iio_read_raw()
63 "Oversampling error on ADC channel %d\n", in z188_iio_read_raw()
64 chan->channel); in z188_iio_read_raw()
65 return -EIO; in z188_iio_read_raw()
71 ret = -EINVAL; in z188_iio_read_raw()
103 struct z188_adc *adc; in men_z188_probe() local
107 indio_dev = devm_iio_device_alloc(&dev->dev, sizeof(struct z188_adc)); in men_z188_probe()
109 return -ENOMEM; in men_z188_probe()
111 adc = iio_priv(indio_dev); in men_z188_probe()
112 indio_dev->name = "z188-adc"; in men_z188_probe()
113 indio_dev->info = &z188_adc_info; in men_z188_probe()
114 indio_dev->modes = INDIO_DIRECT_MODE; in men_z188_probe()
115 indio_dev->channels = z188_adc_iio_channels; in men_z188_probe()
116 indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels); in men_z188_probe()
118 mem = mcb_request_mem(dev, "z188-adc"); in men_z188_probe()
122 adc->base = ioremap(mem->start, resource_size(mem)); in men_z188_probe()
123 if (adc->base == NULL) in men_z188_probe()
126 men_z188_config_channels(adc->base); in men_z188_probe()
128 adc->mem = mem; in men_z188_probe()
135 return -ENXIO; in men_z188_probe()
141 struct z188_adc *adc = iio_priv(indio_dev); in men_z188_remove() local
144 iounmap(adc->base); in men_z188_remove()
145 mcb_release_mem(adc->mem); in men_z188_remove()
156 .name = "z188-adc",
167 MODULE_DESCRIPTION("IIO ADC driver for MEN 16z188 ADC Core");