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

Helge Deller <[email protected]> Tue, 4 Aug 2026 20:36:17 +0200
Newsgroups org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.linux-parisc
Message-ID <[email protected]>
On 8/4/26 15:59, Helge Deller wrote:
> Hi Dmitry,
>=20
> 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 withou=
t
>> 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 <[email protected]>
>> ---
>>
>> v2:
>> - instead of using device_create_managed_software_node() that has issue
>> =C2=A0=C2=A0 if serio port is unregistered before it is fully registere=
d, switch to
>> =C2=A0=C2=A0 creating software node when initializing the driver and at=
tach it to
>> =C2=A0=C2=A0 the serio port
>> - added keycodes lost in movement (0x92 - silently ignored, 0xca -
>> =C2=A0=C2=A0 KEY_KPSLASH, 0xda - KEY_KPENTER).
>>
>> =C2=A0 drivers/input/keyboard/Kconfig=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=
=C2=A0 38 ---------
>> =C2=A0 drivers/input/keyboard/atkbd.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=
=C2=A0=C2=A0 8 --
>> =C2=A0 drivers/input/keyboard/hpps2atkbd.h | 110 ----------------------=
=2D--
>> =C2=A0 drivers/input/serio/Kconfig=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 |=C2=A0 27 +++++++
>> =C2=A0 drivers/input/serio/gscps2.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 |=C2=A0 47 ++++++++---
>> =C2=A0 drivers/input/serio/hpps2atkbd.h=C2=A0=C2=A0=C2=A0 | 120 +++++++=
+++++++++++++++++++++
>> =C2=A0 6 files changed, 184 insertions(+), 166 deletions(-)
>=20
> Thanks for cleaning it up.
> Your solution is much cleaner and gets the hacks away.
> I'll test and report back very soon.
>=20
>> 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 @@
>> =C2=A0=C2=A0 *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 was usable/enabled ?)
>> =C2=A0=C2=A0 */
>> -#include <linux/init.h>
>> -#include <linux/module.h>
>> -#include <linux/slab.h>
>> -#include <linux/serio.h>
>> +#include <linux/delay.h>
>> =C2=A0 #include <linux/input.h>
>> =C2=A0 #include <linux/interrupt.h>
>> -#include <linux/spinlock.h>
>> -#include <linux/delay.h>
>> +#include <linux/io.h>
>> =C2=A0 #include <linux/ioport.h>
>> +#include <linux/property.h>
>> +#include <linux/serio.h>
>> =C2=A0 #include <asm/irq.h>
>> -#include <asm/io.h>
>> =C2=A0 #include <asm/parisc-device.h>
>> +#include "hpps2atkbd.h"
>=20
> 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 <[email protected]>
Tested-by: Helge Deller <[email protected]>

Thanks!
Helge