From 9b4c9f024aef4d59e18def8de354e5698946613a Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Mon, 7 Nov 2022 15:06:26 +0800 Subject: [PATCH] input: nova_0flash_mmi: check whether panel exists nova_0flash_mmi: Check whether panel exists before probe: - reduce boot on time - don't set touch pin state, avoid impact other touch panel Change-Id: I63f35d5af852477e9571680834087449601c2677 Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/2422379 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Deng Reviewed-by: Jing Hu Reviewed-by: Jun Weng Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c index 2cef370d97f7..7227f45c179d 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c +++ b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c @@ -70,6 +70,7 @@ enum touch_state { #endif #ifdef CONFIG_INPUT_TOUCHSCREEN_MMI +#include extern int nvt_mmi_init(struct nvt_ts_data *ts_data, bool enable); #endif @@ -2767,6 +2768,11 @@ static int32_t nvt_ts_probe(struct spi_device *client) return ret; } #endif +#else + if (client->dev.of_node && !mmi_device_is_available(client->dev.of_node)) { + NVT_ERR("mmi: device not supported\n"); + return -ENODEV; + } #endif NVT_LOG("start\n");