* [PATCH v1] Input: tegra-kbc - fix computation of polling time
@ 2011-07-29 23:16 riyer
2011-07-30 10:41 ` Thierry Reding
0 siblings, 1 reply; 4+ messages in thread
From: riyer @ 2011-07-29 23:16 UTC (permalink / raw)
To: dmitry.torokhov
Cc: rydberg, olof, amartin, linux-kernel, linux-input, Rakesh Iyer
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;
input_dev->name = pdev->name;
input_dev->id.bustype = BUS_HOST;
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] Input: tegra-kbc - fix computation of polling time
2011-07-29 23:16 [PATCH v1] Input: tegra-kbc - fix computation of polling time riyer
@ 2011-07-30 10:41 ` Thierry Reding
2011-07-30 19:02 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2011-07-30 10:41 UTC (permalink / raw)
To: riyer; +Cc: dmitry.torokhov, rydberg, olof, amartin, linux-kernel,
linux-input
[-- 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 --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] Input: tegra-kbc - fix computation of polling time
2011-07-30 10:41 ` Thierry Reding
@ 2011-07-30 19:02 ` Dmitry Torokhov
2011-08-02 16:50 ` Rakesh Iyer
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2011-07-30 19:02 UTC (permalink / raw)
To: Thierry Reding; +Cc: riyer, rydberg, olof, amartin, linux-kernel, linux-input
On Sat, Jul 30, 2011 at 12:41:01PM +0200, Thierry Reding wrote:
> * 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.
Indeed. Adjusted locally and applied.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v1] Input: tegra-kbc - fix computation of polling time
2011-07-30 19:02 ` Dmitry Torokhov
@ 2011-08-02 16:50 ` Rakesh Iyer
0 siblings, 0 replies; 4+ messages in thread
From: Rakesh Iyer @ 2011-08-02 16:50 UTC (permalink / raw)
To: 'Dmitry Torokhov', Thierry Reding
Cc: rydberg@euromail.se, olof@lixom.net, Allen Martin,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Thanks Dmitry and Thierry.
Regards
Rakesh
> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: Saturday, July 30, 2011 12:02 PM
> To: Thierry Reding
> Cc: Rakesh Iyer; rydberg@euromail.se; olof@lixom.net; Allen Martin; linux-
> kernel@vger.kernel.org; linux-input@vger.kernel.org
> Subject: Re: [PATCH v1] Input: tegra-kbc - fix computation of polling time
>
> On Sat, Jul 30, 2011 at 12:41:01PM +0200, Thierry Reding wrote:
> > * 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.
>
> Indeed. Adjusted locally and applied.
>
> Thanks.
>
> --
> Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-02 16:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-29 23:16 [PATCH v1] Input: tegra-kbc - fix computation of polling time riyer
2011-07-30 10:41 ` Thierry Reding
2011-07-30 19:02 ` Dmitry Torokhov
2011-08-02 16:50 ` Rakesh Iyer
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).