:: Re: [maemo-leste] [PATCH] power: su… |
Questo messaggio è parte di questo thread: | |
---|---|
il thread completo ordinato per data | |
Sicelo A. Mhlongo at | |
Sicelo at |
> diff --git a/drivers/power/supply/bq2415x_charger.c b/drivers/power/supply/bq2415x_charger.c > index 6a4798a62588..5b47a1d0a51a 100644 > --- a/drivers/power/supply/bq2415x_charger.c > +++ b/drivers/power/supply/bq2415x_charger.c > @@ -991,6 +991,7 @@ static enum power_supply_property bq2415x_power_supply_props[] = { > /* TODO: maybe add more power supply properties */ > POWER_SUPPLY_PROP_STATUS, > POWER_SUPPLY_PROP_MODEL_NAME, > + POWER_SUPPLY_PROP_ONLINE, > };
> static int bq2415x_power_supply_get_property(struct power_supply *psy, > @@ -1017,6 +1018,14 @@ static int bq2415x_power_supply_get_property(struct power_supply *psy, > case POWER_SUPPLY_PROP_MODEL_NAME: > val->strval = bq->model; > break; > + case POWER_SUPPLY_PROP_ONLINE: > + ret = bq2415x_exec_command(bq, BQ2415X_CHARGE_STATUS); > + /* Charger is Online when Charging or Full are reported. It is > + * also likely online for the Unknown/Fault state too, but > + * there is no way to be absolutely sure. > + */ > + val->intval = (ret == 1 || ret == 2); > + break; > default: > return -EINVAL; > } > -- > 2.43.0
Questo messaggio è stato inviato alle seguenti mailing lists: | ||||
---|---|---|---|---|
maemo-leste Informazioni sulla Mailing List | Messaggi correlati | [maemo-leste] [PATCH] power: supply: bq2415x_charger: report online status | Re: [maemo-leste] [PATCH] power: supply: bq27xxx: Report charge full state correctly |
Donate to Dyne.org | dyne.org open discussions amministrato da dyne.org hackers | Lurker (versione 2.3) |