Re: [PATCH 1/1] Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessary
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-07-21 21:33:22
Also in:
lkml
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-07-21 21:33:22
Also in:
lkml
Hi Jiada, On Mon, Jul 20, 2020 at 04:36:12PM +0900, Jiada Wang wrote:
+static int mxt_check_retrigen(struct mxt_data *data)
+{
+ struct i2c_client *client = data->client;
+ int error;
+ int val;
+
+ data->use_retrigen_workaround = false;
+
+ if (irq_get_trigger_type(data->irq) & IRQF_TRIGGER_LOW)
+ return 0;
Do you think we could change this to:
irq_data = irq_get_irq_data(data->irq);
if (!irq_data) {
... invalid IRQ
retrun -EINVAL;
}
if (irqd_is_level_type(irq_data))
return 0;
as we should not really be concerned about polarity (there could be an
inverter between the controller and AP), but rather whether it is level
or edge interrupt.
Thanks.
--
Dmitry