diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2020-04-22 14:29:13 +0200 |
---|---|---|
committer | Patrick Delaunay <patrick.delaunay@st.com> | 2020-05-14 09:02:12 +0200 |
commit | 055065a8acfb51b2aed415c62271ac3d5d34b641 (patch) | |
tree | 5fdf1692d013e0d5974267adcfcda3c80ce3deac /board/st/stm32mp1/stm32mp1.c | |
parent | 0c95295e17b046616457aaed8885a73b595a1ae8 (diff) | |
download | u-boot-055065a8acfb51b2aed415c62271ac3d5d34b641.tar.gz u-boot-055065a8acfb51b2aed415c62271ac3d5d34b641.tar.xz u-boot-055065a8acfb51b2aed415c62271ac3d5d34b641.zip |
board: stm32mp1: gt9147 IRQ before reset on EV1
Software workaround for I2C issue on EV1 board,
configure the IRQ line for touchscreen before LCD reset
to fix the used I2C address.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'board/st/stm32mp1/stm32mp1.c')
-rw-r--r-- | board/st/stm32mp1/stm32mp1.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 20823f511a..62b648f6e4 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -616,6 +616,38 @@ static bool board_is_dk2(void) } #endif +static bool board_is_ev1(void) +{ + if (CONFIG_IS_ENABLED(TARGET_ST_STM32MP15x) && + (of_machine_is_compatible("st,stm32mp157a-ev1") || + of_machine_is_compatible("st,stm32mp157c-ev1") || + of_machine_is_compatible("st,stm32mp157d-ev1") || + of_machine_is_compatible("st,stm32mp157f-ev1"))) + return true; + + return false; +} + +/* touchscreen driver: only used for pincontrol configuration */ +static const struct udevice_id goodix_ids[] = { + { .compatible = "goodix,gt9147", }, + { } +}; + +U_BOOT_DRIVER(goodix) = { + .name = "goodix", + .id = UCLASS_NOP, + .of_match = goodix_ids, +}; + +static void board_ev1_init(void) +{ + struct udevice *dev; + + /* configure IRQ line on EV1 for touchscreen before LCD reset */ + uclass_get_device_by_driver(UCLASS_NOP, DM_GET_DRIVER(goodix), &dev); +} + /* board dependent setup after realloc */ int board_init(void) { @@ -633,6 +665,9 @@ int board_init(void) board_key_check(); + if (board_is_ev1()) + board_ev1_init(); + #ifdef CONFIG_DM_REGULATOR if (board_is_dk2()) dk2_i2c1_fix(); |