From 502eafd25091a26ddda971a8621e9d048093d8e2 Mon Sep 17 00:00:00 2001 From: Bernie Moreno-BERNIEM Date: Fri, 17 Jul 2020 12:27:09 -0500 Subject: [PATCH] power: Remove FG reset for factory bootmode Factory agrees to manually reset FG'es rather than automatically in BL factory bootmode, in addition to factory_build. This will allow CFC test to charge batteries in COM and reboot with minimal charge capacity variation compared to re-init'ing FG at every boot. NO_PROP_NEEDED: TI FG for smith product only Change-Id: I6f0b2ceaeff5d4c20b01e154b48f9c54e22a9ef0 Signed-off-by: Bernie Moreno-BERNIEM Reviewed-on: https://gerrit.mot.com/1689972 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 | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c b/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c index 64f6a370d4a0..a592c599efcf 100644 --- a/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c +++ b/drivers/power/bq27426_fg_mmi/bq27426_fg_mmi.c @@ -283,8 +283,6 @@ struct bq_fg_chip { bool cfg_update_mode; bool itpor; bool device_initial; - bool factory_mode; - bool factory_build; int seal_state; /* 0 - Full Access, 1 - Unsealed, 2 - Sealed */ int batt_tte; @@ -2356,20 +2354,6 @@ static int bq_parse_dt(struct bq_fg_chip *bq) return rc; } -static bool mmi_factory_check() -{ - struct device_node *np = of_find_node_by_path("/chosen"); - bool factory = false; - - if (!np) - return factory; - - factory = of_property_read_bool(np, "mmi,factory-cable"); - of_node_put(np); - - return factory; -} - static int mmi_perform_reset(struct bq_fg_chip *bq) { int rc = -1; @@ -2440,8 +2424,6 @@ static int bq_fg_probe(struct i2c_client *client, bq->fake_soc = -EINVAL; bq->fake_temp = -EINVAL; - bq->factory_mode = mmi_factory_check(); - if (bq->chip == BQ27426) { regs = bq27426_regs; } else { @@ -2492,9 +2474,6 @@ static int bq_fg_probe(struct i2c_client *client, goto free_mem; } - if (bq->factory_mode || bq->factory_build) - mmi_perform_reset(bq); - //mmi_fg_err(bq, "I2C adapter is %s\n", dev_name(&bq->client->adapter->dev)); INIT_WORK(&bq->update_work, fg_update_bqfs_workfunc);