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

Reply via email to