All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/2] sh: add kycr2_delay for sh_keysc
Date: Mon, 14 Sep 2009 13:02:01 +0000	[thread overview]
Message-ID: <20090914130200.GA21091@linux-sh.org> (raw)
In-Reply-To: <u1vm9g48g.wl%morimoto.kuninori@renesas.com>

On Mon, Sep 14, 2009 at 08:22:55PM +0900, Kuninori Morimoto wrote:
> 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 <morimoto.kuninori@renesas.com>
> ---
>  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 *

Shouldn't this be something like

	if (pdata->kycr2_delay)
		udelay(..)

it doesn't really make much sense to default to a udelay(0) for everyone.

      reply	other threads:[~2009-09-14 13:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 11:22 [PATCH 1/2] sh: add kycr2_delay for sh_keysc Kuninori Morimoto
2009-09-14 13:02 ` Paul Mundt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090914130200.GA21091@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.