[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE-0n53x77n2ACuMYsFrdGhSkmO_4f8Uocnb+vKhcgoiY4RPQg@mail.gmail.com>
Date: Mon, 2 May 2022 15:02:19 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
LKML <linux-kernel@...r.kernel.org>, patches@...ts.linux.dev,
chrome-platform@...ts.linux.dev,
Krzysztof Kozlowski <krzk@...nel.org>,
Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
Hsin-Yi Wang <hsinyi@...omium.org>,
"Joseph S. Barrera III" <joebar@...omium.org>
Subject: Re: [PATCH v2 2/2] Input: cros-ec-keyb - skip keyboard registration
for switches compatible
Quoting Doug Anderson (2022-05-02 10:02:54)
> On Fri, Apr 29, 2022 at 4:31 PM Stephen Boyd <swboyd@...omium.org> wrote:
> >
> >
> > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> > index eef909e52e23..1bbe2987bf52 100644
> > --- a/drivers/input/keyboard/cros_ec_keyb.c
> > +++ b/drivers/input/keyboard/cros_ec_keyb.c
> > @@ -536,6 +536,12 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev)
> > u32 *physmap;
> > u32 key_pos;
> > unsigned int row, col, scancode, n_physmap;
> > + bool register_keyboard;
> > +
> > + /* Skip matrix registration if no keyboard */
> > + register_keyboard = device_get_match_data(dev);
> > + if (!register_keyboard)
> > + return 0;
> >
> > /*
> > * No rows and columns? There isn't a matrix but maybe there are
>
> As per my comments in patch #1, I wonder if it makes sense to delete
> the "No rows and columns?" logic and settle on the compatible as the
> one true way to specify this.
>
Ok. My only concern is that means we have to check for both compatibles
which is not really how DT compatible strings work. The compatible
string usually finds the more specific compatible that is first in the
list of compatibles in DT. You're essentially proposing that the
switches compatible could be first or last, the order doesn't matter.
If that isn't a problem then we can roll in a revert of commit
4352e23a7ff2 ("Input: cros-ec-keyb - only register keyboard if
rows/columns exist") and leave the rest of this patch alone and it will
implement this logic.
Powered by blists - more mailing lists