From patchwork Sat Oct 3 15:02:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiangfu Liu X-Patchwork-Id: 51535 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n93F3Q77010524 for ; Sat, 3 Oct 2009 15:03:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751163AbZJCPDH (ORCPT ); Sat, 3 Oct 2009 11:03:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753891AbZJCPDH (ORCPT ); Sat, 3 Oct 2009 11:03:07 -0400 Received: from mail-yw0-f176.google.com ([209.85.211.176]:63204 "EHLO mail-yw0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbZJCPDF (ORCPT ); Sat, 3 Oct 2009 11:03:05 -0400 Received: by ywh6 with SMTP id 6so1309584ywh.4 for ; Sat, 03 Oct 2009 08:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=FSJMwXcych5HmISmhXnITPHhXuN7+PaDcMcU4g3m9co=; b=o0IM3/Cz+gugkluvjcnh9yaig400BE4duNR9+u8PqiJhMgoR/erttPrFod2JsloLCT xf6f9lKyEidmOEvA6+T3nde066l2Iz65p/ZXPh3JIYNrPJs/8h4zbTS1rcFXNsOa6MWP amr6Q5HK6rLdQur/P+wjXpGWMgvUvcbdkd0vk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=gfNlPd1B3AMki6Gbp1+xx1epqpadCx2jvRuN493yqjkqerJ6XFOOCzRi2I2KGTTQaf cHELVTmwktppB10ezWT9jtlaHNKTXqHw0dzLERp140RbgrkEealH/6qLR0ZQdWK6bpm4 fFNUM0/M8Y/zZXaBX/kA9XXFzg54yzGZ0pY7E= MIME-Version: 1.0 Received: by 10.90.22.2 with SMTP id 2mr2198886agv.104.1254582147637; Sat, 03 Oct 2009 08:02:27 -0700 (PDT) Date: Sat, 3 Oct 2009 23:02:27 +0800 Message-ID: Subject: From: xiangfu liu To: linux-input@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/arch/mips/include/asm/mach-jz4740/board-qi_lb60.h b/arch/mips/include/asm/mach-jz4740/board-qi_lb60.h index 2c3260f..aa461bd 100644 --- a/arch/mips/include/asm/mach-jz4740/board-qi_lb60.h +++ b/arch/mips/include/asm/mach-jz4740/board-qi_lb60.h @@ -35,6 +35,7 @@ #define GPIO_LCD_CS JZ_GPIO_PORTC(21) #define GPIO_DISP_OFF_N JZ_GPIO_PORTD(21) #define GPIO_PWM JZ_GPIO_PORTD(27) +#define GPIO_WAKEUP_N JZ_GPIO_PORTD(29) #define GPIO_AMP_EN JZ_GPIO_PORTD(4) diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c index 127fad8..c6ef60c 100644 --- a/arch/mips/jz4740/board-qi_lb60.c +++ b/arch/mips/jz4740/board-qi_lb60.c @@ -97,6 +97,7 @@ static void __init board_gpio_setup(void) __gpio_as_input(GPIO_DC_DETE_N); __gpio_as_input(GPIO_CHARG_STAT_N); + __gpio_as_input(GPIO_WAKEUP_N); } void __init jz_board_setup(void) diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c index dc7a832..16a0008 100644 --- a/arch/mips/jz4740/platform.c +++ b/arch/mips/jz4740/platform.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -492,6 +494,30 @@ static struct platform_device batt_gpio_device = { }, }; +/* GPIO Key: power */ +static const struct gpio_keys_button qi_lb60_gpio_keys_buttons[] = { + [0] = { + .code = KEY_POWER, + .gpio = GPIO_WAKEUP_N, + .active_low = 1, + .desc = "power button", + }, +}; + +static const struct gpio_keys_platform_data qi_lb60_gpio_keys_data = { + .nbuttons = ARRAY_SIZE(qi_lb60_gpio_keys_buttons), + .buttons = qi_lb60_gpio_keys_buttons, +}; + +static struct platform_device qi_lb60_gpio_keys = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = (void *) &qi_lb60_gpio_keys_data, + } +}; + + /* All */ static struct platform_device *jz_platform_devices[] __initdata = { &jz_usb_ohci_device, @@ -506,6 +532,7 @@ static struct platform_device *jz_platform_devices[] __initdata = { &jz_codec_device, &jz_rtc_device, &batt_gpio_device, + &qi_lb60_gpio_keys, }; static int __init jz_platform_init(void)