Re: [PATCH v2 4/4] input: misc: rt5120: Add power key support

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

 



Hi ChiYuan,

On Wed, Jun 22, 2022 at 06:01:44PM +0800, cy_huang wrote:
> +
> +	is_pressed = !(stat & RT5120_PWRKEYSTAT_MASK);
> +
> +	if ((is_pressed && irq == priv->press_irq) ||
> +	    (!is_pressed  && irq == priv->release_irq)) {
> +		input_report_key(priv->input, KEY_POWER, is_pressed);
> +		input_sync(priv->input);
> +	}
> +

What is the reason for checking both the status and interrupt? Can we
simply say:


	input_report_key(priv->input, KEY_POWER,
			 !(stat & RT5120_PWRKEYSTAT_MASK));
	input_sync(priv->input);

?

Thanks.

-- 
Dmitry



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux