From 6493ee905508725dba2a1bddbacc41d543882dd4 Mon Sep 17 00:00:00 2001 From: litong20 Date: Wed, 21 Jul 2021 15:52:25 +0800 Subject: [PATCH] Use bi_bootmode instead of mmi_bl_bootmode. In Android S-8450, the bootconfig feature begins enable. So that androidboot.bootreason canot be found in the cmdline. And compatibility has been done in mmi_info. Change-Id: I96b3d9ed988416c640c0b115cdad9fe1fd11a34b Reviewed-on: https://gerrit.mot.com/2020001 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou Submit-Approved: Jira Key --- .../touchscreen/sec_mmi/sec_ts_mmi_class.c | 3 +- .../touchscreen/stmicro_mmi/fts_mmi_class.c | 3 +- .../touchscreen_mmi/touchscreen_mmi_class.c | 34 ------------------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts_mmi_class.c b/drivers/input/touchscreen/sec_mmi/sec_ts_mmi_class.c index d22ba4fce2c5..771270714da6 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts_mmi_class.c +++ b/drivers/input/touchscreen/sec_mmi/sec_ts_mmi_class.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "sec_ts.h" @@ -126,7 +127,7 @@ static int sec_mmi_extend_attribute_group(struct device *dev, struct attribute_g if (ts->plat_data->hold_grip_ctrl) ADD_ATTR(hold_grip); - if (strncmp(mmi_bl_bootmode(), "mot-factory", strlen("mot-factory")) == 0) { + if (strncmp(bi_bootmode(), "mot-factory", strlen("mot-factory")) == 0) { ADD_ATTR(address); ADD_ATTR(size); ADD_ATTR(data); diff --git a/drivers/input/touchscreen/stmicro_mmi/fts_mmi_class.c b/drivers/input/touchscreen/stmicro_mmi/fts_mmi_class.c index 47af3c215bdb..b8ed4c9d0e26 100644 --- a/drivers/input/touchscreen/stmicro_mmi/fts_mmi_class.c +++ b/drivers/input/touchscreen/stmicro_mmi/fts_mmi_class.c @@ -20,6 +20,7 @@ #include "fts_lib/ftsError.h" #include "fts_lib/ftsSoftware.h" #include "fts_lib/ftsGesture.h" +#include #include #ifdef TS_MMI_TOUCH_MULTIWAY_UPDATE_FW @@ -117,7 +118,7 @@ static int fts_mmi_extend_attribute_group(struct device *dev, struct attribute_g if (ts->board->edge_ctrl) ADD_ATTR(edge); - if (strncmp(mmi_bl_bootmode(), "mot-factory", strlen("mot-factory")) == 0) { + if (strncmp(bi_bootmode(), "mot-factory", strlen("mot-factory")) == 0) { ADD_ATTR(calibrate); } diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c index 9192ad348291..e0e0b6b7c361 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_class.c @@ -552,40 +552,6 @@ static int ts_mmi_default_pinctrl(struct device *parent, int on) return 0; } -#define BOOTMODE_MAX_LEN 64 -const char *mmi_bl_bootmode(void) -{ - const char *bootargs = NULL; - char *end = NULL; - char *idx = NULL; - struct device_node *np; - static char bootmode[BOOTMODE_MAX_LEN] = {'\0'}; - - if (bootmode[0] != '\0') - return bootmode; - - np = of_find_node_by_path("/chosen"); - if (np == NULL) - return NULL; - - if (of_property_read_string(np, "bootargs", &bootargs) != 0) - goto putnode; - - idx = strstr(bootargs, "androidboot.mode="); - if (idx) { - end = strpbrk(idx, " "); - idx = strpbrk(idx, "="); - if (idx && end > idx) - strlcpy(bootmode, idx + 1, end - idx); - } - -putnode: - of_node_put(np); - return bootmode; -} - -EXPORT_SYMBOL(mmi_bl_bootmode); - /** * ts_mmi_dev_register - register a new object of ts_mmi_dev class. * @parent: The device to register.