Commit d297b9bd authored by Sascha Hauer's avatar Sascha Hauer Committed by Jonathan Cameron

staging iio adt7410: make 16bit mode default

In 13bit mode the lower three bits of the adc value contain
flags. The driver does not use these flags at all, so make 16bit
mode the default.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Acked-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 6d459aa0
......@@ -761,13 +761,15 @@ static int __devinit adt7410_probe(struct i2c_client *client,
goto error_unreg_ct_irq;
}
if (client->irq && adt7410_platform_data[0]) {
ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
if (ret) {
ret = -EIO;
goto error_unreg_int_irq;
}
ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
if (ret) {
ret = -EIO;
goto error_unreg_int_irq;
}
chip->config |= ADT7410_RESOLUTION;
if (client->irq && adt7410_platform_data[0]) {
/* set irq polarity low level */
chip->config &= ~ADT7410_CT_POLARITY;
......@@ -776,12 +778,12 @@ static int __devinit adt7410_probe(struct i2c_client *client,
chip->config |= ADT7410_INT_POLARITY;
else
chip->config &= ~ADT7410_INT_POLARITY;
}
ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, chip->config);
if (ret) {
ret = -EIO;
goto error_unreg_int_irq;
}
ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, chip->config);
if (ret) {
ret = -EIO;
goto error_unreg_int_irq;
}
ret = iio_device_register(indio_dev);
if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment