mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
power: bq25700: add power_supply property for CTS.
Change-Id: I1b496dc8b3c4c53e54f40e07801cda419f654dfd Signed-off-by: Shunqing Chen <csq@rock-chips.com>
This commit is contained in:
@@ -1115,6 +1115,8 @@ static enum power_supply_property bq25700_power_supply_props[] = {
|
||||
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
|
||||
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
|
||||
POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
|
||||
POWER_SUPPLY_PROP_VOLTAGE_MAX,
|
||||
POWER_SUPPLY_PROP_CURRENT_MAX,
|
||||
};
|
||||
|
||||
static int bq25700_power_supply_get_property(struct power_supply *psy,
|
||||
@@ -1195,6 +1197,16 @@ static int bq25700_power_supply_get_property(struct power_supply *psy,
|
||||
val->intval = bq25700_tables[TBL_INPUTCUR].rt.max;
|
||||
break;
|
||||
|
||||
case POWER_SUPPLY_PROP_VOLTAGE_MAX:
|
||||
ret = bq25700_field_read(bq, MAX_CHARGE_VOLTAGE);
|
||||
val->intval = ret * 16;
|
||||
break;
|
||||
|
||||
case POWER_SUPPLY_PROP_CURRENT_MAX:
|
||||
ret = bq25700_field_read(bq, CHARGE_CURRENT);
|
||||
val->intval = ret * 64;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user