summaryrefslogtreecommitdiff
path: root/test/scancode.py
blob: 6437e24e595f4724b2613e7602b18b15315d0cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 !