From patchwork Tue Feb 16 10:48:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 79653 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1GAmcXg025308 for ; Tue, 16 Feb 2010 10:48:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751607Ab0BPKsh (ORCPT ); Tue, 16 Feb 2010 05:48:37 -0500 Received: from mail-yw0-f176.google.com ([209.85.211.176]:45090 "EHLO mail-yw0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494Ab0BPKsg (ORCPT ); Tue, 16 Feb 2010 05:48:36 -0500 Received: by ywh6 with SMTP id 6so4340274ywh.4 for ; Tue, 16 Feb 2010 02:48:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=VTK8Er6JIodLRkJ1pMTP+rxLAdET1IN52hdHMaI3d7M=; b=tDTb36BsMErKgJebjwG3dvTSg6soqy+hYZMxxxipp6YFkaUImYW+uilW+6G2+eqib8 1BcKZvajr78/7JC4F3cfyOhQub8BPB4lueyDLIEGH/hU3DIp4RxloSRCpC09J/fV8cII hE0L7Yk44Q94V6QvS8Sz38hSlU4bMpWnxfWVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=s0WSfOfcVOji1cleRMJ0OKhKFjFBeNLdx3aaifHzmn1vFIA0RONQfGqM7N54E4Z4ry KIEkyf8Rm5k4PBDdQVQ0LY8q4yYB3IcOCJP+cj2ZEK3oKELeJ1h0xXswavAmGffacOqt q8y6SQk6jM4vZd20V7UndUac+Jh+BB35FIJ4s= Received: by 10.150.47.19 with SMTP id u19mr11880837ybu.160.1266317315756; Tue, 16 Feb 2010 02:48:35 -0800 (PST) Received: from ?127.0.0.1? (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 20sm2676795yxe.38.2010.02.16.02.48.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Feb 2010 02:48:35 -0800 (PST) From: Magnus Damm To: lethal@linux-sh.org Cc: Magnus Damm , linux-sh@vger.kernel.org Date: Tue, 16 Feb 2010 19:48:15 +0900 Message-Id: <20100216104815.14455.317.sendpatchset@t400s> Subject: [PATCH] ARM: mach-shmobile: G3EVM KEYSC platform data Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 16 Feb 2010 10:48:38 +0000 (UTC) --- 0011/arch/arm/mach-shmobile/board-g3evm.c +++ work/arch/arm/mach-shmobile/board-g3evm.c 2010-02-10 19:52:39.000000000 +0900 @@ -29,6 +29,8 @@ #include #include #include +#include +#include #include #include #include @@ -127,9 +129,47 @@ static struct platform_device usb_host_d .resource = usb_host_resources, }; +/* KEYSC */ +static struct sh_keysc_info keysc_info = { + .mode = SH_KEYSC_MODE_5, + .scan_timing = 3, + .delay = 100, + .keycodes = { + KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, + KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, + KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, + KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP, + KEY_WAKEUP, KEY_COFFEE, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, + KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER, + }, +}; + +static struct resource keysc_resources[] = { + [0] = { + .name = "KEYSC", + .start = 0xe61b0000, + .end = 0xe61b000f, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 79, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device keysc_device = { + .name = "sh_keysc", + .num_resources = ARRAY_SIZE(keysc_resources), + .resource = keysc_resources, + .dev = { + .platform_data = &keysc_info, + }, +}; + static struct platform_device *g3evm_devices[] __initdata = { &nor_flash_device, &usb_host_device, + &keysc_device, }; static struct map_desc g3evm_io_desc[] __initdata = { @@ -196,6 +236,21 @@ static void __init g3evm_init(void) __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */ __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */ + /* KEYSC @ CN7 */ + gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL); + gpio_request(GPIO_FN_PORT43_KEYOUT1, NULL); + gpio_request(GPIO_FN_PORT44_KEYOUT2, NULL); + gpio_request(GPIO_FN_PORT45_KEYOUT3, NULL); + gpio_request(GPIO_FN_PORT46_KEYOUT4, NULL); + gpio_request(GPIO_FN_PORT47_KEYOUT5, NULL); + gpio_request(GPIO_FN_PORT48_KEYIN0_PU, NULL); + gpio_request(GPIO_FN_PORT49_KEYIN1_PU, NULL); + gpio_request(GPIO_FN_PORT50_KEYIN2_PU, NULL); + gpio_request(GPIO_FN_PORT55_KEYIN3_PU, NULL); + gpio_request(GPIO_FN_PORT56_KEYIN4_PU, NULL); + gpio_request(GPIO_FN_PORT57_KEYIN5_PU, NULL); + gpio_request(GPIO_FN_PORT58_KEYIN6_PU, NULL); + sh7367_add_standard_devices(); platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices)); --- 0011/arch/arm/mach-shmobile/clock-sh7367.c +++ work/arch/arm/mach-shmobile/clock-sh7367.c 2010-02-10 19:55:05.000000000 +0900 @@ -75,6 +75,11 @@ static struct clk usb0_clk = { .name = "usb0", }; +/* a static keysc0 clk for now - enough to get sh_keysc working */ +static struct clk keysc0_clk = { + .name = "keysc0", +}; + static struct clk_lookup lookups[] = { { .clk = &peripheral_clk, @@ -82,6 +87,8 @@ static struct clk_lookup lookups[] = { .clk = &r_clk, }, { .clk = &usb0_clk, + }, { + .clk = &keysc0_clk, } };