Lines Matching +full:adc +full:- +full:dev

1 // SPDX-License-Identifier: GPL-2.0-only
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()
100 static int men_z188_probe(struct mcb_device *dev, in men_z188_probe() argument
103 struct z188_adc *adc; in men_z188_probe() local
108 indio_dev = devm_iio_device_alloc(&dev->dev, sizeof(struct z188_adc)); in men_z188_probe()
110 return -ENOMEM; in men_z188_probe()
112 adc = iio_priv(indio_dev); in men_z188_probe()
113 indio_dev->name = "z188-adc"; in men_z188_probe()
114 indio_dev->info = &z188_adc_info; in men_z188_probe()
115 indio_dev->modes = INDIO_DIRECT_MODE; in men_z188_probe()
116 indio_dev->channels = z188_adc_iio_channels; in men_z188_probe()
117 indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels); in men_z188_probe()
119 mem = mcb_request_mem(dev, "z188-adc"); in men_z188_probe()
123 adc->base = ioremap(mem->start, resource_size(mem)); in men_z188_probe()
124 if (adc->base == NULL) in men_z188_probe()
127 men_z188_config_channels(adc->base); in men_z188_probe()
129 adc->mem = mem; in men_z188_probe()
130 mcb_set_drvdata(dev, indio_dev); in men_z188_probe()
139 iounmap(adc->base); in men_z188_probe()
142 return -ENXIO; in men_z188_probe()
145 static void men_z188_remove(struct mcb_device *dev) in men_z188_remove() argument
147 struct iio_dev *indio_dev = mcb_get_drvdata(dev); in men_z188_remove()
148 struct z188_adc *adc = iio_priv(indio_dev); in men_z188_remove() local
151 iounmap(adc->base); in men_z188_remove()
152 mcb_release_mem(adc->mem); in men_z188_remove()
163 .name = "z188-adc",
173 MODULE_DESCRIPTION("IIO ADC driver for MEN 16z188 ADC Core");