Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268199
b: refs/heads/master
c: c11f02e
h: refs/heads/master
i:
  268197: f04e585
  268195: 608367a
  268191: b870572
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 75f0a90 commit 30641cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 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: 06420c2d61f3ec838f15933b8c03ae2e658d0d56
refs/heads/master: c11f02ed4274a007f44c24bcafc07b203960c60e
27 changes: 16 additions & 11 deletions trunk/drivers/staging/iio/adc/ad7291.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,10 @@ static int __devinit ad7291_probe(struct i2c_client *client,
i2c_set_clientdata(client, indio_dev);

chip->client = client;
/* Tsense always enabled */
chip->command = AD7291_NOISE_DELAY | AD7291_T_SENSE_MASK;

chip->command = AD7291_NOISE_DELAY |
AD7291_T_SENSE_MASK | /* Tsense always enabled */
AD7291_ALERT_POLARITY; /* set irq polarity low level */

if (voltage_uv) {
chip->int_vref_mv = voltage_uv / 1000;
Expand All @@ -604,6 +606,18 @@ static int __devinit ad7291_probe(struct i2c_client *client,
indio_dev->info = &ad7291_info;
indio_dev->modes = INDIO_DIRECT_MODE;

ret = ad7291_i2c_write(chip, AD7291_COMMAND, AD7291_RESET);
if (ret) {
ret = -EIO;
goto error_disable_reg;
}

ret = ad7291_i2c_write(chip, AD7291_COMMAND, chip->command);
if (ret) {
ret = -EIO;
goto error_disable_reg;
}

if (client->irq > 0) {
ret = request_threaded_irq(client->irq,
NULL,
Expand All @@ -613,15 +627,6 @@ static int __devinit ad7291_probe(struct i2c_client *client,
indio_dev);
if (ret)
goto error_disable_reg;

/* set irq polarity low level */
chip->command |= AD7291_ALERT_POLARITY;
}

ret = ad7291_i2c_write(chip, AD7291_COMMAND, chip->command);
if (ret) {
ret = -EIO;
goto error_unreg_irq;
}

ret = iio_device_register(indio_dev);
Expand Down

0 comments on commit 30641cd

Please sign in to comment.