File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,6 +138,15 @@ static int macsmc_battery_get_property(struct power_supply *psy,
138138 ret = apple_smc_read_s64 (power -> smc , SMC_KEY (BAAC ), & vs64 );
139139 val -> intval = vs64 ;
140140 break ;
141+ case POWER_SUPPLY_PROP_CYCLE_COUNT :
142+ ret = apple_smc_read_u16 (power -> smc , SMC_KEY (B0CT ), & vu16 );
143+ val -> intval = vu16 ;
144+ break ;
145+ case POWER_SUPPLY_PROP_HEALTH :
146+ ret = apple_smc_read_flag (power -> smc , SMC_KEY (BBAD ));
147+ val -> intval = ret == 1 ? POWER_SUPPLY_HEALTH_DEAD : POWER_SUPPLY_HEALTH_GOOD ;
148+ ret = ret < 0 ? ret : 0 ;
149+ break ;
141150 case POWER_SUPPLY_PROP_MODEL_NAME :
142151 val -> strval = power -> model_name ;
143152 break ;
@@ -169,6 +178,8 @@ static enum power_supply_property macsmc_battery_props[] = {
169178 POWER_SUPPLY_PROP_CHARGE_NOW ,
170179 POWER_SUPPLY_PROP_TEMP ,
171180 POWER_SUPPLY_PROP_CHARGE_COUNTER ,
181+ POWER_SUPPLY_PROP_CYCLE_COUNT ,
182+ POWER_SUPPLY_PROP_HEALTH ,
172183 POWER_SUPPLY_PROP_MODEL_NAME ,
173184 POWER_SUPPLY_PROP_SERIAL_NUMBER ,
174185};
You can’t perform that action at this time.
0 commit comments