[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=WAbfe9BC5QPDezz3FSEwHRFdQeZpARJYT4b9V1rNp_nA@mail.gmail.com>
Date: Mon, 2 May 2022 10:02:54 -0700
From: Doug Anderson <dianders@...omium.org>
To: Stephen Boyd <swboyd@...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>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<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
Hi,
On Fri, Apr 29, 2022 at 4:31 PM Stephen Boyd <swboyd@...omium.org> wrote:
>
> In commit 4352e23a7ff2 ("Input: cros-ec-keyb - only register keyboard if
> rows/columns exist") we skipped registration of the keyboard if the
> row/columns property didn't exist, but that has a slight problem for
> existing DTBs. The DTBs have the rows/columns properties, so removing
> the properties to indicate only switches exist makes this keyboard
> driver fail to probe, resulting in broken power and volume buttons. Ease
> the migration of existing DTBs by skipping keyboard registration if the
> google,cros-ec-keyb-switches compatible exists.
>
> The end result is that new DTBs can either choose to remove the matrix
> keymap properties or leave them in place and add this new compatible
> indicating the matrix keyboard properties should be ignored. Existing
> DTBs will continue to work, but they will keep registering the keyboard
> that does nothing. To fix that problem we can add this extra compatible
> to existing DTBs and the keyboard will stop being registered. Finally,
> if google,cros-ec-keyb is missing then this driver won't even attempt to
> register the matrix keyboard.
>
> Cc: Krzysztof Kozlowski <krzk@...nel.org>
> Cc: Rob Herring <robh+dt@...nel.org>
> Cc: <devicetree@...r.kernel.org>
> Cc: Benson Leung <bleung@...omium.org>
> Cc: Guenter Roeck <groeck@...omium.org>
> Cc: Douglas Anderson <dianders@...omium.org>
> Cc: Hsin-Yi Wang <hsinyi@...omium.org>
> Cc: "Joseph S. Barrera III" <joebar@...omium.org>
> Fixes: 4352e23a7ff2 ("Input: cros-ec-keyb - only register keyboard if rows/columns exist")
> Signed-off-by: Stephen Boyd <swboyd@...omium.org>
> ---
> drivers/input/keyboard/cros_ec_keyb.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> 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.
-Doug
Powered by blists - more mailing lists