ALSPRX2
};
-static int tsl2x7x_clear_interrupts(struct tsl2X7X_chip *chip, int reg)
-{
- int ret;
-
- ret = i2c_smbus_write_byte(chip->client,
- TSL2X7X_CMD_REG | TSL2X7X_CMD_SPL_FN | reg);
- if (ret < 0)
- dev_err(&chip->client->dev,
- "%s: failed to clear interrupt status %x: %d\n",
- __func__, reg, ret);
-
- return ret;
-}
-
static int tsl2x7x_read_status(struct tsl2X7X_chip *chip)
{
int ret;
if (ret < 0)
return ret;
- ret = tsl2x7x_clear_interrupts(chip, TSL2X7X_CMD_PROXALS_INT_CLR);
- if (ret < 0)
+ ret = i2c_smbus_write_byte(chip->client,
+ TSL2X7X_CMD_REG | TSL2X7X_CMD_SPL_FN |
+ TSL2X7X_CMD_PROXALS_INT_CLR);
+ if (ret < 0) {
+ dev_err(&chip->client->dev,
+ "%s: failed to clear interrupt status: %d\n",
+ __func__, ret);
return ret;
+ }
chip->tsl2x7x_chip_status = TSL2X7X_CHIP_WORKING;
timestamp);
}
- tsl2x7x_clear_interrupts(chip, TSL2X7X_CMD_PROXALS_INT_CLR);
+ ret = i2c_smbus_write_byte(chip->client,
+ TSL2X7X_CMD_REG | TSL2X7X_CMD_SPL_FN |
+ TSL2X7X_CMD_PROXALS_INT_CLR);
+ if (ret < 0)
+ dev_err(&chip->client->dev,
+ "%s: failed to clear interrupt status: %d\n",
+ __func__, ret);
return IRQ_HANDLED;
}