linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Shiyan <shc_work@mail.ru>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Linus Walleij <linus.walleij@stericsson.com>,
	Alexander Shiyan <shc_work@mail.ru>
Subject: [PATCH] input: gpio_keys: added setup call for extending functionality of driver
Date: Wed, 20 Jun 2012 20:09:57 +0400	[thread overview]
Message-ID: <1340208597-31865-1-git-send-email-shc_work@mail.ru> (raw)

This additional call can be used for extending functionality of
driver. For example we can add EV_SND, EV_LED, etc. handlers.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/input/keyboard/gpio_keys.c |    3 +++
 include/linux/gpio_keys.h          |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 62bfce4..2b1bcb2 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -707,6 +707,9 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 			wakeup = 1;
 	}
 
+	if (pdata->setup)
+		pdata->setup(input);
+
 	error = sysfs_create_group(&pdev->dev.kobj, &gpio_keys_attr_group);
 	if (error) {
 		dev_err(dev, "Unable to export keys/switches, error: %d\n",
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index a7e977f..0dfd3fe 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -2,6 +2,7 @@
 #define _GPIO_KEYS_H
 
 struct device;
+struct input_dev;
 
 struct gpio_keys_button {
 	/* Configuration parameters */
@@ -25,6 +26,7 @@ struct gpio_keys_platform_data {
 	unsigned int rep:1;		/* enable input subsystem auto repeat */
 	int (*enable)(struct device *dev);
 	void (*disable)(struct device *dev);
+	int (*setup)(struct input_dev *input);
 	const char *name;		/* input device name */
 };
 
-- 
1.7.3.4


             reply	other threads:[~2012-06-20 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20 16:09 Alexander Shiyan [this message]
2012-06-21  8:50 ` [PATCH] input: gpio_keys: added setup call for extending functionality of driver Dmitry Torokhov
2012-06-21 10:03   ` Mark Brown

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=1340208597-31865-1-git-send-email-shc_work@mail.ru \
    --to=shc_work@mail.ru \
    --cc=dmitry.torokhov@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@stericsson.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).