From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Philip Chen <philipchen@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
dianders@chromium.org, swboyd@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 v3 2/2] Input: cros-ec-keyb - Expose function row physical map to userspace
Date: Wed, 6 Jan 2021 21:21:13 -0800 [thread overview]
Message-ID: <X/aaSdEATjwStnOo@google.com> (raw)
In-Reply-To: <20210104182154.v3.2.Ibe7d7d53c5b4fe72c60de90111ff763b53f38dbb@changeid>
Hi Philip,
On Mon, Jan 04, 2021 at 06:22:34PM -0800, Philip Chen wrote:
> The top-row keys in a keyboard usually have dual functionalities.
> E.g. A function key "F1" is also an action key "Browser back".
>
> Therefore, when an application receives an action key code from
> a top-row key press, the application needs to know how to correlate
> the action key code with the function key code and do the conversion
> whenever necessary.
>
> Since the userpace already knows the key scanlines (row/column)
> associated with a received key code. Essentially, the userspace only
> needs a mapping between the key row/column and the matching physical
> location in the top row.
>
> This patch enhances the cros-ec-keyb driver to create such a mapping
> and expose it to userspace in the form of a function-row-physmap
> attribute. The attribute would be a space separated ordered list of
> row/column codes, for the keys in the function row, in a left-to-right
> order.
>
> The attribute will only be present when the device has a custom design
> for the top-row keys.
>
> Signed-off-by: Philip Chen <philipchen@chromium.org>
> ---
>
> Changes in v3:
> - parse `function-row-physmap` from DT earlier, when we probe
> cros_ec_keyb, and then store the extracted info in struct cros_ec_keyb.
Thank you for making the changes, much appreciated. Let's wait a bit to
see if Rob has any issues with this.
...
> static int cros_ec_keyb_probe(struct platform_device *pdev)
> {
> struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
> @@ -617,6 +690,12 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
> return err;
> }
>
> + err = sysfs_create_group(&dev->kobj, &cros_ec_keyb_attr_group);
> + if (err) {
> + dev_err(dev, "failed to create attributes. err=%d\n", err);
> + return err;
> + }
Let's use devm_device_add_group() so that we do not need to remove it
manually in cros_ec_keyb_remove().
Thanks.
--
Dmitry
prev parent reply other threads:[~2021-01-07 5:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 2:22 [PATCH v3 1/2] dt-bindings: input: cros-ec-keyb: Add a new property Philip Chen
2021-01-05 2:22 ` [PATCH v3 2/2] Input: cros-ec-keyb - Expose function row physical map to userspace Philip Chen
2021-01-07 5:21 ` Dmitry Torokhov [this message]
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=X/aaSdEATjwStnOo@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=bleung@chromium.org \
--cc=dianders@chromium.org \
--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=philipchen@chromium.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).