Re: [PATCH v2 1/2] Input: cros_ec_keyb - add function key support

From: Fabio Baltieri
Date: Mon Dec 29 2025 - 11:37:30 EST


On Sat, Dec 27, 2025 at 07:24:33AM -0700, Simon Glass wrote:
> Hi Fabio,
>
> On Wed, 24 Dec 2025 at 08:22, Fabio Baltieri <fabiobaltieri@xxxxxxxxxxxx> wrote:
> >
> > Add support for handling an Fn button and sending separate keycodes for
> > a subset of keys in the matrix defined in the upper half of the keymap.
> >
> > Signed-off-by: Fabio Baltieri <fabiobaltieri@xxxxxxxxxxxx>
> > ---
> > drivers/input/keyboard/cros_ec_keyb.c | 120 ++++++++++++++++++++++----
> > 1 file changed, 104 insertions(+), 16 deletions(-)
> >
>
> Reviewed-by: Simon Glass <sjg@xxxxxxxxxxxx>
>
> I suggest a function comment for the two new functions you add.

Sure, will do.

> > + if (code == KEY_FN)
> > + return cros_ec_keyb_process_fn_key(ckdev, row, col, state);
> > +
> > + if (!state) {
> > + if (ckdev->fn_key_status[col] & BIT(row)) {
> > + pos = MATRIX_SCAN_CODE(row + ckdev->rows, col, ckdev->row_shift);
> > + code = keycodes[pos];
>
> You might want a helper to do this as it is repeated below

Sounds good, adding one for v3

Thanks for the review,
Fabio