[PATCH WIP 2/6] fixup gpio_buttons: use existing gpio_keys_button structure instead of introducing new gpio_button structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ben Gardiner <bengardiner@xxxxxxxxxxxxxx>
---
 drivers/input/misc/gpio_buttons.c |    6 +++---
 include/linux/gpio_buttons.h      |   11 ++---------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/input/misc/gpio_buttons.c b/drivers/input/misc/gpio_buttons.c
index f42906c..c34e978 100644
--- a/drivers/input/misc/gpio_buttons.c
+++ b/drivers/input/misc/gpio_buttons.c
@@ -42,7 +42,7 @@ struct gpio_buttons_dev {
 };
 
 static void gpio_buttons_check_state(struct input_dev *input,
-				      struct gpio_button *button,
+				      struct gpio_keys_button *button,
 				      struct gpio_button_data *bdata)
 {
 	int state;
@@ -71,7 +71,7 @@ static void gpio_buttons_poll(struct input_polled_dev *dev)
 	int i, threshold;
 
 	for (i = 0; i < bdev->pdata->nbuttons; i++) {
-		struct gpio_button *button = &pdata->buttons[i];
+		struct gpio_keys_button *button = &pdata->buttons[i];
 		struct gpio_button_data *bdata = &bdev->data[i];
 
 		threshold = round_up(button->debounce_interval,
@@ -132,7 +132,7 @@ static int __devinit gpio_buttons_probe(struct platform_device *pdev)
 	input->id.version = 0x0100;
 
 	for (i = 0; i < pdata->nbuttons; i++) {
-		struct gpio_button *button = &pdata->buttons[i];
+		struct gpio_keys_button *button = &pdata->buttons[i];
 		unsigned int gpio = button->gpio;
 		unsigned int type = button->type ?: EV_KEY;
 
diff --git a/include/linux/gpio_buttons.h b/include/linux/gpio_buttons.h
index c016f07..4d43de9 100644
--- a/include/linux/gpio_buttons.h
+++ b/include/linux/gpio_buttons.h
@@ -15,17 +15,10 @@
 #ifndef _GPIO_BUTTONS_H_
 #define _GPIO_BUTTONS_H_
 
-struct gpio_button {
-	int	gpio;		/* GPIO line number */
-	int	active_low;
-	char	*desc;		/* button description */
-	int	type;		/* input event type (EV_KEY, EV_SW) */
-	int	code;		/* input event code (KEY_*, SW_*) */
-	int debounce_interval;	/* debounce ticks interval in msecs */
-};
+#include <linux/gpio_keys.h>
 
 struct gpio_buttons_platform_data {
-	struct gpio_button *buttons;
+	struct gpio_keys_button *buttons;
 	int	nbuttons;		/* number of buttons */
 	int	poll_interval;		/* polling interval */
 };
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux