linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philip Chen <philipchen@chromium.org>
To: Stephen Boyd <swboyd@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Douglas Anderson <dianders@chromium.org>,
	Benson Leung <bleung@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Guenter Roeck <groeck@chromium.org>,
	Lee Jones <lee.jones@linaro.org>, Rajat Jain <rajatja@google.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v5 2/2] Input: cros-ec-keyb - Expose function row physical map to userspace
Date: Thu, 14 Jan 2021 18:32:31 -0800	[thread overview]
Message-ID: <CA+cxXh=FRy446k_Qs6AsQuzZKY7Y8cA+0ky=QO=ntryX8o5EJw@mail.gmail.com> (raw)
In-Reply-To: <161058820506.3661239.14441197324080899810@swboyd.mtv.corp.google.com>

On Wed, Jan 13, 2021 at 5:36 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Philip Chen (2021-01-13 17:25:13)
> > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> > index b379ed7628781..273e3c9ba0b03 100644
> > --- a/drivers/input/keyboard/cros_ec_keyb.c
> > +++ b/drivers/input/keyboard/cros_ec_keyb.c
> > @@ -578,6 +590,19 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev)
> >         ckdev->idev = idev;
> >         cros_ec_keyb_compute_valid_keys(ckdev);
> >
> > +       of_property_for_each_u32(dev->of_node, "function-row-physmap",
> > +                                prop, p, key_pos) {
> > +               if (i >= MAX_NUM_TOP_ROW_KEYS) {
> > +                       dev_err(dev, "Only support up to %d top row keys.\n",
>
> dev_warn? And drop the period please as we don't add them in the kernel
> usually.
Done.
>
> > +                               MAX_NUM_TOP_ROW_KEYS);
> > +                       break;
> > +               }
> > +               ckdev->function_row_physmap[i] = MATRIX_SCAN_CODE(
>
> Maybe grow some more local variables, like for function_row_physmap so
> this can fit on one line?
Done. Please take a look at v6.
>
>                 row = KEY_ROW(key_pos);
>                 col = KEY_COL(key_pos);
>                 map[i] = MATRIX_SCAN_CODE(row, col, ckdev->row_shift);
>
> > +                       KEY_ROW(key_pos), KEY_COL(key_pos), ckdev->row_shift);
> > +               i++;
>
> We could remove this and just increment num_function_row_keys instead.
> Then that condition check may be a little longer but probably still ok.
Done. Please take a look at v6.
>
>
> > +       }
> > +       ckdev->num_function_row_keys = i;
> > +
> >         err = input_register_device(ckdev->idev);
> >         if (err) {
> >                 dev_err(dev, "cannot register input device\n");

  reply	other threads:[~2021-01-15  2:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  1:25 [PATCH v5 1/2] dt-bindings: input: cros-ec-keyb: Add a new property Philip Chen
2021-01-14  1:25 ` [PATCH v5 2/2] Input: cros-ec-keyb - Expose function row physical map to userspace Philip Chen
2021-01-14  1:36   ` Stephen Boyd
2021-01-15  2:32     ` Philip Chen [this message]
2021-01-14  1:30 ` [PATCH v5 1/2] dt-bindings: input: cros-ec-keyb: Add a new property Stephen Boyd
2021-01-14  5:47   ` Philip Chen

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='CA+cxXh=FRy446k_Qs6AsQuzZKY7Y8cA+0ky=QO=ntryX8o5EJw@mail.gmail.com' \
    --to=philipchen@chromium.org \
    --cc=bleung@chromium.org \
    --cc=dianders@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajatja@google.com \
    --cc=swboyd@chromium.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).