diff mbox

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

Message ID 8cd1ece4cc014dd6d7ac6eb4bde393a96b376c8c.1290631852.git.bengardiner@nanometrics.ca (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Gardiner Nov. 24, 2010, 9:01 p.m. UTC
None
diff mbox

Patch

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 */
 };