[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aUFPKni-iFkxQQGu@google.com>
Date: Tue, 16 Dec 2025 12:23:06 +0000
From: Fabio Baltieri <fabiobaltieri@...omium.org>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
Tzung-Bi Shih <tzungbi@...nel.org>, Simon Glass <sjg@...omium.org>,
linux-input@...r.kernel.org, devicetree@...r.kernel.org,
chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 3/3] dt-bindings: google,cros-ec-keyb: add fn-key and
f-keymap props
Hi Dmitry,
On Thu, Dec 11, 2025 at 08:44:02PM -0800, Dmitry Torokhov wrote:
> On Wed, Dec 10, 2025 at 06:00:29PM +0000, Fabio Baltieri wrote:
> > Hey Rob, thanks for the review.
> >
> > On Tue, Dec 09, 2025 at 01:22:43PM -0600, Rob Herring wrote:
> > > On Tue, Dec 09, 2025 at 03:47:06PM +0000, Fabio Baltieri wrote:
> > > > + fn-key:
> > > > + $ref: /schemas/types.yaml#/definitions/uint32
> > > > + description: |
> > > > + An u32 containing the coordinate of the Fn key, use the MATRIX_KEY(row,
> > > > + col, code) macro, code is ignored.
> > > > +
> > > > + fn-keymap:
> > >
> > > If keymap is linux,keymap, then this should perhaps be linux,fn-keymap.
> > > Depends if we still think linux,keymap is Linux specific?
> >
> > I'm open for suggestions, trying to understand the pattern, these are
> > specific to this binding I think if anything they should be
> > google,fn-key and google,fn-keymap, similarly to the existing
> > google,needs-ghost-filter -- no idea why function-row-physmap was not
> > prefixed but I guess it slipped in and now it's not worth changing it.
>
> Just double the number of rows in the regular keymap to accommodate the
> FN modifier, no need for separate keymap. Also no need to have fn-key
> property, use whatever key that reports KEY_FN. See how it is done in
> drivers/input/keyboard/tegra-kbc.c
Had a look at the tegra-kbc driver as you suggested, first thing it
seems like the fn-key functionality there is dead code since 2013,
`use_fn_map` could only be enabled with platform data, not OF, and that
has been removed in 3a495aeada2b, as it stands kbc->use_fn_map can only
be false. I could send a patch to rip off that code if you want me to,
clearly it hasn't been used in a while (unless I'm missing something).
About the extended fn map, I've two problems with it:
- it seems very wasteful: the normal map is loaded in a linear array
so it can be access directly, which make sense as that's typically
very densely populated, but in the case of the fn keys that's going to
be mostly empty, I'd expect ~20 keys top from a 18x8 matrix. So that
would waste load of space, direct access is good but for ~20 keys I
think it's fine to scan it, especially since it only happens when Fn
is pressed.
- I'd end up with two values for cols kicking around the driver, the
real one and the one used in the map, which I feel adds confusing in
the code.
- more importantly, one would have to keep the offset in mind when
setting the keys in dt, we rely on OEM doing this and I think having a
separate property with a meaningful name and a map with the same
row,col and different code is more intuitive and would make their life
easier, especially since we ship with keyboard of different size
and the offset would be different depending on the device.
As for the fn-key property, unfortunately based on past experience I'd
expect such OEM to want to change that code, I could specify the code
rather than the row,col but I would not plain hardcode. Even my
(thinkpad) laptop sends KEY_WAKEUP for Fn.
Cheers,
Fabio
--
Fabio Baltieri
Powered by blists - more mailing lists