stmicro_mmi: mmi status check

Added MMI status check to driver's probe. Kernel module will be loaded
only when MMI status check succeed. Driver node needs to have property
mmi,status in device tree for this to work.

Change-Id: I5c904ed47ac382a758ff44b236a077038b8f1038
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1827964
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Konstantin Makariev 2020-12-15 10:01:40 -06:00 • committed by Konstantin Makariev
commit c06e44fe0f
3 changed files with 7 additions and 3 deletions

View file

@ -9,6 +9,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := stmicro_mmi.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/mmi_info.ko
ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),)
KERNEL_CFLAGS += CONFIG_INPUT_TOUCHSCREEN_MMI=y
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/touchscreen_mmi.ko

View file

@ -26,3 +26,4 @@ ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),)
endif
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../touchscreen_mmi/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../../mmi_info/Module.symvers

View file

@ -73,6 +73,7 @@
#include "fts_lib/ftsTool.h"
#include "fts_mmi.h"
#include <linux/mmi_device.h>
/**
* Event handler installer helpers
@ -3897,11 +3898,12 @@ static int fts_probe(struct spi_device *client)
u16 bus_type;
logError(1, "%s %s: driver probe begin!\n", tag, __func__);
if (client->dev.of_node && !mmi_device_is_available(client->dev.of_node)) {
logError(1, "%s mmi: device not supported\n", tag);
return -ENODEV;
}
logError(1, "%s driver ver. %s\n", tag, FTS_TS_DRV_VERSION);
logError(1, "%s SET Bus Functionality :\n", tag);
#ifdef I2C_INTERFACE
logError(1, "%s I2C interface...\n", tag);