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 <zoujc@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2021-07-21 15:52:25 +08:00 • committed by litong
commit 6493ee9055
3 changed files with 4 additions and 36 deletions

View file

@ -28,6 +28,7 @@
#include <linux/of_gpio.h>
#include <linux/time.h>
#include <linux/vmalloc.h>
#include <soc/qcom/mmi_boot_info.h>
#include <linux/touchscreen_mmi.h>
#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);

View file

@ -20,6 +20,7 @@
#include "fts_lib/ftsError.h"
#include "fts_lib/ftsSoftware.h"
#include "fts_lib/ftsGesture.h"
#include <soc/qcom/mmi_boot_info.h>
#include <linux/regulator/consumer.h>
#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);
}

View file

@ -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.