From patchwork Mon Sep 14 11:22:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 47289 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 n8EBMwqQ008020 for ; Mon, 14 Sep 2009 11:22:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbZINLWy (ORCPT ); Mon, 14 Sep 2009 07:22:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755305AbZINLWy (ORCPT ); Mon, 14 Sep 2009 07:22:54 -0400 Received: from mail.renesas.com ([202.234.163.13]:34428 "EHLO mail02.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755302AbZINLWx (ORCPT ); Mon, 14 Sep 2009 07:22:53 -0400 X-AuditID: ac140385-00000006000002de-c6-4aae278f37f7 Received: from guardian01.idc.renesas.com ([172.20.8.200]) by mail02.idc.renesas.com (sendmail) with ESMTP id n8EBMsZU006118; Mon, 14 Sep 2009 20:22:55 +0900 (JST) Received: (from root@localhost) by guardian01.idc.renesas.com with id n8EBMu88024412; Mon, 14 Sep 2009 20:22:56 +0900 (JST) Received: from mta04.idc.renesas.com (localhost [127.0.0.1]) by mta04.idc.renesas.com with ESMTP id n8EBMtwE029165; Mon, 14 Sep 2009 20:22:55 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KPY00I1KKY7LN@ims05.idc.renesas.com>; Mon, 14 Sep 2009 20:22:55 +0900 (JST) Date: Mon, 14 Sep 2009 20:22:55 +0900 From: Kuninori Morimoto Subject: [PATCH 1/2] sh: add kycr2_delay for sh_keysc To: SH-Linux Cc: Paul Mundt Message-id: MIME-version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-type: text/plain; charset=US-ASCII User-Agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.7 Emacs/22.1 (i386-mingw-nt5.1.2600) MULE/5.0 (SAKAKI) Meadow/3.00-dev (KIKU) X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org After KYCR2 is set, udelay might become necessary when the connected KEY is few. This patch add kycr2_delay for this problem. Signed-off-by: Kuninori Morimoto --- arch/sh/include/asm/sh_keysc.h | 1 + drivers/input/keyboard/sh_keysc.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/sh/include/asm/sh_keysc.h b/arch/sh/include/asm/sh_keysc.h index b5a4dd5..4a65b1e 100644 --- a/arch/sh/include/asm/sh_keysc.h +++ b/arch/sh/include/asm/sh_keysc.h @@ -7,6 +7,7 @@ struct sh_keysc_info { enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode; int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ int delay; + int kycr2_delay; int keycodes[SH_KEYSC_MAXKEYS]; }; diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index cea70e6..2080f60 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -79,6 +79,7 @@ static irqreturn_t sh_keysc_isr(int irq, void *dev_id) iowrite16(0, priv->iomem_base + KYOUTDR_OFFS); iowrite16(KYCR2_IRQ_LEVEL | (keyin_set << 8), priv->iomem_base + KYCR2_OFFS); + udelay(pdata->kycr2_delay); keys ^= ~0; keys &= (1 << (sh_keysc_mode[pdata->mode].keyin *