summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoy Cho <joy.cho@hardkernel.com>2020-12-03 12:41:46 +0300
committerJoy Cho <joy.cho@hardkernel.com>2020-12-05 08:59:23 +0300
commita1b59905a4554055f35196e17301bf83cbe41b5f (patch)
tree61353f49f202d3e3e5c4c3e423d6c74e6b6969f4
parent3113f3c523493f65824c543d024d489ab20b890b (diff)
downloadu-boot-a1b59905a4554055f35196e17301bf83cbe41b5f.tar.xz
cmd: odroidtest: Fix key check errors
Change-Id: Iab7820c0e4bb0bd0a882366a7de2503934dcee5a (cherry picked from commit b5c70965a785933a03babd6edf5fb365ef62d57a)
-rw-r--r--cmd/odroidtest.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/cmd/odroidtest.c b/cmd/odroidtest.c
index a7f1021407..fb9b99af89 100644
--- a/cmd/odroidtest.c
+++ b/cmd/odroidtest.c
@@ -18,7 +18,12 @@ int wait_key_event(bool timeout)
struct udevice *dev;
struct dm_key_uclass_platdata *key;
int evt;
- unsigned int cnt = 15;
+ unsigned int cnt;
+
+ if (is_odroidgo3())
+ cnt = NUMGPIOKEYS_GO3;
+ else
+ cnt = NUMGPIOKEYS_GO2;
while (!ctrlc()) {
for (uclass_first_device(UCLASS_KEY, &dev);
@@ -736,10 +741,10 @@ static int do_odroidtest_btn(cmd_tbl_t * cmdtp, int flag,
numkeys = NUMGPIOKEYS_GO3;
gpiokeys = gpiokeys_go3;
} else {
- if (hwrev && !strcmp(hwrev, "v10"))
- numkeys = NUMGPIOKEYS_GO2 - 2;
- else
+ if (hwrev && !strcmp(hwrev, "v11"))
numkeys = NUMGPIOKEYS_GO2;
+ else
+ numkeys = NUMGPIOKEYS_GO2 - 2;
gpiokeys = gpiokeys_go2;
}