Re: [PATCH] Input: add IOC3 serio driver

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

 



Hi Thomas,

On Wed, Jan 15, 2020 at 01:59:50PM +0100, Thomas Bogendoerfer wrote:
> +
> +	platform_set_drvdata(pdev, d);
> +	serio_register_port(d->kbd);
> +	serio_register_port(d->aux);
> +
> +	ret = request_irq(irq, ioc3kbd_intr, IRQF_SHARED, "ioc3-kbd", d);

I just realized something - serio ports are registered asynchronously,
and therefore may not be ready when you request IRQ which may fire
immediately. To solve this issue serio core allows to specify start()
method that is called after serio port has been registered. In this
method you can set "exist" flag associated with either kbd or aux port,
and check these flags in your interrupt routine before deciding whether
you can forward the received data to appropriate port via
serio_interrupt().

Please see i8042_start() for example of use.

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