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

Helge Deller <[email protected]> Tue, 4 Aug 2026 15:59:42 +0200
Newsgroups org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.linux-parisc
Message-ID <[email protected]>
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.
>=20
> 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.
>=20
> Assisted-by: Antigravity:gemini-3.5-flash
> Signed-off-by: Dmitry Torokhov <[email protected]>
> ---
>=20
> v2:
> - instead of using device_create_managed_software_node() that has issue
>    if serio port is unregistered before it is fully registered, switch t=
o
>    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).
>=20
>   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 ?)
>    */
>  =20
> -#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>
>  =20
>   #include <asm/irq.h>
> -#include <asm/io.h>
>   #include <asm/parisc-device.h>
>  =20
> +#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?

Helge