From patchwork Fri Jul 29 23:16:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: riyer@nvidia.com X-Patchwork-Id: 1021952 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6TNHBgP027276 for ; Fri, 29 Jul 2011 23:17:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135Ab1G2XQ7 (ORCPT ); Fri, 29 Jul 2011 19:16:59 -0400 Received: from hqemgate03.nvidia.com ([216.228.121.140]:13871 "EHLO hqemgate03.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753073Ab1G2XQ6 (ORCPT ); Fri, 29 Jul 2011 19:16:58 -0400 Received: from hqnvupgp06.nvidia.com (Not Verified[216.228.121.13]) by hqemgate03.nvidia.com id ; Fri, 29 Jul 2011 16:27:35 -0700 Received: from hqnvemgw02.nvidia.com ([172.17.108.22]) by hqnvupgp06.nvidia.com (PGP Universal service); Fri, 29 Jul 2011 16:16:57 -0700 X-PGP-Universal: processed; by hqnvupgp06.nvidia.com on Fri, 29 Jul 2011 16:16:57 -0700 Received: from thelma.nvidia.com (Not Verified[172.16.212.77]) by hqnvemgw02.nvidia.com with MailMarshal (v6, 7, 2, 8378) id ; Fri, 29 Jul 2011 16:16:57 -0700 Received: from riyer-desktop.nvidia.com (dhcp-172-17-150-5.nvidia.com [172.17.150.5]) by thelma.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id p6TNGuhD007046; Fri, 29 Jul 2011 16:16:57 -0700 (PDT) From: riyer@nvidia.com To: dmitry.torokhov@gmail.com Cc: rydberg@euromail.se, olof@lixom.net, amartin@nvidia.com, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Rakesh Iyer Subject: [PATCH v1] Input: tegra-kbc - fix computation of polling time Date: Fri, 29 Jul 2011 16:16:57 -0700 Message-Id: <1311981417-31865-1-git-send-email-riyer@nvidia.com> X-Mailer: git-send-email 1.7.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 29 Jul 2011 23:17:12 +0000 (UTC) From: Rakesh Iyer Fix a constant definition and computation of polling time. Signed-off-by: Rakesh Iyer --- 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;