Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249196
b: refs/heads/master
c: b6b7068
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 26, 2011
1 parent 3dade06 commit 6e4d3a3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9cc559891181d354cc5b83d0cfecbe262d690b32
refs/heads/master: b6b7068ca3d2fa52d69870ba37cbb6ebac53eff8
70 changes: 35 additions & 35 deletions trunk/drivers/staging/iio/adc/max1363_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ static ssize_t max1363_show_precision_u(struct device *dev,
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);
}

Expand All @@ -165,8 +165,8 @@ static ssize_t max1363_show_precision_s(struct device *dev,
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);
}

Expand Down Expand Up @@ -238,16 +238,16 @@ static ssize_t max1363_read_single_channel(struct device *dev,
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;
s32 data ;
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
Expand All @@ -259,7 +259,7 @@ static ssize_t max1363_read_single_channel(struct device *dev,
}

/* 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) {
Expand Down Expand Up @@ -300,7 +300,7 @@ static ssize_t max1363_read_single_channel(struct device *dev,
len = sprintf(buf, "%u\n", data);

error_ret:
mutex_unlock(&dev_info->mlock);
mutex_unlock(&indio_dev->mlock);
return ret ? ret : len;
}

Expand Down Expand Up @@ -337,8 +337,8 @@ static ssize_t max1363_show_scale(struct device *dev,
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))
Expand All @@ -355,8 +355,8 @@ static ssize_t max1363_show_name(struct device *dev,
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);
}

Expand Down Expand Up @@ -1012,8 +1012,8 @@ static ssize_t max1363_monitor_show_freq(struct device *dev,
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]);
}

Expand All @@ -1022,8 +1022,8 @@ static ssize_t max1363_monitor_store_freq(struct device *dev,
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;
Expand All @@ -1039,9 +1039,9 @@ static ssize_t max1363_monitor_store_freq(struct device *dev,
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;
}
Expand All @@ -1058,8 +1058,8 @@ static ssize_t max1363_show_thresh(struct device *dev,
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)
Expand Down Expand Up @@ -1090,8 +1090,8 @@ static ssize_t max1363_store_thresh_unsigned(struct device *dev,
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;
Expand Down Expand Up @@ -1144,8 +1144,8 @@ static ssize_t max1363_store_thresh_signed(struct device *dev,
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;
Expand Down Expand Up @@ -1250,12 +1250,12 @@ static IIO_DEVICE_ATTR_NAMED(in3min2_thresh_low_value,
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);
Expand Down Expand Up @@ -1311,17 +1311,17 @@ static ssize_t max1363_read_interrupt_config(struct device *dev,
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);
}
Expand Down Expand Up @@ -1465,8 +1465,8 @@ static ssize_t max1363_write_interrupt_config(struct device *dev,
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;
Expand Down Expand Up @@ -1500,10 +1500,10 @@ static ssize_t max1363_write_interrupt_config(struct device *dev,
}
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:
Expand Down

0 comments on commit 6e4d3a3

Please sign in to comment.