From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH resend 3/4] Input: axp20x-pek - Do not register input device on some systems
Date: Wed, 8 Mar 2017 09:16:12 -0800 [thread overview]
Message-ID: <20170308171612.GA20567@dtor-ws> (raw)
In-Reply-To: <20170308085413.5185-4-hdegoede@redhat.com>
On Wed, Mar 08, 2017 at 09:54:12AM +0100, Hans de Goede wrote:
> On some systems (Intel tablets with axp288 pmic) the powerbutton is
> also connected to a gpio pin of the SoC, advertised through the
> "INTCFD9" / "PNP0C40" acpi device. This leads to double reporting
> of powerbutton events, which is undesirable, so one driver needs
> to not report input events in this case.
>
> Since the soc_button_array driver for the "PNP0C40" acpi device
> also handles wake from suspend on these tablets and since the
> axp20x-pel driver requires relative expensive i2c accrsses,
> it is best for the axp20x-pek driver to not register an input device
> in this case.
>
> Note that this commit leaves the axp20x-driver bound to the
> device, rather then returning -ENODEV, this is done so that the
> sysfs attributes it offers are kept around.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/input/misc/axp20x-pek.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
> index b7258ec..dbd2c89 100644
> --- a/drivers/input/misc/axp20x-pek.c
> +++ b/drivers/input/misc/axp20x-pek.c
> @@ -13,6 +13,7 @@
> * GNU General Public License for more details.
> */
>
> +#include <linux/acpi.h>
> #include <linux/errno.h>
> #include <linux/irq.h>
> #include <linux/init.h>
> @@ -267,9 +268,16 @@ static int axp20x_pek_probe(struct platform_device *pdev)
>
> axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);
>
> - error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
> - if (error)
> - return error;
> + /*
> + * Do not register the input device if there is an "INTCFD9"
> + * gpio button ACPI device, that handles the power button too,
> + * and otherwise we end up reporting all presses twice.
> + */
> + if (!acpi_dev_found("INTCFD9")) {
Should we also add "|| !IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY)"?
No need to resend, just shout if you agree/disagree.
> + error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
> + if (error)
> + return error;
> + }
>
> error = sysfs_create_group(&pdev->dev.kobj, &axp20x_attribute_group);
> if (error) {
> --
> 2.9.3
>
--
Dmitry
next prev parent reply other threads:[~2017-03-08 17:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 8:54 [PATCH resend 0/4] Input: axp20x-pek and gpio_keys patches Hans de Goede
2017-03-08 8:54 ` [PATCH resend 1/4] Input: axp20x-pek - Use our own device for errors Hans de Goede
2017-03-08 8:54 ` [PATCH resend 2/4] Input: axp20x_pek - Add axp20x_pek_probe_input_device helper Hans de Goede
2017-03-08 8:54 ` [PATCH resend 3/4] Input: axp20x-pek - Do not register input device on some systems Hans de Goede
2017-03-08 17:16 ` Dmitry Torokhov [this message]
2017-03-09 7:56 ` Hans de Goede
2017-03-08 8:54 ` [PATCH resend 4/4] Input: gpio_keys - Do not report wake button presses as evdev events Hans de Goede
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=20170308171612.GA20567@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linux-input@vger.kernel.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).