Lines Matching +full:mem +full:- +full:base
1 // SPDX-License-Identifier: GPL-2.0-only
25 struct resource *mem; member
26 void __iomem *base; member
59 tmp = readw(adc->base + chan->channel * 4); in z188_iio_read_raw()
62 dev_info(&iio_dev->dev, 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()
105 struct resource *mem; 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()
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()
120 if (IS_ERR(mem)) in men_z188_probe()
121 return PTR_ERR(mem); 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()
139 iounmap(adc->base); in men_z188_probe()
141 mcb_release_mem(mem); in men_z188_probe()
142 return -ENXIO; in men_z188_probe()
151 iounmap(adc->base); in men_z188_remove()
152 mcb_release_mem(adc->mem); in men_z188_remove()
163 .name = "z188-adc",