Skip to content

Commit 215762b

Browse files
committed
power: supply: macsmc_power: Add present prop
Signed-off-by: Hector Martin <[email protected]>
1 parent 5e08536 commit 215762b

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
@@ -74,6 +74,9 @@ static int macsmc_battery_get_property(struct power_supply *psy,
7474
val->intval = macsmc_battery_get_status(power);
7575
ret = val->intval < 0 ? val->intval : 0;
7676
break;
77+
case POWER_SUPPLY_PROP_PRESENT:
78+
val->intval = 1;
79+
break;
7780
case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
7881
ret = apple_smc_read_u16(power->smc, SMC_KEY(B0TE), &vu16);
7982
val->intval = vu16 == 0xffff ? 0 : vu16 * 60;
@@ -162,6 +165,7 @@ static int macsmc_battery_get_property(struct power_supply *psy,
162165

163166
static enum power_supply_property macsmc_battery_props[] = {
164167
POWER_SUPPLY_PROP_STATUS,
168+
POWER_SUPPLY_PROP_PRESENT,
165169
POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
166170
POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
167171
POWER_SUPPLY_PROP_CAPACITY,

0 commit comments

Comments
 (0)