Commit 376f6986 authored by Eric Kuzmenko's avatar Eric Kuzmenko
Browse files

Allow setting your own current limit

parent 473475e8
Pipeline #11140 canceled with stage
......@@ -76,7 +76,10 @@ struct bq25890_init_data {
u8 boostf; /* boost frequency */
u8 ilim_en; /* enable ILIM pin */
u8 force_vindpm;/* force vinmin threshold */
u8 ico_en; /* enable current optimizer */
u8 en_ilim; /* use resistor current limit */
u8 vindpm; /* vinmin threshold */
u8 iilim; /* input current limit */
u8 treg; /* thermal regulation threshold */
};
......@@ -256,6 +259,7 @@ enum bq25890_table_ids {
TBL_BOOSTV,
TBL_SYSVMIN,
TBL_VINDPM,
TBL_IILIM,
/* lookup tables */
TBL_TREG,
......@@ -298,6 +302,7 @@ static const union {
[TBL_BOOSTV] = { .rt = {4550000, 5510000, 64000} }, /* uV */
[TBL_SYSVMIN] = { .rt = {3000000, 3700000, 100000} }, /* uV */
[TBL_VINDPM] = { .rt = {2600000, 15300000, 100000} }, /* uV */
[TBL_IILIM] = { .rt = {100000, 3250000, 50000} }, /* uA */
/* lookup tables */
[TBL_TREG] = { .lt = {bq25890_treg_tbl, BQ25890_TREG_TBL_SIZE} },
......@@ -633,7 +638,10 @@ static int bq25890_hw_init(struct bq25890_device *bq)
{F_BOOSTF, bq->init_data.boostf},
{F_EN_ILIM, bq->init_data.ilim_en},
{F_FORCE_VINDPM, bq->init_data.force_vindpm},
{F_ICO_EN, bq->init_data.ico_en},
{F_EN_ILIM, bq->init_data.en_ilim},
{F_VINDPM, bq->init_data.vindpm},
{F_IILIM, bq->init_data.iilim},
{F_TREG, bq->init_data.treg}
};
......@@ -800,6 +808,7 @@ static int bq25890_fw_read_u32_props(struct bq25890_device *bq)
/* optional properties */
{"ti,vinmin-threshold", true, TBL_VINDPM, &init->vindpm},
{"ti,input-current-limit", true, TBL_IILIM, &init->iilim},
{"ti,thermal-regulation-threshold", true, TBL_TREG, &init->treg}
};
......@@ -838,6 +847,8 @@ static int bq25890_fw_probe(struct bq25890_device *bq)
init->ilim_en = device_property_read_bool(bq->dev, "ti,use-ilim-pin");
init->boostf = device_property_read_bool(bq->dev, "ti,boost-low-freq");
init->force_vindpm = device_property_read_bool(bq->dev, "ti,use-vinmin-threshold");
init->ico_en = device_property_read_bool(bq->dev, "ti,use-current-optimizer");
init->en_ilim = device_property_read_bool(bq->dev, "ti,use-rcurrent-limit");
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment