Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235768
b: refs/heads/master
c: 826514b
h: refs/heads/master
v: v3
  • Loading branch information
Roland Stigge authored and Greg Kroah-Hartman committed Jan 31, 2011
1 parent 958f39c commit d655d19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 868788278eaa5b841ec1a810b41e156f5fba0ab5
refs/heads/master: 826514b4ee347bf683f043e0900590cfac4d6da5
11 changes: 8 additions & 3 deletions trunk/drivers/staging/iio/dac/max517.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ enum max517_device_ids {

struct max517_data {
struct iio_dev *indio_dev;
struct i2c_client *client;
unsigned short vref_mv[2];
};

Expand All @@ -57,7 +58,9 @@ static ssize_t max517_set_value(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count, int channel)
{
struct i2c_client *client = to_i2c_client(dev);
struct iio_dev *dev_info = dev_get_drvdata(dev);
struct max517_data *data = iio_dev_get_devdata(dev_info);
struct i2c_client *client = data->client;
u8 outbuf[4]; /* 1x or 2x command + value */
int outbuf_size = 0;
int res;
Expand Down Expand Up @@ -147,7 +150,7 @@ static ssize_t max517_show_scale2(struct device *dev,
}
static IIO_DEVICE_ATTR(out2_scale, S_IRUGO, max517_show_scale2, NULL, 0);

/* On MAX517 variant, we have two outputs */
/* On MAX517 variant, we have one output */
static struct attribute *max517_attributes[] = {
&iio_dev_attr_out1_raw.dev_attr.attr,
&iio_dev_attr_out1_scale.dev_attr.attr,
Expand All @@ -158,7 +161,7 @@ static struct attribute_group max517_attribute_group = {
.attrs = max517_attributes,
};

/* On MAX518 and MAX518 variant, we have two outputs */
/* On MAX518 and MAX519 variant, we have two outputs */
static struct attribute *max518_attributes[] = {
&iio_dev_attr_out1_raw.dev_attr.attr,
&iio_dev_attr_out1_scale.dev_attr.attr,
Expand Down Expand Up @@ -201,6 +204,8 @@ static int max517_probe(struct i2c_client *client,

i2c_set_clientdata(client, data);

data->client = client;

data->indio_dev = iio_allocate_device();
if (data->indio_dev == NULL) {
err = -ENOMEM;
Expand Down

0 comments on commit d655d19

Please sign in to comment.