From 6520a77a6e64b549e5fb87ddf7c083b0d5c660d9 Mon Sep 17 00:00:00 2001 From: Bernie Moreno-BERNIEM Date: Thu, 16 Jul 2020 11:05:18 -0500 Subject: [PATCH] power: Remove FG reset check for factory sw build Factory s/w currently forces FG resets at every power up, as well as from sysfs cmd. The s/w build applied reset causes unstable soc when batteries are charged prior and esp with high rate chargers in backend COM test. NO_PROP_NEEDED: TI FG specific to Smith product. Change-Id: I7b8bc56efa113db465e8f4cc965ca7b064543ebe Signed-off-by: Bernie Moreno-BERNIEM Reviewed-on: https://gerrit.mot.com/1687439 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Ling Jin Submit-Approved: Jira Key --- drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c | 28 ++----------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c b/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c index 8f160252dafc..64f6a370d4a0 100644 --- a/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c +++ b/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c @@ -2356,36 +2356,15 @@ static int bq_parse_dt(struct bq_fg_chip *bq) return rc; } -enum { - MMI_FACTORY_MODE, - MMI_FACTORY_BUILD, -}; - -static bool mmi_factory_check(int type) +static bool mmi_factory_check() { struct device_node *np = of_find_node_by_path("/chosen"); bool factory = false; - const char *bootargs = NULL; - char *bl_version = NULL; if (!np) return factory; - - switch (type) { - case MMI_FACTORY_MODE: - factory = of_property_read_bool(np, "mmi,factory-cable"); - break; - case MMI_FACTORY_BUILD: - if (!of_property_read_string(np, "bootargs", &bootargs)) { - bl_version = strstr(bootargs, "androidboot.bootloader="); - if (bl_version && strstr(bl_version, "factory")) - factory = true; - } - break; - default: - factory = false; - } + factory = of_property_read_bool(np, "mmi,factory-cable"); of_node_put(np); return factory; @@ -2461,8 +2440,7 @@ static int bq_fg_probe(struct i2c_client *client, bq->fake_soc = -EINVAL; bq->fake_temp = -EINVAL; - bq->factory_mode = mmi_factory_check(MMI_FACTORY_MODE); - bq->factory_build = mmi_factory_check(MMI_FACTORY_BUILD); + bq->factory_mode = mmi_factory_check(); if (bq->chip == BQ27426) { regs = bq27426_regs;