Skip to content

Commit dfd71ff

Browse files
marcanjannau
authored andcommitted
power: supply: macsmc_power: Add present prop
Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 826d6bb commit dfd71ff

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/power/supply/macsmc_power.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ static int macsmc_battery_get_property(struct power_supply *psy,
7272
val->intval = macsmc_battery_get_status(power);
7373
ret = val->intval < 0 ? val->intval : 0;
7474
break;
75+
case POWER_SUPPLY_PROP_PRESENT:
76+
val->intval = 1;
77+
break;
7578
case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
7679
ret = apple_smc_read_u16(power->smc, SMC_KEY(B0TE), &vu16);
7780
val->intval = vu16 == 0xffff ? 0 : vu16 * 60;
@@ -160,6 +163,7 @@ static int macsmc_battery_get_property(struct power_supply *psy,
160163

161164
static enum power_supply_property macsmc_battery_props[] = {
162165
POWER_SUPPLY_PROP_STATUS,
166+
POWER_SUPPLY_PROP_PRESENT,
163167
POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
164168
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
165169
POWER_SUPPLY_PROP_CAPACITY,

0 commit comments

Comments
 (0)