From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: gpio-keys: Convert to universal device properties API
Date: Wed, 26 Oct 2016 18:16:10 -0700 [thread overview]
Message-ID: <20161027011610.GB31660@dtor-ws> (raw)
In-Reply-To: <20161017143803.142231-1-mika.westerberg@linux.intel.com>
Hi Mika,
On Mon, Oct 17, 2016 at 05:38:03PM +0300, Mika Westerberg wrote:
> In order to use this driver in ACPI based systems, convert the driver to
> take advantage of device properties APIs instead of Device Tree specific
> one and make it available outside of CONFIG_OF.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
> drivers/input/keyboard/gpio_keys.c | 92 ++++++++++++++++----------------------
> 1 file changed, 38 insertions(+), 54 deletions(-)
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 29093657f2ef..0e6d516df01b 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -22,13 +22,12 @@
> #include <linux/proc_fs.h>
> #include <linux/delay.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/input.h>
> #include <linux/gpio_keys.h>
> #include <linux/workqueue.h>
> #include <linux/gpio.h>
> #include <linux/of.h>
> -#include <linux/of_platform.h>
> -#include <linux/of_gpio.h>
> #include <linux/of_irq.h>
> #include <linux/spinlock.h>
>
> @@ -479,13 +478,15 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
> spin_lock_init(&bdata->lock);
>
> if (gpio_is_valid(button->gpio)) {
> -
> - error = devm_gpio_request_one(&pdev->dev, button->gpio,
> - GPIOF_IN, desc);
> - if (error < 0) {
> - dev_err(dev, "Failed to request GPIO %d, error %d\n",
> - button->gpio, error);
> - return error;
> + /* Only request GPIO if GPIO descriptor is not used */
> + if (!button->gpiod) {
So the issue here is that button is supposed to be constant (in case of
legacy platform data) and we should not be stuffing gpiod in there. The
commit adding the descriptor to button data was wrong.
I have a patch that moves in from button data to bdata for polled keys
and also an alternative patch for gpio_keys; I'll post the series.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2016-10-27 1:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 14:38 [PATCH] Input: gpio-keys: Convert to universal device properties API Mika Westerberg
2016-10-18 0:40 ` Rafael J. Wysocki
2016-10-19 12:12 ` Andy Shevchenko
2016-10-27 1:16 ` Dmitry Torokhov [this message]
2016-10-27 7:02 ` Mika Westerberg
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=20161027011610.GB31660@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-input@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
/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).