Re: [PATCH 1/1] Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux