summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoy Cho <joy.cho@hardkernel.com>2020-03-25 05:08:27 +0300
committerGerrit Code Review <gerrit@almond.hardkernel.com>2020-03-25 05:08:27 +0300
commit494e6776629e386051677ed03f7929f1442cde87 (patch)
tree2c13bb979d05c2083d49814336273056e0813e71
parent365405f009fccbc7eae46ec4f7a42e02d25029b7 (diff)
parentae51fd674ffd31822a10bc8d021b01464275efaf (diff)
downloadu-boot-494e6776629e386051677ed03f7929f1442cde87.tar.xz
Merge "cmd: odroidtest: Update gpiokey auto test to support hw rev1.1" into odroidgo2-v2017.09
-rw-r--r--cmd/odroidtest.c18
-rw-r--r--cmd/odroidtest.h8
2 files changed, 17 insertions, 9 deletions
diff --git a/cmd/odroidtest.c b/cmd/odroidtest.c
index 7a41d3e15e..a7d54c2c36 100644
--- a/cmd/odroidtest.c
+++ b/cmd/odroidtest.c
@@ -255,7 +255,7 @@ static int do_odroidtest_lcd(cmd_tbl_t * cmdtp, int flag,
return ret;
}
-void btn_draw_key_arrays(void)
+void btn_draw_key_arrays(int numkeys)
{
int i;
@@ -265,7 +265,7 @@ void btn_draw_key_arrays(void)
lcd_setfg_color("white");
lcd_printf(0, 1, 1, "[ GPIO KEY TEST ]");
- for (i = 0; i < NUMGPIOKEYS; i++) {
+ for (i = 0; i < numkeys; i++) {
if (gpiokeys[i].chk)
lcd_setfg_color("blue");
else
@@ -310,15 +310,21 @@ void btn_set_default(void)
static int do_odroidtest_btn(cmd_tbl_t * cmdtp, int flag,
int argc, char * const argv[])
{
- int key;
+ int key, numkeys;
+ const char *hwrev = env_get("hwrev");
- btn_draw_key_arrays();
+ if (hwrev && !strcmp(hwrev, "v11"))
+ numkeys = NUMGPIOKEYS;
+ else
+ numkeys = NUMGPIOKEYS - 2;
+
+ btn_draw_key_arrays(numkeys);
mdelay(2000);
- while (btn_passed < NUMGPIOKEYS) {
+ while (btn_passed < numkeys) {
key = wait_key_event();
if (btn_update_key_status(key))
- btn_draw_key_arrays();
+ btn_draw_key_arrays(numkeys);
printf("key 0x%x, passed %d\n", key, btn_passed);
}
diff --git a/cmd/odroidtest.h b/cmd/odroidtest.h
index 471aee64ea..1558beb777 100644
--- a/cmd/odroidtest.h
+++ b/cmd/odroidtest.h
@@ -15,7 +15,7 @@
#include <odroidgo2_status.h>
#include <rockchip_display_cmds.h>
-#define NUMGPIOKEYS 16
+#define NUMGPIOKEYS 18
struct key_arrays {
const char * name;
@@ -40,8 +40,10 @@ struct key_arrays gpiokeys[NUMGPIOKEYS] = {
{"[sw12]", BTN_TRIGGER_HAPPY4, 240, 15, 0},
{"[sw13]", BTN_TRIGGER_HAPPY5, 334, 15, 0},
{"[sw14]", BTN_TRIGGER_HAPPY6, 384, 15, 0},
- {"[sw15]", BTN_TL, 48, 3, 0},
- {"[sw16]", BTN_TR, 384, 3, 0},
+ {"[sw15]", BTN_TL, 48, 5, 0},
+ {"[sw16]", BTN_TR, 384, 5, 0},
+ {"[sw20]", BTN_TR2, 384, 3, 0},
+ {"[sw21]", BTN_TL2, 48, 3, 0},
};
struct key_arrays adckeys[4] = {