summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2012-06-26 15:30:57 +0800
committerGerrit <chrome-bot@google.com>2012-06-27 00:55:04 -0700
commit8b3634ee1f5adc581646edd89309362897a0978b (patch)
tree0f650a774347a1426f46d498b3ad033da51a5a03 /test
parent240470a54b234704bd77f9485e06af5fc41d52d2 (diff)
downloadchrome-ec-8b3634ee1f5adc581646edd89309362897a0978b.tar.gz
Add a test of i8042 scancode set
This test check correct scan code is sent when I8042_XLATE is enabled or disabled. BUG=chrome-os-partner:10286 TEST=Test passed Change-Id: I939963cbecddb22506e64cb374667c7c2e5b4f8b Reviewed-on: https://gerrit.chromium.org/gerrit/26096 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/build.mk6
-rw-r--r--test/scancode.py29
-rw-r--r--test/scancode.tasklist25
3 files changed, 59 insertions, 1 deletions
diff --git a/test/build.mk b/test/build.mk
index 87a8a11d39..f5a5548133 100644
--- a/test/build.mk
+++ b/test/build.mk
@@ -7,7 +7,7 @@
#
test-list=hello pingpong timer_calib timer_dos timer_jump mutex thermal
-test-list+=power_button kb_deghost
+test-list+=power_button kb_deghost scancode
#disable: powerdemo
pingpong-y=pingpong.o
@@ -31,3 +31,7 @@ common-mock-power_button-i8042.o=mock_i8042.o
# Mock modules for 'kb_deghost'
chip-mock-kb_deghost-keyboard_scan_stub.o=mock_keyboard_scan_stub.o
common-mock-kb_deghost-i8042.o=mock_i8042.o
+
+# Mock modules for 'scancode'
+chip-mock-scancode-keyboard_scan_stub.o=mock_keyboard_scan_stub.o
+common-mock-scancode-i8042.o=mock_i8042.o
diff --git a/test/scancode.py b/test/scancode.py
new file mode 100644
index 0000000000..6437e24e59
--- /dev/null
+++ b/test/scancode.py
@@ -0,0 +1,29 @@
+# Copyright (c) 2012 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.
+#
+# i8042 scancode test
+#
+
+def test(helper):
+ # Wait for EC initialized
+ helper.wait_output("--- UART initialized")
+
+ # Disable typematic
+ helper.ec_command("typematic 1000000 1000000")
+
+ # Enable XLATE (Scan code set 1)
+ helper.ec_command("ctrlram 0 0x40")
+ helper.ec_command("mockmatrix 1 1 1")
+ helper.wait_output("i8042 SEND: 01") # make code
+ helper.ec_command("mockmatrix 1 1 0")
+ helper.wait_output("i8042 SEND: 81") # break code
+
+ # Disable XLATE (Scan code set 2)
+ helper.ec_command("ctrlram 0 0x00")
+ helper.ec_command("mockmatrix 1 1 1")
+ helper.wait_output("i8042 SEND: 76") # make code
+ helper.ec_command("mockmatrix 1 1 0")
+ helper.wait_output("i8042 SEND: f0 76") # break code
+
+ return True # PASS !
diff --git a/test/scancode.tasklist b/test/scancode.tasklist
new file mode 100644
index 0000000000..996cceeacb
--- /dev/null
+++ b/test/scancode.tasklist
@@ -0,0 +1,25 @@
+/* Copyright (c) 2012 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.
+ */
+
+/**
+ * List of enabled tasks in the priority order
+ *
+ * The first one has the lowest priority.
+ *
+ * For each task, use the macro TASK(n, r, d) where :
+ * 'n' in the name of the task
+ * 'r' in the main routine of the task
+ * 'd' in an opaque parameter passed to the routine at startup
+ */
+#define CONFIG_TASK_LIST \
+ TASK(WATCHDOG, watchdog_task, NULL) \
+ TASK(VBOOTHASH, vboot_hash_task, NULL) \
+ TASK(PWM, pwm_task, NULL) \
+ TASK(TYPEMATIC, keyboard_typematic_task, NULL) \
+ TASK(X86POWER, x86_power_task, NULL) \
+ TASK(I8042CMD, i8042_command_task, NULL) \
+ TASK(KEYSCAN, keyboard_scan_task, NULL) \
+ TASK(POWERBTN, power_button_task, NULL) \
+ TASK(CONSOLE, console_task, NULL)