All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Gardiner <bengardiner@nanometrics.ca>
To: Gabor Juhos <juhosg@openwrt.org>
Cc: linux-input@vger.kernel.org
Subject: [PATCH WIP 6/6] fixup gpio_buttons : rename gpio-buttons / gpio_buttons to gpio-keys-polled / gpio_keys_polled
Date: Wed, 24 Nov 2010 16:01:40 -0500	[thread overview]
Message-ID: <63087524a2badfeebc597925b45fcb6af9e7331f.1290631852.git.bengardiner@nanometrics.ca> (raw)
In-Reply-To: <cover.1290631852.git.bengardiner@nanometrics.ca>


Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
---
 drivers/input/keyboard/Kconfig                     |    4 +-
 drivers/input/keyboard/Makefile                    |    2 +-
 .../{gpio_buttons.c => gpio_keys_polled.c}         |   68 ++++++++++----------
 .../linux/{gpio_buttons.h => gpio_keys_polled.h}   |    2 +-
 4 files changed, 38 insertions(+), 38 deletions(-)
 rename drivers/input/keyboard/{gpio_buttons.c => gpio_keys_polled.c} (71%)
 rename include/linux/{gpio_buttons.h => gpio_keys_polled.h} (94%)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 4ab13fc..9648ff4 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -485,8 +485,8 @@ config KEYBOARD_W90P910
 	  To compile this driver as a module, choose M here: the
 	  module will be called w90p910_keypad.
 
-config INPUT_GPIO_BUTTONS
-	tristate "Polled GPIO buttons interface"
+config KEYBOARD_GPIO_POLLED
+	tristate "Polled GPIO buttons"
 	depends on GENERIC_GPIO
 	select INPUT_POLLDEV
 	help
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 2a52e0c..e6da817 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -44,5 +44,5 @@ obj-$(CONFIG_KEYBOARD_TNETV107X)	+= tnetv107x-keypad.o
 obj-$(CONFIG_KEYBOARD_TWL4030)		+= twl4030_keypad.o
 obj-$(CONFIG_KEYBOARD_XTKBD)		+= xtkbd.o
 obj-$(CONFIG_KEYBOARD_W90P910)		+= w90p910_keypad.o
-obj-$(CONFIG_INPUT_GPIO_BUTTONS)	+= gpio_buttons.o
+obj-$(CONFIG_KEYBOARD_GPIO_POLLED)	+= gpio_keys_polled.o
 
diff --git a/drivers/input/keyboard/gpio_buttons.c b/drivers/input/keyboard/gpio_keys_polled.c
similarity index 71%
rename from drivers/input/keyboard/gpio_buttons.c
rename to drivers/input/keyboard/gpio_keys_polled.c
index 0859b4d..390ed93 100644
--- a/drivers/input/keyboard/gpio_buttons.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -25,25 +25,25 @@
 #include <linux/ioport.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
-#include <linux/gpio_buttons.h>
+#include <linux/gpio_keys_polled.h>
 
-#define DRV_NAME	"gpio-buttons"
+#define DRV_NAME	"gpio-keys-polled"
 
-struct gpio_button_data {
+struct gpio_keys_button_data {
 	int last_state;
 	int count;
 	int can_sleep;
 };
 
-struct gpio_buttons_dev {
+struct gpio_keys_polled_dev {
 	struct input_polled_dev *poll_dev;
-	struct gpio_buttons_platform_data *pdata;
-	struct gpio_button_data *data;
+	struct gpio_keys_polled_platform_data *pdata;
+	struct gpio_keys_button_data *data;
 };
 
-static void gpio_buttons_check_state(struct input_dev *input,
+static void gpio_keys_polled_check_state(struct input_dev *input,
 				      struct gpio_keys_button *button,
-				      struct gpio_button_data *bdata)
+				      struct gpio_keys_button_data *bdata)
 {
 	int state;
 
@@ -63,16 +63,16 @@ static void gpio_buttons_check_state(struct input_dev *input,
 	}
 }
 
-static void gpio_buttons_poll(struct input_polled_dev *dev)
+static void gpio_keys_polled_poll(struct input_polled_dev *dev)
 {
-	struct gpio_buttons_dev *bdev = dev->private;
-	struct gpio_buttons_platform_data *pdata = bdev->pdata;
+	struct gpio_keys_polled_dev *bdev = dev->private;
+	struct gpio_keys_polled_platform_data *pdata = bdev->pdata;
 	struct input_dev *input = dev->input;
 	int i, threshold;
 
 	for (i = 0; i < bdev->pdata->nbuttons; i++) {
 		struct gpio_keys_button *button = &pdata->buttons[i];
-		struct gpio_button_data *bdata = &bdev->data[i];
+		struct gpio_keys_button_data *bdata = &bdev->data[i];
 
 		threshold = round_up(button->debounce_interval,
 				pdata->poll_interval) /
@@ -80,16 +80,16 @@ static void gpio_buttons_poll(struct input_polled_dev *dev)
 		if (bdata->count < threshold)
 			bdata->count++;
 		else
-			gpio_buttons_check_state(input, button, bdata);
+			gpio_keys_polled_check_state(input, button, bdata);
 
 	}
 }
 
-static int __devinit gpio_buttons_probe(struct platform_device *pdev)
+static int __devinit gpio_keys_polled_probe(struct platform_device *pdev)
 {
-	struct gpio_buttons_platform_data *pdata = pdev->dev.platform_data;
+	struct gpio_keys_polled_platform_data *pdata = pdev->dev.platform_data;
 	struct device *dev = &pdev->dev;
-	struct gpio_buttons_dev *bdev;
+	struct gpio_keys_polled_dev *bdev;
 	struct input_polled_dev *poll_dev;
 	struct input_dev *input;
 	int error;
@@ -98,15 +98,15 @@ static int __devinit gpio_buttons_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -ENXIO;
 
-	bdev = kzalloc(sizeof(struct gpio_buttons_dev) +
-		       pdata->nbuttons * sizeof(struct gpio_button_data),
+	bdev = kzalloc(sizeof(struct gpio_keys_polled_dev) +
+		       pdata->nbuttons * sizeof(struct gpio_keys_button_data),
 		       GFP_KERNEL);
 	if (!bdev) {
 		dev_err(dev, "no memory for private data\n");
 		return -ENOMEM;
 	}
 
-	bdev->data = (struct gpio_button_data *) &bdev[1];
+	bdev->data = (struct gpio_keys_button_data *) &bdev[1];
 
 	poll_dev = input_allocate_polled_device();
 	if (!poll_dev) {
@@ -116,14 +116,14 @@ static int __devinit gpio_buttons_probe(struct platform_device *pdev)
 	}
 
 	poll_dev->private = bdev;
-	poll_dev->poll = gpio_buttons_poll;
+	poll_dev->poll = gpio_keys_polled_poll;
 	poll_dev->poll_interval = pdata->poll_interval;
 
 	input = poll_dev->input;
 
 	input->evbit[0] = BIT(EV_KEY);
 	input->name = pdev->name;
-	input->phys = "gpio-buttons/input0";
+	input->phys = DRV_NAME"/input0";
 	input->dev.parent = &pdev->dev;
 
 	input->id.bustype = BUS_HOST;
@@ -176,7 +176,7 @@ static int __devinit gpio_buttons_probe(struct platform_device *pdev)
 
 	/* report initial state of the buttons */
 	for (i = 0; i < pdata->nbuttons; i++)
-		gpio_buttons_check_state(input, &pdata->buttons[i],
+		gpio_keys_polled_check_state(input, &pdata->buttons[i],
 					 &bdev->data[i]);
 
 	return 0;
@@ -194,10 +194,10 @@ err_free_bdev:
 	return error;
 }
 
-static int __devexit gpio_buttons_remove(struct platform_device *pdev)
+static int __devexit gpio_keys_polled_remove(struct platform_device *pdev)
 {
-	struct gpio_buttons_dev *bdev = platform_get_drvdata(pdev);
-	struct gpio_buttons_platform_data *pdata = bdev->pdata;
+	struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev);
+	struct gpio_keys_polled_platform_data *pdata = bdev->pdata;
 	int i;
 
 	input_unregister_polled_device(bdev->poll_dev);
@@ -213,27 +213,27 @@ static int __devexit gpio_buttons_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static struct platform_driver gpio_buttons_driver = {
-	.probe	= gpio_buttons_probe,
-	.remove	= __devexit_p(gpio_buttons_remove),
+static struct platform_driver gpio_keys_polled_driver = {
+	.probe	= gpio_keys_polled_probe,
+	.remove	= __devexit_p(gpio_keys_polled_remove),
 	.driver	= {
 		.name	= DRV_NAME,
 		.owner	= THIS_MODULE,
 	},
 };
 
-static int __init gpio_buttons_init(void)
+static int __init gpio_keys_polled_init(void)
 {
-	return platform_driver_register(&gpio_buttons_driver);
+	return platform_driver_register(&gpio_keys_polled_driver);
 }
 
-static void __exit gpio_buttons_exit(void)
+static void __exit gpio_keys_polled_exit(void)
 {
-	platform_driver_unregister(&gpio_buttons_driver);
+	platform_driver_unregister(&gpio_keys_polled_driver);
 }
 
-module_init(gpio_buttons_init);
-module_exit(gpio_buttons_exit);
+module_init(gpio_keys_polled_init);
+module_exit(gpio_keys_polled_exit);
 
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
diff --git a/include/linux/gpio_buttons.h b/include/linux/gpio_keys_polled.h
similarity index 94%
rename from include/linux/gpio_buttons.h
rename to include/linux/gpio_keys_polled.h
index f7f1467..bf7f94a 100644
--- a/include/linux/gpio_buttons.h
+++ b/include/linux/gpio_keys_polled.h
@@ -17,7 +17,7 @@
 
 #include <linux/gpio_keys.h>
 
-struct gpio_buttons_platform_data {
+struct gpio_keys_polled_platform_data {
 	struct gpio_keys_button *buttons;
 	int	nbuttons;		/* number of buttons */
 	int	poll_interval;		/* polling interval in msecs*/
-- 
1.7.0.4


  parent reply	other threads:[~2010-11-24 21:01 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 15:06 [PATCH 00/18] MIPS: initial support for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-23 15:06 ` [PATCH 01/18] MIPS: add initial support for the Atheros AR71XX/AR724X/AR931X SoCs Gabor Juhos
2010-11-23 15:06 ` [PATCH 02/18] MIPS: ath79: add GPIOLIB support Gabor Juhos
2010-11-23 15:06 ` [PATCH 03/18] MIPS: add generic support for multiple machines within a single kernel Gabor Juhos
2010-11-23 18:29   ` Arnaud Lacombe
2010-11-23 18:49     ` Luis R. Rodriguez
2010-11-23 18:51     ` Gabor Juhos
2010-11-23 19:06       ` Felix Fietkau
2010-11-23 19:20         ` David Daney
2010-11-23 22:12           ` Ralf Baechle
2010-11-23 15:06 ` [PATCH 04/18] MIPS: ath79: utilize the MIPS multi-machine support Gabor Juhos
2010-11-23 15:06 ` [PATCH 05/18] MIPS: ath79: add initial support for the Atheros PB44 reference board Gabor Juhos
2010-11-23 15:06 ` [PATCH 06/18] MIPS: ath79: add common GPIO LEDs device Gabor Juhos
2010-11-23 15:06 ` [PATCH 07/18] watchdog: add driver for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-23 15:06 ` [PATCH 08/18] MIPS: ath79: add common watchdog device Gabor Juhos
2010-11-23 15:06 ` [PATCH 09/18] input: add input driver for polled GPIO buttons Gabor Juhos
2010-11-23 19:24   ` Ben Gardiner
2010-11-24 17:24   ` Ben Gardiner
2010-11-24 17:24     ` Ben Gardiner
2010-11-24 18:54     ` Gabor Juhos
2010-11-24 20:28       ` Ben Gardiner
2010-11-24 21:01   ` [PATCH WIP 0/6] suggested changes to gpio_buttons driver Ben Gardiner
2010-11-24 21:01     ` [PATCH WIP 1/6] fixup gpio_buttons: use the same debounce_interval member found in gpio_key to obtain a threshold count based on polling interval Ben Gardiner
2010-11-24 21:01     ` [PATCH WIP 2/6] fixup gpio_buttons: use existing gpio_keys_button structure instead of introducing new gpio_button structure Ben Gardiner
2010-11-24 21:01     ` [PATCH WIP 3/6] fixup gpio_buttons: detect and error-out if a button is requested for wakeup Ben Gardiner
2010-11-24 21:01     ` [PATCH WIP 4/6] fixup gpio_buttons: show units of poll_interval platform data member Ben Gardiner
2010-11-24 21:01     ` [PATCH WIP 5/6] fixup gpio_buttons: move gpio_buttons.c to drivers/input/keyboard from drivers/input/misc Ben Gardiner
2010-11-24 21:01     ` Ben Gardiner [this message]
2010-11-30  7:56     ` [PATCH WIP 0/6] suggested changes to gpio_buttons driver Dmitry Torokhov
2010-11-30 10:30       ` Gabor Juhos
2010-11-30 14:29         ` Ben Gardiner
2010-11-30 18:26           ` Gabor Juhos
2010-11-30 18:44             ` [PATCH 0/8] input: gpio_keys_polled fixes Gabor Juhos
2010-11-30 22:16               ` Ben Gardiner
2010-12-05  9:11                 ` Gabor Juhos
2010-12-09  0:06                 ` Dmitry Torokhov
2010-12-09  8:07                   ` Gabor Juhos
2010-12-09 21:36                   ` Ben Gardiner
2010-11-30 18:44             ` [PATCH 1/8] input: gpio_keys_polled: add MODULE_ALIAS Gabor Juhos
2010-11-30 18:44             ` [PATCH 2/8] input: gpio_keys_polled: return -EINVAL if wakeup specified Gabor Juhos
2010-11-30 18:44             ` [PATCH 3/8] input: gpio_keys_polled: avoid possible division by zero Gabor Juhos
2010-11-30 18:44             ` [PATCH 4/8] input: gpio_keys_polled: use DIV_ROUND_UP to compute the threshold value Gabor Juhos
2010-11-30 18:44             ` [PATCH 5/8] input: gpio_keys_polled: precompute threshold value in the probe routine Gabor Juhos
2010-11-30 18:44             ` [PATCH 6/8] input: gpio_keys_polled: use tabs instead of spaces for indentation Gabor Juhos
2010-11-30 18:44             ` [PATCH 7/8] input: gpio_keys_polled: remove a local variable Gabor Juhos
2010-11-30 18:44             ` [PATCH 8/8] input: gpio_keys_polled: fix Kconfig help text Gabor Juhos
2010-12-01 22:53               ` Ferenc Wagner
2010-12-05  9:11                 ` Gabor Juhos
2010-12-05  9:34               ` [PATCH v2 " Gabor Juhos
2010-11-28  8:31   ` [PATCH 09/18] input: add input driver for polled GPIO buttons Dmitry Torokhov
2010-11-23 15:06 ` [PATCH 10/18] MIPS: ath79: add common GPIO buttons device Gabor Juhos
     [not found] ` <1290524800-21419-1-git-send-email-juhosg-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2010-11-23 15:06   ` [PATCH 11/18] spi: add SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-23 15:06     ` Gabor Juhos
2010-11-23 15:06 ` [PATCH 12/18] MIPS: ath79: add common SPI controller device Gabor Juhos
2010-11-23 15:06 ` [PATCH 13/18] USB: ehci: add workaround for Synopsys HC bug Gabor Juhos
2010-11-23 15:06 ` [PATCH 14/18] USB: ehci: add bus glue for the Atheros AR71XX/AR724X/AR913X SoCs Gabor Juhos
2010-11-23 15:06 ` [PATCH 15/18] USB: ohci: add bus glue for the Atheros AR71XX/AR7240 SoCs Gabor Juhos
2010-11-23 15:06 ` [PATCH 16/18] MIPS: ath79: add common USB Host Controller device Gabor Juhos
2010-11-23 15:06 ` [PATCH 17/18] MIPS: ath79: add initial support for the Atheros AP81 reference board Gabor Juhos
2010-11-23 15:06 ` [PATCH 18/18] MIPS: ath79: add common WMAC device for AR913X based boards Gabor Juhos
2010-11-23 18:16 ` [PATCH 00/18] MIPS: initial support for the Atheros AR71XX/AR724X/AR913X SoCs Arnaud Lacombe
2010-11-23 18:18   ` Arnaud Lacombe

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=63087524a2badfeebc597925b45fcb6af9e7331f.1290631852.git.bengardiner@nanometrics.ca \
    --to=bengardiner@nanometrics.ca \
    --cc=juhosg@openwrt.org \
    --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 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.