Skip to content

Commit

Permalink
power: supply: macsmc_power: Add present prop
Browse files Browse the repository at this point in the history
Signed-off-by: Hector Martin <marcan@marcan.st>
  • Loading branch information
marcan committed Feb 8, 2022
1 parent b478b26 commit b3265ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/power/supply/macsmc_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ static int macsmc_battery_get_property(struct power_supply *psy,
val->intval = macsmc_battery_get_status(power);
ret = val->intval < 0 ? val->intval : 0;
break;
case POWER_SUPPLY_PROP_PRESENT:
val->intval = 1;
break;
case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
ret = apple_smc_read_u16(power->smc, SMC_KEY(B0TE), &vu16);
val->intval = vu16 == 0xffff ? 0 : vu16 * 60;
Expand Down Expand Up @@ -156,6 +159,7 @@ static int macsmc_battery_get_property(struct power_supply *psy,

static enum power_supply_property macsmc_battery_props[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
POWER_SUPPLY_PROP_CAPACITY,
Expand Down

0 comments on commit b3265ba

Please sign in to comment.