linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: riyer@nvidia.com
Cc: dmitry.torokhov@gmail.com, rydberg@euromail.se, olof@lixom.net,
	amartin@nvidia.com, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v1] Input: tegra-kbc - fix computation of polling time
Date: Sat, 30 Jul 2011 12:41:01 +0200	[thread overview]
Message-ID: <20110730104101.GA12309@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1311981417-31865-1-git-send-email-riyer@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

* riyer@nvidia.com wrote:
> From: Rakesh Iyer <riyer@nvidia.com>
> 
> Fix a constant definition and computation of polling time.
> 
> Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
> ---
>  drivers/input/keyboard/tegra-kbc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
> index da3828f..263f6fc 100644
> --- a/drivers/input/keyboard/tegra-kbc.c
> +++ b/drivers/input/keyboard/tegra-kbc.c
> @@ -37,7 +37,7 @@
>  #define KBC_ROW_SCAN_DLY	5
>  
>  /* KBC uses a 32KHz clock so a cycle = 1/32Khz */
> -#define KBC_CYCLE_USEC	32
> +#define KBC_CYCLE_MS	32
>  
>  /* KBC Registers */
>  
> @@ -647,7 +647,7 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
>  	debounce_cnt = min(pdata->debounce_cnt, KBC_MAX_DEBOUNCE_CNT);
>  	scan_time_rows = (KBC_ROW_SCAN_TIME + debounce_cnt) * num_rows;
>  	kbc->repoll_dly = KBC_ROW_SCAN_DLY + scan_time_rows + pdata->repeat_cnt;
> -	kbc->repoll_dly = ((kbc->repoll_dly * KBC_CYCLE_USEC) + 999) / 1000;
> +	kbc->repoll_dly = (kbc->repoll_dly + KBC_CYCLE_MS - 1) / KBC_CYCLE_MS;

You might want to consider using DIV_ROUND_UP for this.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-07-30 10:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29 23:16 [PATCH v1] Input: tegra-kbc - fix computation of polling time riyer
2011-07-30 10:41 ` Thierry Reding [this message]
2011-07-30 19:02   ` Dmitry Torokhov
2011-08-02 16:50     ` Rakesh Iyer

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=20110730104101.GA12309@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=amartin@nvidia.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=riyer@nvidia.com \
    --cc=rydberg@euromail.se \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).