From patchwork Wed Jul 22 16:23:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 36861 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 n6MGRk3H025416 for ; Wed, 22 Jul 2009 16:27:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752936AbZGVQ1p (ORCPT ); Wed, 22 Jul 2009 12:27:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753039AbZGVQ1p (ORCPT ); Wed, 22 Jul 2009 12:27:45 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:9889 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752933AbZGVQ1o (ORCPT ); Wed, 22 Jul 2009 12:27:44 -0400 Received: by fg-out-1718.google.com with SMTP id e12so940531fga.17 for ; Wed, 22 Jul 2009 09:27:44 -0700 (PDT) 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=UIS4Cp+kEZXNqxP3hJCaTPupARxzy63z/KomLcbkhVQ=; b=Kvcwn03fmzg8Z3A8hPS01SqaxPKWq2EnHfbSkEVvNKBHcwKMKG2R27AEG7mc+mpY+O nWbedMxsZhHorHKWEumSJrHRi1VrvoEwYF/lINiGjiGcD7Lh7Ei6N/9kQcal1Q/6BSAh okTdQ5qTrCxOQ3YJoShahGoYatoojwFrXsqlk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=X6ddzN2VIqLeADD4Ygl3/m4f6HZBmC9MB2VZJx4JQKyzvoMGTbgckQ3Irm/SK0T38P UfugvshiYXuLNERwkyXhitzdZMDGrEtdItGQbmV9dPdIKVexujYtB7U76gF6s+XXrX00 ehxnX2uLQXblV9FdIhOSnwL1c6LGLVx/XgeWE= Received: by 10.86.3.5 with SMTP id 5mr971001fgc.41.1248280063835; Wed, 22 Jul 2009 09:27:43 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id l12sm16817854fgb.8.2009.07.22.09.27.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Jul 2009 09:27:43 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 23 Jul 2009 01:23:45 +0900 Message-Id: <20090722162345.18191.55193.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: kfr2r09 board support - KEYSC keypad Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch adds KEYSC keypad support to the kfr2r09 board. The keys driven by the sh7724 on-chip KEYSC block are described as a platform device and platform data for the sh_keysc driver. Signed-off-by: Magnus Damm --- Applies on top of the NOR flash patch. arch/sh/boards/mach-kfr2r09/setup.c | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0010/arch/sh/boards/mach-kfr2r09/setup.c +++ work/arch/sh/boards/mach-kfr2r09/setup.c 2009-07-23 00:40:01.000000000 +0900 @@ -14,9 +14,11 @@ #include #include #include +#include #include #include #include +#include #include static struct mtd_partition kfr2r09_nor_flash_partitions[] = @@ -58,8 +60,46 @@ static struct platform_device kfr2r09_no }, }; +static struct sh_keysc_info kfr2r09_sh_keysc_info = { + .mode = SH_KEYSC_MODE_1, /* KEYOUT0->4, KEYIN0->4 */ + .scan_timing = 3, + .delay = 10, + .keycodes = { + KEY_PHONE, KEY_CLEAR, KEY_MAIL, KEY_WWW, KEY_ENTER, + KEY_1, KEY_2, KEY_3, 0, KEY_UP, + KEY_4, KEY_5, KEY_6, 0, KEY_LEFT, + KEY_7, KEY_8, KEY_9, KEY_PROG1, KEY_RIGHT, + KEY_S, KEY_0, KEY_P, KEY_PROG2, KEY_DOWN, + 0, 0, 0, 0, 0 + }, +}; + +static struct resource kfr2r09_sh_keysc_resources[] = { + [0] = { + .name = "KEYSC", + .start = 0x044b0000, + .end = 0x044b000f, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 79, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device kfr2r09_sh_keysc_device = { + .name = "sh_keysc", + .id = 0, /* "keysc0" clock */ + .num_resources = ARRAY_SIZE(kfr2r09_sh_keysc_resources), + .resource = kfr2r09_sh_keysc_resources, + .dev = { + .platform_data = &kfr2r09_sh_keysc_info, + }, +}; + static struct platform_device *kfr2r09_devices[] __initdata = { &kfr2r09_nor_flash_device, + &kfr2r09_sh_keysc_device, }; #define BSC_CS0BCR 0xfec10004 @@ -75,6 +115,19 @@ static int __init kfr2r09_devices_setup( ctrl_outl(0x36db0400, BSC_CS0BCR); ctrl_outl(0x00000500, BSC_CS0WCR); + /* setup KEYSC pins */ + gpio_request(GPIO_FN_KEYOUT0, NULL); + gpio_request(GPIO_FN_KEYOUT1, NULL); + gpio_request(GPIO_FN_KEYOUT2, NULL); + gpio_request(GPIO_FN_KEYOUT3, NULL); + gpio_request(GPIO_FN_KEYOUT4_IN6, NULL); + gpio_request(GPIO_FN_KEYIN0, NULL); + gpio_request(GPIO_FN_KEYIN1, NULL); + gpio_request(GPIO_FN_KEYIN2, NULL); + gpio_request(GPIO_FN_KEYIN3, NULL); + gpio_request(GPIO_FN_KEYIN4, NULL); + gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); + return platform_add_devices(kfr2r09_devices, ARRAY_SIZE(kfr2r09_devices)); }