summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Majewski <lukma@denx.de>2019-09-03 16:38:49 +0200
committerStefano Babic <sbabic@denx.de>2019-10-08 16:36:36 +0200
commitfeeff1567f1e98775b1b0070b106ecc09059ecc1 (patch)
tree12c5496f83fa960ceab38c019e58b423bbf21ef5
parent5ec7d1b49566a686aa7c40280a526ab0401c1092 (diff)
imx: Convert emergency pad of display5 to use dm_gpio* functions
After this change the display5's emergency gpio use dm_gpio* functions instead of legacy ones (gpio*) to read its state. Signed-off-by: Lukasz Majewski <lukma@denx.de>
-rw-r--r--board/liebherr/display5/display5.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/board/liebherr/display5/display5.c b/board/liebherr/display5/display5.c
index 5713401ed9..b8dcd03fd9 100644
--- a/board/liebherr/display5/display5.c
+++ b/board/liebherr/display5/display5.c
@@ -36,7 +36,6 @@ static bool sw_ids_valid;
static u32 cpu_id;
static u32 unit_id;
-#define EM_PAD IMX_GPIO_NR(3, 29)
#define SW0 IMX_GPIO_NR(2, 4)
#define SW1 IMX_GPIO_NR(2, 5)
#define SW2 IMX_GPIO_NR(2, 6)
@@ -236,21 +235,24 @@ static inline void setup_boot_modes(void) {}
int misc_init_r(void)
{
+ struct gpio_desc em_pad;
int ret;
setup_boot_modes();
- ret = gpio_request(EM_PAD, "Emergency_PAD");
+ ret = dm_gpio_lookup_name("GPIO3_29", &em_pad);
if (ret) {
- printf("Can't request emergency PAD gpio\n");
+ printf("Can't find emergency PAD gpio\n");
return ret;
}
- ret = gpio_direction_input(EM_PAD);
+ ret = dm_gpio_request(&em_pad, "Emergency_PAD");
if (ret) {
- printf("Can't set emergency PAD direction\n");
+ printf("Can't request emergency PAD gpio\n");
return ret;
}
+ dm_gpio_set_dir_flags(&em_pad, GPIOD_IS_IN);
+
return 0;
}