From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: linux-input@vger.kernel.org,
Furquan Shaikh <furquan@chromium.org>,
Benson Leung <bleung@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Input: cros_ec_keyb - handle x86 detachable/convertible Chromebooks
Date: Fri, 27 May 2022 15:37:14 -0700 [thread overview]
Message-ID: <YpFSmsQ8hRM0cYG4@google.com> (raw)
In-Reply-To: <CAE-0n51CVEUF4knuSAK7RWACaUF3Fmi3jmMORZb1cVFyARnHTw@mail.gmail.com>
On Fri, May 27, 2022 at 05:35:36PM -0400, Stephen Boyd wrote:
> Quoting Dmitry Torokhov (2022-05-26 16:12:30)
> > From: Furquan Shaikh <furquan@chromium.org>
> >
> > Some detachable/convertible x86 Chromebooks use EC buttons/switches
> > interface to signal volume up/down and other buttons. This configuration is
> > signalled via presence of GOOG0007 ACPI device. The main keyboard on such
> > Chromebooks is still using the standard 8042/atkbd combo.
> >
> > Signed-off-by: Furquan Shaikh <furquan@chromium.org>
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
>
> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>
> Two questions below.
>
> > drivers/input/keyboard/cros_ec_keyb.c | 21 ++++++++++++++++++---
> > 1 file changed, 18 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> > index e8338b1c5776..c14136b733a9 100644
> > --- a/drivers/input/keyboard/cros_ec_keyb.c
> > +++ b/drivers/input/keyboard/cros_ec_keyb.c
> > @@ -677,14 +678,19 @@ static const struct attribute_group cros_ec_keyb_attr_group = {
> >
> > static int cros_ec_keyb_probe(struct platform_device *pdev)
> > {
> > - struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
> > + struct cros_ec_device *ec;
> > struct device *dev = &pdev->dev;
> > struct cros_ec_keyb *ckdev;
> > bool buttons_switches_only = device_get_match_data(dev);
> > int err;
> >
> > - if (!dev->of_node)
> > - return -ENODEV;
> > + /*
> > + * If the parent ec device has not been probed yet, defer the probe of
> > + * this keyboard/button driver until later.
> > + */
> > + ec = dev_get_drvdata(pdev->dev.parent);
>
> Does cros_ec populate the child node before setting the drvdata? Or in
> ACPI designs this device is created as a child of cros_ec before the
> driver probes?
Yes, ACPI "bus" gets scanned and all device objects are created
regardless of the driver presence and whether probe has completed or
not.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2022-05-27 22:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 23:12 [PATCH 1/2] Input: cros_ec_keyb - switch to using generic device properties Dmitry Torokhov
2022-05-26 23:12 ` [PATCH 2/2] Input: cros_ec_keyb - handle x86 detachable/convertible Chromebooks Dmitry Torokhov
2022-05-27 21:35 ` Stephen Boyd
2022-05-27 22:37 ` Dmitry Torokhov [this message]
2022-05-27 21:29 ` [PATCH 1/2] Input: cros_ec_keyb - switch to using generic device properties 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=YpFSmsQ8hRM0cYG4@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=bleung@chromium.org \
--cc=furquan@chromium.org \
--cc=groeck@chromium.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.