[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200122065737.GG110084@dtor-ws>
Date: Tue, 21 Jan 2020 22:57:37 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Thomas Bogendoerfer <tbogendoerfer@...e.de>
Cc: linux-kernel@...r.kernel.org, linux-input@...r.kernel.org
Subject: Re: [PATCH] Input: add IOC3 serio driver
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
Powered by blists - more mailing lists