diff options
author | Rakesh Iyer <riyer@nvidia.com> | 2011-08-02 10:58:00 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:23 -0700 |
commit | b4a3fbea1f1496c1600caff4b043530f3178f291 (patch) | |
tree | e5eb3ba8cb1163803449ad560833162d904aa996 /drivers/input/tegra-kbc.c | |
parent | 99cb162b68d816852b4240eb2a147cb60e4462f3 (diff) |
Tegra: kbc: Modify defines for clarity
Use the correct constant names and definition.
BUG=None.
TEST=Built and tested on Seaboard.
Change-Id: I22eb83e9055d74d30760dd351377b55697652382
Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/5148
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/input/tegra-kbc.c')
-rwxr-xr-x | drivers/input/tegra-kbc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/tegra-kbc.c b/drivers/input/tegra-kbc.c index f8e813a63f2..0ddf07b32ee 100755 --- a/drivers/input/tegra-kbc.c +++ b/drivers/input/tegra-kbc.c @@ -48,7 +48,7 @@ enum { #define KBC_ROW_SCAN_DLY 5 /* uses a 32KHz clock so a cycle = 1/32Khz */ -#define KBC_CYCLE_USEC 32 +#define KBC_CYCLE_IN_USEC DIV_ROUND_UP(1000, 32) #define KBC_FIFO_TH_CNT_SHIFT(cnt) (cnt << 14) #define KBC_DEBOUNCE_CNT_SHIFT(cnt) (cnt << 4) @@ -491,11 +491,11 @@ static int tegra_kbc_open(void) * the rows. There is an additional delay before the row scanning * starts. The repoll delay is computed in microseconds. */ - rpt_cnt = 5 * (1000 / KBC_CYCLE_USEC); + rpt_cnt = 5 * DIV_ROUND_UP(1000, KBC_CYCLE_IN_USEC); debounce_cnt = 2; scan_time_rows = (KBC_ROW_SCAN_TIME + debounce_cnt) * KBC_MAX_ROW; kbc_repoll_time = KBC_ROW_SCAN_DLY + scan_time_rows + rpt_cnt; - kbc_repoll_time = (kbc_repoll_time * KBC_CYCLE_USEC) + 999; + kbc_repoll_time = kbc_repoll_time * KBC_CYCLE_IN_USEC; writel(rpt_cnt, &kbc->rpt_dly); @@ -506,7 +506,7 @@ static int tegra_kbc_open(void) writel(val, &kbc->control); - kbc_init_dly = readl(&kbc->init_dly) * (1000 / KBC_CYCLE_USEC); + kbc_init_dly = readl(&kbc->init_dly) * KBC_CYCLE_IN_USEC; kbc_start_time = timer_get_us(); return 0; |