lkml.org 
[lkml]   [2020]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessary
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

\
 
 \ /
  Last update: 2020-07-21 23:35    [W:0.152 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site