From: Doug Anderson <dianders@chromium.org>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
patches@lists.linux.dev, chrome-platform@lists.linux.dev,
Krzysztof Kozlowski <krzk@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>, Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
Hsin-Yi Wang <hsinyi@chromium.org>,
"Joseph S. Barrera III" <joebar@chromium.org>
Subject: Re: [PATCH v2 2/2] Input: cros-ec-keyb - skip keyboard registration for switches compatible
Date: Mon, 2 May 2022 10:02:54 -0700 [thread overview]
Message-ID: <CAD=FV=WAbfe9BC5QPDezz3FSEwHRFdQeZpARJYT4b9V1rNp_nA@mail.gmail.com> (raw)
In-Reply-To: <20220429233112.2851665-3-swboyd@chromium.org>
Hi,
On Fri, Apr 29, 2022 at 4:31 PM Stephen Boyd <swboyd@chromium.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@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: <devicetree@vger.kernel.org>
> Cc: Benson Leung <bleung@chromium.org>
> Cc: Guenter Roeck <groeck@chromium.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Hsin-Yi Wang <hsinyi@chromium.org>
> Cc: "Joseph S. Barrera III" <joebar@chromium.org>
> Fixes: 4352e23a7ff2 ("Input: cros-ec-keyb - only register keyboard if rows/columns exist")
> Signed-off-by: Stephen Boyd <swboyd@chromium.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
next prev parent reply other threads:[~2022-05-02 17:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 23:31 [PATCH v2 0/2] Input: cros-ec-keyb: Better matrixless support Stephen Boyd
2022-04-29 23:31 ` [PATCH v2 1/2] dt-bindings: google,cros-ec-keyb: Introduce switches only compatible Stephen Boyd
2022-05-02 17:00 ` Doug Anderson
2022-05-02 17:43 ` Dmitry Torokhov
2022-05-02 20:41 ` Stephen Boyd
2022-05-02 23:49 ` Stephen Boyd
2022-05-03 1:09 ` Doug Anderson
2022-05-12 10:22 ` Dmitry Torokhov
2022-05-12 18:58 ` Stephen Boyd
2022-05-12 20:11 ` Stephen Boyd
2022-05-12 23:31 ` Dmitry Torokhov
2022-05-12 23:46 ` Stephen Boyd
2022-05-12 23:53 ` Stephen Boyd
2022-05-13 19:07 ` Dmitry Torokhov
2022-04-29 23:31 ` [PATCH v2 2/2] Input: cros-ec-keyb - skip keyboard registration for switches compatible Stephen Boyd
2022-05-02 17:02 ` Doug Anderson [this message]
2022-05-02 22:02 ` Stephen Boyd
2022-05-03 1:06 ` Doug Anderson
2022-05-03 2:18 ` Stephen Boyd
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='CAD=FV=WAbfe9BC5QPDezz3FSEwHRFdQeZpARJYT4b9V1rNp_nA@mail.gmail.com' \
--to=dianders@chromium.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=groeck@chromium.org \
--cc=hsinyi@chromium.org \
--cc=joebar@chromium.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=robh+dt@kernel.org \
--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).