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;
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)