From: "Rafał Miłecki" <zajec5@gmail.com>
To: linux-input@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>
Cc: "Hauke Mehrtens" <hauke@hauke-m.de>, "Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH] Input: gpio_keys - add ack_irq callback for HW that needs ACK
Date: Thu, 28 Nov 2013 16:00:00 +0100 [thread overview]
Message-ID: <1385650800-8908-1-git-send-email-zajec5@gmail.com> (raw)
On bcm47xx arch we have GPIO keys with interrupts, but after every IRQ
we have to change GPIO interrupt polarity. This is necessary to stop
hardware from generating IRQs all the time and set it into state that
will generate another IRQ on button release.
This is not exactly an ACK, but I think it makes sense to use this more
generic name.
With this patch we can easily implement GPIO keys support for bcm47xx
just using gpio_keys.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
This change to gpio_keys was proposed as an alternative to
re-implementing most of the gpio_keys code in arch tree, see patch:
MIPS: BCM47XX: Prepare support for GPIO buttons
http://www.linux-mips.org/archives/linux-mips/2013-11/msg00160.html
Please let me know if this is acceptable change for you.
---
drivers/input/keyboard/gpio_keys.c | 2 ++
include/linux/gpio_keys.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index b29ca65..c6e41be 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -362,6 +362,8 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
BUG_ON(irq != bdata->irq);
+ if (bdata->button->ack_irq)
+ bdata->button->ack_irq(bdata->button);
if (bdata->button->wakeup)
pm_stay_awake(bdata->input->dev.parent);
if (bdata->timer_debounce)
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index a7e977f..3c4244e 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -15,6 +15,7 @@ struct gpio_keys_button {
bool can_disable;
int value; /* axis value for EV_ABS */
unsigned int irq; /* Irq number in case of interrupt keys */
+ void (*ack_irq)(const struct gpio_keys_button *button);
};
struct gpio_keys_platform_data {
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2013-11-28 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-28 15:00 Rafał Miłecki [this message]
2013-11-28 15:26 ` [PATCH] Input: gpio_keys - add ack_irq callback for HW that needs ACK Rafał Miłecki
2013-11-29 14:57 ` Rafał Miłecki
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=1385650800-8908-1-git-send-email-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=hauke@hauke-m.de \
--cc=jkosina@suse.cz \
--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).