From patchwork Tue Sep 15 00:21:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 47552 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 n8F0LfUk016783 for ; Tue, 15 Sep 2009 00:21:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754230AbZIOAVh (ORCPT ); Mon, 14 Sep 2009 20:21:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757334AbZIOAVh (ORCPT ); Mon, 14 Sep 2009 20:21:37 -0400 Received: from mail.renesas.com ([202.234.163.13]:65169 "EHLO mail03.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754230AbZIOAVg (ORCPT ); Mon, 14 Sep 2009 20:21:36 -0400 X-AuditID: ac140386-0000000600003037-3d-4aaede1202be Received: from guardian02.idc.renesas.com ([172.20.8.201]) by mail03.idc.renesas.com (sendmail) with ESMTP id n8F0LbG7021393; Tue, 15 Sep 2009 09:21:37 +0900 (JST) Received: (from root@localhost) by guardian02.idc.renesas.com with id n8F0Lb9I023744; Tue, 15 Sep 2009 09:21:37 +0900 (JST) Received: from mta03.idc.renesas.com (localhost [127.0.0.1]) by mta03.idc.renesas.com with ESMTP id n8F0Lcl9021279; Tue, 15 Sep 2009 09:21:38 +0900 (JST) Received: from PG10870.renesas.com ([172.30.8.159]) by ims05.idc.renesas.com (Sendmail) with ESMTPA id <0KPZ007MUKZY5D@ims05.idc.renesas.com>; Tue, 15 Sep 2009 09:21:37 +0900 (JST) Date: Tue, 15 Sep 2009 09:21:34 +0900 From: Kuninori Morimoto Subject: [PATCH 1/2 v2] 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 --- v1 -> v2 add if (pdata->kycr2_delay) arch/sh/include/asm/sh_keysc.h | 1 + drivers/input/keyboard/sh_keysc.c | 3 +++ 2 files changed, 4 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..68fd502 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -80,6 +80,9 @@ static irqreturn_t sh_keysc_isr(int irq, void *dev_id) iowrite16(KYCR2_IRQ_LEVEL | (keyin_set << 8), priv->iomem_base + KYCR2_OFFS); + if (pdata->kycr2_delay) + udelay(pdata->kycr2_delay); + keys ^= ~0; keys &= (1 << (sh_keysc_mode[pdata->mode].keyin * sh_keysc_mode[pdata->mode].keyout)) - 1;