Files
OpenCellular/chip/host/clock.c
Randall Spangler 193f2298bd Enforce a minimum number of clocks between keyboard scans
When the EC CPU is running at a decreased clock frequency, frequent
keyboard scans can starve other EC tasks of CPU and lead to dropped
data or watchdog timeouts.

Enforce a minimum number of EC clocks between keyboard scans to
prevent this from happening.  The default chosen (16000 clocks) is
equal to the shortest post-scan delay (1 ms) of any current board when
the AP is in S0, so this should have no effect when the AP is in S0.
When the AP is in S3 or S5, we don't need to scan the keyboard as
frequently anyway.  This can be overridden on a per-board basis for
future boards if needed.

BUG=chrome-os-partner:23247
BRANCH=pit
TEST=apshutdown, then hold down a key for 10 seconds.  Should not see a
     watchdog reset.

Change-Id: I228f53a32ad4769f6a137a9ab06903111bea115d
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/172895
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-10-14 23:27:31 +00:00

14 lines
284 B
C

/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Dummy clock driver for unit test.
*/
#include "clock.h"
int clock_get_freq(void)
{
return 16000000;
}