File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,15 @@ static int macsmc_battery_get_property(struct power_supply *psy,
136136 ret = apple_smc_read_s64 (power -> smc , SMC_KEY (BAAC ), & vs64 );
137137 val -> intval = vs64 ;
138138 break ;
139+ case POWER_SUPPLY_PROP_CYCLE_COUNT :
140+ ret = apple_smc_read_u16 (power -> smc , SMC_KEY (B0CT ), & vu16 );
141+ val -> intval = vu16 ;
142+ break ;
143+ case POWER_SUPPLY_PROP_HEALTH :
144+ ret = apple_smc_read_flag (power -> smc , SMC_KEY (BBAD ));
145+ val -> intval = ret == 1 ? POWER_SUPPLY_HEALTH_DEAD : POWER_SUPPLY_HEALTH_GOOD ;
146+ ret = ret < 0 ? ret : 0 ;
147+ break ;
139148 case POWER_SUPPLY_PROP_MODEL_NAME :
140149 val -> strval = power -> model_name ;
141150 break ;
@@ -167,6 +176,8 @@ static enum power_supply_property macsmc_battery_props[] = {
167176 POWER_SUPPLY_PROP_CHARGE_NOW ,
168177 POWER_SUPPLY_PROP_TEMP ,
169178 POWER_SUPPLY_PROP_CHARGE_COUNTER ,
179+ POWER_SUPPLY_PROP_CYCLE_COUNT ,
180+ POWER_SUPPLY_PROP_HEALTH ,
170181 POWER_SUPPLY_PROP_MODEL_NAME ,
171182 POWER_SUPPLY_PROP_SERIAL_NUMBER ,
172183};
You can’t perform that action at this time.
0 commit comments