summaryrefslogtreecommitdiff
path: root/board/k+p/kp_imx53
diff options
context:
space:
mode:
authorLukasz Majewski <lukma@denx.de>2018-05-20 08:33:16 +0200
committerStefano Babic <sbabic@denx.de>2018-06-18 16:42:04 +0200
commit0b35b2d11774fadd48b9492bacd89a9757965ecc (patch)
tree8e4fcbcea792efcc702306efd3d484febcd315a3 /board/k+p/kp_imx53
parent5ca614cae9ae8bef1bdd0c4621717d1598f50c21 (diff)
board: Add support for KEY1 status detection on K+P's HSC|DDC boards
This code provides information if the K+P's imx53 boards had KEY1 pressed. Signed-off-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'board/k+p/kp_imx53')
-rw-r--r--board/k+p/kp_imx53/kp_imx53.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/board/k+p/kp_imx53/kp_imx53.c b/board/k+p/kp_imx53/kp_imx53.c
index 6b0db6b8de..7e947fb617 100644
--- a/board/k+p/kp_imx53/kp_imx53.c
+++ b/board/k+p/kp_imx53/kp_imx53.c
@@ -23,6 +23,7 @@
#define PHY_nRST IMX_GPIO_NR(7, 6)
#define BOOSTER_OFF IMX_GPIO_NR(2, 23)
#define LCD_BACKLIGHT IMX_GPIO_NR(1, 1)
+#define KEY1 IMX_GPIO_NR(2, 26)
DECLARE_GLOBAL_DATA_PTR;
@@ -196,6 +197,17 @@ void board_disable_display(void)
gpio_direction_output(LCD_BACKLIGHT, 0);
}
+void board_misc_setup(void)
+{
+ gpio_request(KEY1, "KEY1_GPIO");
+ gpio_direction_input(KEY1);
+
+ if (gpio_get_value(KEY1))
+ env_set("key1", "off");
+ else
+ env_set("key1", "on");
+}
+
int board_late_init(void)
{
int ret = 0;
@@ -215,5 +227,7 @@ int board_late_init(void)
show_eeprom();
read_board_id();
+ board_misc_setup();
+
return ret;
}