linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Baltieri <fabiobaltieri@chromium.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	Tzung-Bi Shih <tzungbi@kernel.org>,
	Simon Glass <sjg@chromium.org>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 3/3] dt-bindings: google,cros-ec-keyb: add fn-key and f-keymap props
Date: Tue, 16 Dec 2025 12:23:06 +0000	[thread overview]
Message-ID: <aUFPKni-iFkxQQGu@google.com> (raw)
In-Reply-To: <2gd2npolfpo5jruwraamwpn3wurm7w447jnwsbcfonmhos2owf@ejrqiz3qdxj4>

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

      reply	other threads:[~2025-12-16 12:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 15:47 [PATCH v1 0/3] Input: cros_ec_keyb: add function key support Fabio Baltieri
2025-12-09 15:47 ` [PATCH v1 1/3] Input: cros_ec_keyb: clarify key event error message Fabio Baltieri
2025-12-11 13:29   ` Simon Glass
2025-12-13  9:40   ` Dmitry Torokhov
2025-12-09 15:47 ` [PATCH v1 2/3] Input: cros_ec_keyb: add function key support Fabio Baltieri
2025-12-11 13:29   ` Simon Glass
2025-12-15 13:09     ` Fabio Baltieri
2025-12-09 15:47 ` [PATCH v1 3/3] dt-bindings: google,cros-ec-keyb: add fn-key and f-keymap props Fabio Baltieri
2025-12-09 17:24   ` Rob Herring (Arm)
2025-12-09 19:22   ` Rob Herring
2025-12-10 18:00     ` Fabio Baltieri
2025-12-12  4:44       ` Dmitry Torokhov
2025-12-16 12:23         ` Fabio Baltieri [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aUFPKni-iFkxQQGu@google.com \
    --to=fabiobaltieri@chromium.org \
    --cc=bleung@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=groeck@chromium.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sjg@chromium.org \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).