return 0;
}
-static int kxcjk1013_chip_ack_intr(struct kxcjk1013_data *data)
-{
- int ret;
-
- ret = i2c_smbus_read_byte_data(data->client, KXCJK1013_REG_INT_REL);
- if (ret < 0) {
- dev_err(&data->client->dev, "Error writing reg_int_rel\n");
- return ret;
- }
-
- return ret;
-}
-
static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
{
int ret;
indio_dev->masklength) {
ret = kxcjk1013_get_acc_reg(data, bit);
if (ret < 0) {
- kxcjk1013_chip_ack_intr(data);
mutex_unlock(&data->mutex);
goto err;
}
data->buffer[i++] = ret;
}
-
- kxcjk1013_chip_ack_intr(data);
-
mutex_unlock(&data->mutex);
iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
return IRQ_HANDLED;
}
+static int kxcjk1013_trig_try_reen(struct iio_trigger *trig)
+{
+ struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
+ struct kxcjk1013_data *data = iio_priv(indio_dev);
+ int ret;
+
+ ret = i2c_smbus_read_byte_data(data->client, KXCJK1013_REG_INT_REL);
+ if (ret < 0) {
+ dev_err(&data->client->dev, "Error reading reg_int_rel\n");
+ return ret;
+ }
+
+ return 0;
+}
+
static int kxcjk1013_data_rdy_trigger_set_state(struct iio_trigger *trig,
bool state)
{
static const struct iio_trigger_ops kxcjk1013_trigger_ops = {
.set_trigger_state = kxcjk1013_data_rdy_trigger_set_state,
+ .try_reenable = kxcjk1013_trig_try_reen,
.owner = THIS_MODULE,
};