return ret;
}
-static int ad7606_read_raw(struct iio_dev *dev_info,
+static int ad7606_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val,
int *val2,
long m)
{
int ret;
- struct ad7606_state *st = dev_info->dev_data;
+ struct ad7606_state *st = indio_dev->dev_data;
unsigned int scale_uv;
switch (m) {
case 0:
- mutex_lock(&dev_info->mlock);
- if (iio_ring_enabled(dev_info))
+ mutex_lock(&indio_dev->mlock);
+ if (iio_ring_enabled(indio_dev))
ret = ad7606_scan_from_ring(st, chan->address);
else
ret = ad7606_scan_direct(st, chan->address);
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&indio_dev->mlock);
if (ret < 0)
return ret;
static ssize_t ad7606_show_range(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7606_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct ad7606_state *st = iio_dev_get_devdata(indio_dev);
return sprintf(buf, "%u\n", st->range);
}
static ssize_t ad7606_store_range(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7606_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct ad7606_state *st = iio_dev_get_devdata(indio_dev);
unsigned long lval;
if (strict_strtoul(buf, 10, &lval))
dev_err(dev, "range is not supported\n");
return -EINVAL;
}
- mutex_lock(&dev_info->mlock);
+ mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_range, lval == 10000);
st->range = lval;
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&indio_dev->mlock);
return count;
}
static ssize_t ad7606_show_oversampling_ratio(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7606_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct ad7606_state *st = iio_dev_get_devdata(indio_dev);
return sprintf(buf, "%u\n", st->oversampling);
}
static ssize_t ad7606_store_oversampling_ratio(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7606_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct ad7606_state *st = iio_dev_get_devdata(indio_dev);
unsigned long lval;
int ret;
return ret;
}
- mutex_lock(&dev_info->mlock);
+ mutex_lock(&indio_dev->mlock);
gpio_set_value(st->pdata->gpio_os0, (ret >> 0) & 1);
gpio_set_value(st->pdata->gpio_os1, (ret >> 1) & 1);
gpio_set_value(st->pdata->gpio_os1, (ret >> 2) & 1);
st->oversampling = lval;
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&indio_dev->mlock);
return count;
}
struct attribute *attr, int n)
{
struct device *dev = container_of(kobj, struct device, kobj);
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct ad7606_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct ad7606_state *st = iio_dev_get_devdata(indio_dev);
mode_t mode = attr->mode;