mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
charging: config vindpm by dts
change code logic to config vindpm by dts. Default value is 4600mv; Change-Id: I531c7b23acd664b9c63870281d779dba8a263662 Signed-off-by: Haijian Ma <mahj8@motorola.com> Reviewed-on: https://gerrit.mot.com/2270958 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
0c797318a4
commit
4a36724c7e
1 changed files with 11 additions and 6 deletions
|
|
@ -100,6 +100,7 @@ struct bq2589x_config {
|
|||
int charge_voltage;
|
||||
int charge_current;
|
||||
int term_current;
|
||||
int vindpm;
|
||||
};
|
||||
|
||||
struct bq2589x_state {
|
||||
|
|
@ -1461,6 +1462,10 @@ static int bq2589x_parse_dt(struct device *dev, struct bq2589x *bq)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = of_property_read_u32(np, "ti,bq2589x,vindpm",&bq->cfg.vindpm);
|
||||
if (ret)
|
||||
bq->cfg.vindpm = 4600;
|
||||
|
||||
bq->mmi_qc3_support = of_property_read_bool(np, "mmi,qc3-support");
|
||||
|
||||
ret = mmi_parse_dt_adc_channels(bq);
|
||||
|
|
@ -2267,11 +2272,11 @@ static void bq2589x_adapter_in_func(struct bq2589x *bq)
|
|||
if (ret < 0)
|
||||
dev_err(bq->dev,"%s:force vindpm failed:%d\n",__func__,ret);
|
||||
|
||||
ret = bq2589x_set_input_volt_limit(bq, 4600);
|
||||
ret = bq2589x_set_input_volt_limit(bq, bq->cfg.vindpm);
|
||||
if (ret < 0)
|
||||
dev_err(bq->dev,"%s:reset vindpm threshold to 4600 failed:%d\n",__func__,ret);
|
||||
dev_err(bq->dev,"%s:reset vindpm threshold to %d failed:%d\n",__func__,bq->cfg.vindpm,ret);
|
||||
else
|
||||
dev_info(bq->dev,"%s:reset vindpm threshold to 4600 successfully\n",__func__);
|
||||
dev_info(bq->dev,"%s:reset vindpm threshold to %d successfully\n",__func__,bq->cfg.vindpm);
|
||||
}
|
||||
|
||||
schedule_delayed_work(&bq->monitor_work, 0);
|
||||
|
|
@ -2286,11 +2291,11 @@ static void bq2589x_adapter_out_func(struct bq2589x *bq)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ret = bq2589x_set_input_volt_limit(bq, 4600);
|
||||
ret = bq2589x_set_input_volt_limit(bq, bq->cfg.vindpm);
|
||||
if (ret < 0)
|
||||
dev_err(bq->dev,"%s:reset vindpm threshold to 4600 failed:%d\n",__func__,ret);
|
||||
dev_err(bq->dev,"%s:reset vindpm threshold to %d failed:%d\n",__func__,bq->cfg.vindpm,ret);
|
||||
else
|
||||
dev_info(bq->dev,"%s:reset vindpm threshold to 4600 successfully\n",__func__);
|
||||
dev_info(bq->dev,"%s:reset vindpm threshold to %d successfully\n",__func__,bq->cfg.vindpm);
|
||||
|
||||
cancel_delayed_work_sync(&bq->monitor_work);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue