From patchwork Wed Nov 24 21:01:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 354311 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAOL1iUT023014 for ; Wed, 24 Nov 2010 21:01:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756590Ab0KXVBq (ORCPT ); Wed, 24 Nov 2010 16:01:46 -0500 Received: from na3sys009aog112.obsmtp.com ([74.125.149.207]:45160 "HELO na3sys009aog112.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756333Ab0KXVBp (ORCPT ); Wed, 24 Nov 2010 16:01:45 -0500 Received: from source ([74.125.83.52]) by na3sys009aob112.postini.com ([74.125.148.12]) with SMTP ID DSNKTO19OfypzowggjB2N+QnbhpyIIZ8+2Fd@postini.com; Wed, 24 Nov 2010 13:01:45 PST Received: by mail-gw0-f52.google.com with SMTP id a18so117423gwa.11 for ; Wed, 24 Nov 2010 13:01:45 -0800 (PST) Received: by 10.150.57.14 with SMTP id f14mr1618967yba.392.1290632504900; Wed, 24 Nov 2010 13:01:44 -0800 (PST) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id v8sm65841yba.14.2010.11.24.13.01.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Nov 2010 13:01:44 -0800 (PST) From: Ben Gardiner To: Gabor Juhos Cc: linux-input@vger.kernel.org Subject: [PATCH WIP 2/6] fixup gpio_buttons: use existing gpio_keys_button structure instead of introducing new gpio_button structure Date: Wed, 24 Nov 2010 16:01:36 -0500 Message-Id: <8cd1ece4cc014dd6d7ac6eb4bde393a96b376c8c.1290631852.git.bengardiner@nanometrics.ca> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: <1290524800-21419-10-git-send-email-juhosg@openwrt.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 24 Nov 2010 21:01:48 +0000 (UTC) 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 struct gpio_buttons_platform_data { - struct gpio_button *buttons; + struct gpio_keys_button *buttons; int nbuttons; /* number of buttons */ int poll_interval; /* polling interval */ };