Re: [PATCH] Input: gscps2 - supply PA-RISC keyboard keymap via device property

From: Dmitry Torokhov

Date: Thu Aug 06 2026 - 02:22:17 EST


Hi Helge,

On Tue, Aug 04, 2026 at 08:36:17PM +0200, Helge Deller wrote:
> On 8/4/26 15:59, Helge Deller wrote:
> > Hi Dmitry,
> >
> > On 8/3/26 06:39, Dmitry Torokhov wrote:
> > > Instead of hardcoding PA-RISC specific keycode tables into atkbd via
> > > compile-time inclusion, have the gscps2 PS/2 port driver attach a
> > > linux,keymap software node device property to the serio device when
> > > a keyboard port is registered. This allows atkbd to dynamically fetch
> > > and apply the custom keymap when probing the port using generic
> > > firmware property helpers, removing architecture-specific hacks from
> > > generic keyboard driver code.
> > >
> > > Co-locate the keymap definitions with the serio port driver by moving
> > > hpps2atkbd.h from drivers/input/keyboard/ to drivers/input/serio/.
> > > To handle the five conflicting keys on RDI PrecisionBook laptops without
> > > runtime model string checks or duplicate keymap tables in memory, add
> > > CONFIG_SERIO_GSCPS2_RDI_KEYCODES to drivers/input/serio/Kconfig and
> > > resolve the conflicting keycodes at compile time via preprocessor
> > > macros.
> > >
> > > Assisted-by: Antigravity:gemini-3.5-flash
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> > > ---
> > >
> > > v2:
> > > - instead of using device_create_managed_software_node() that has issue
> > >    if serio port is unregistered before it is fully registered, switch to
> > >    creating software node when initializing the driver and attach it to
> > >    the serio port
> > > - added keycodes lost in movement (0x92 - silently ignored, 0xca -
> > >    KEY_KPSLASH, 0xda - KEY_KPENTER).
> > >
> > >   drivers/input/keyboard/Kconfig      |  38 ---------
> > >   drivers/input/keyboard/atkbd.c      |   8 --
> > >   drivers/input/keyboard/hpps2atkbd.h | 110 -------------------------
> > >   drivers/input/serio/Kconfig         |  27 +++++++
> > >   drivers/input/serio/gscps2.c        |  47 ++++++++---
> > >   drivers/input/serio/hpps2atkbd.h    | 120 ++++++++++++++++++++++++++++
> > >   6 files changed, 184 insertions(+), 166 deletions(-)
> >
> > Thanks for cleaning it up.
> > Your solution is much cleaner and gets the hacks away.
> > I'll test and report back very soon.
> >
> > > diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
> > > index bf9b993f5733..cd1bca57fda3 100644
> > > --- a/drivers/input/serio/gscps2.c
> > > +++ b/drivers/input/serio/gscps2.c
> > > @@ -22,20 +22,19 @@
> > >    *                 was usable/enabled ?)
> > >    */
> > > -#include <linux/init.h>
> > > -#include <linux/module.h>
> > > -#include <linux/slab.h>
> > > -#include <linux/serio.h>
> > > +#include <linux/delay.h>
> > >   #include <linux/input.h>
> > >   #include <linux/interrupt.h>
> > > -#include <linux/spinlock.h>
> > > -#include <linux/delay.h>
> > > +#include <linux/io.h>
> > >   #include <linux/ioport.h>
> > > +#include <linux/property.h>
> > > +#include <linux/serio.h>
> > >   #include <asm/irq.h>
> > > -#include <asm/io.h>
> > >   #include <asm/parisc-device.h>
> > > +#include "hpps2atkbd.h"
> >
> > Doesn't it makes sense to move the contents of the new file
> > "hpps2atkbd.h" directly in here instead of keeping in own header?
> Other than that, you may add:
>
> Acked-by: Helge Deller <deller@xxxxxx>
> Tested-by: Helge Deller <deller@xxxxxx>

Thank you very much for testing it. I went ahead and merged the header
into the driver code and applied.

I have a few more cleanups since I've been looking at the driver, I'll
send them out in a couple of days.

Thanks.

--
Dmitry