char *buf)
{
struct iio_ring_buffer *ring = dev_get_drvdata(dev);
- struct iio_dev *dev_info = ring->indio_dev;
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = ring->indio_dev;
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
return sprintf(buf, "u%d/16\n", st->chip_info->bits);
}
char *buf)
{
struct iio_ring_buffer *ring = dev_get_drvdata(dev);
- struct iio_dev *dev_info = ring->indio_dev;
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = ring->indio_dev;
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
return sprintf(buf, "s%d/16\n", st->chip_info->bits);
}
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
struct i2c_client *client = st->client;
int ret = 0, len = 0;
char rxbuf[2];
long mask;
- mutex_lock(&dev_info->mlock);
+ mutex_lock(&indio_dev->mlock);
/*
* If monitor mode is enabled, the method for reading a single
* channel will have to be rather different and has not yet
}
/* If ring buffer capture is occurring, query the buffer */
- if (iio_ring_enabled(dev_info)) {
+ if (iio_ring_enabled(indio_dev)) {
mask = max1363_mode_table[this_attr->address].modemask;
data = max1363_single_channel_from_ring(mask, st);
if (data < 0) {
len = sprintf(buf, "%u\n", data);
error_ret:
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&indio_dev->mlock);
return ret ? ret : len;
}
char *buf)
{
/* Driver currently only support internal vref */
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
/* Corresponds to Vref / 2^(bits) */
if ((1 << (st->chip_info->bits + 1))
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
return sprintf(buf, "%s\n", st->client->name);
}
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
return sprintf(buf, "%d\n", max1363_monitor_speeds[st->monitor_speed]);
}
const char *buf,
size_t len)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
int i, ret;
unsigned long val;
bool found = false;
if (!found)
return -EINVAL;
- mutex_lock(&dev_info->mlock);
+ mutex_lock(&indio_dev->mlock);
st->monitor_speed = i;
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&indio_dev->mlock);
return 0;
}
char *buf,
bool high)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
if (high)
size_t len,
bool high)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
unsigned long val;
int ret;
size_t len,
bool high)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
long val;
int ret;
S_IRUGO | S_IWUSR, max1363_show_thresh_low,
max1363_store_thresh_low_signed, 7);
-static int max1363_int_th(struct iio_dev *dev_info,
+static int max1363_int_th(struct iio_dev *indio_dev,
int index,
s64 timestamp,
int not_test)
{
- struct max1363_state *st = dev_info->dev_data;
+ struct max1363_state *st = indio_dev->dev_data;
st->last_timestamp = timestamp;
schedule_work(&st->thresh_work);
struct device_attribute *attr,
char *buf)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
struct iio_event_attr *this_attr = to_iio_event_attr(attr);
int val;
- mutex_lock(&dev_info->mlock);
+ mutex_lock(&indio_dev->mlock);
if (this_attr->mask & 0x8)
val = (1 << (this_attr->mask & 0x7)) & st->mask_low;
else
val = (1 << this_attr->mask) & st->mask_high;
- mutex_unlock(&dev_info->mlock);
+ mutex_unlock(&indio_dev->mlock);
return sprintf(buf, "%d\n", !!val);
}
const char *buf,
size_t len)
{
- struct iio_dev *dev_info = dev_get_drvdata(dev);
- struct max1363_state *st = iio_dev_get_devdata(dev_info);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
+ struct max1363_state *st = iio_dev_get_devdata(indio_dev);
struct iio_event_attr *this_attr = to_iio_event_attr(attr);
unsigned long val;
int ret;
}
if (st->monitor_on && !st->mask_high && !st->mask_low)
iio_remove_event_from_list(this_attr->listel,
- &dev_info->interrupts[0]->ev_list);
+ &indio_dev->interrupts[0]->ev_list);
if (!st->monitor_on && val)
iio_add_event_to_list(this_attr->listel,
- &dev_info->interrupts[0]->ev_list);
+ &indio_dev->interrupts[0]->ev_list);
max1363_monitor_mode_update(st, !!(st->mask_high | st->mask_low));
error_ret: