Lines Matching refs:ec_byte

99 		union power_supply_propval *val, uint8_t ec_byte)  in olpc_bat_get_status()  argument
102 if (ec_byte & (BAT_STAT_CHARGING | BAT_STAT_TRICKLE)) in olpc_bat_get_status()
104 else if (ec_byte & BAT_STAT_DISCHARGING) in olpc_bat_get_status()
106 else if (ec_byte & BAT_STAT_FULL) in olpc_bat_get_status()
112 if (!(ec_byte & BAT_STAT_AC)) /* No AC means discharging */ in olpc_bat_get_status()
114 else if (ec_byte & BAT_STAT_FULL) in olpc_bat_get_status()
125 uint8_t ec_byte; in olpc_bat_get_health() local
128 ret = olpc_ec_cmd(EC_BAT_ERRCODE, NULL, 0, &ec_byte, 1); in olpc_bat_get_health()
132 switch (ec_byte) { in olpc_bat_get_health()
162 uint8_t ec_byte; in olpc_bat_get_mfr() local
165 ec_byte = BAT_ADDR_MFR_TYPE; in olpc_bat_get_mfr()
166 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1); in olpc_bat_get_mfr()
170 switch (ec_byte >> 4) { in olpc_bat_get_mfr()
187 uint8_t ec_byte; in olpc_bat_get_tech() local
190 ec_byte = BAT_ADDR_MFR_TYPE; in olpc_bat_get_tech()
191 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1); in olpc_bat_get_tech()
195 switch (ec_byte & 0xf) { in olpc_bat_get_tech()
212 uint8_t ec_byte; in olpc_bat_get_charge_full_design() local
220 ec_byte = BAT_ADDR_MFR_TYPE; in olpc_bat_get_charge_full_design()
221 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1); in olpc_bat_get_charge_full_design()
225 mfr = ec_byte >> 4; in olpc_bat_get_charge_full_design()
276 uint8_t ec_byte; in olpc_bat_get_voltage_max_design() local
285 ec_byte = BAT_ADDR_MFR_TYPE; in olpc_bat_get_voltage_max_design()
286 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &ec_byte, 1); in olpc_bat_get_voltage_max_design()
290 mfr = ec_byte >> 4; in olpc_bat_get_voltage_max_design()
341 uint8_t ec_byte; in olpc_bat_get_property() local
344 ret = olpc_ec_cmd(EC_BAT_STATUS, NULL, 0, &ec_byte, 1); in olpc_bat_get_property()
354 if (!(ec_byte & (BAT_STAT_PRESENT | BAT_STAT_TRICKLE)) && in olpc_bat_get_property()
360 ret = olpc_bat_get_status(data, val, ec_byte); in olpc_bat_get_property()
365 if (ec_byte & BAT_STAT_TRICKLE) in olpc_bat_get_property()
367 else if (ec_byte & BAT_STAT_CHARGING) in olpc_bat_get_property()
373 val->intval = !!(ec_byte & (BAT_STAT_PRESENT | in olpc_bat_get_property()
378 if (ec_byte & BAT_STAT_DESTROY) in olpc_bat_get_property()
414 ret = olpc_ec_cmd(EC_BAT_SOC, NULL, 0, &ec_byte, 1); in olpc_bat_get_property()
417 val->intval = ec_byte; in olpc_bat_get_property()
420 if (ec_byte & BAT_STAT_FULL) in olpc_bat_get_property()
422 else if (ec_byte & BAT_STAT_LOW) in olpc_bat_get_property()
532 uint8_t ec_byte; in olpc_bat_eeprom_read() local
537 ec_byte = EEPROM_START + off + i; in olpc_bat_eeprom_read()
538 ret = olpc_ec_cmd(EC_BAT_EEPROM, &ec_byte, 1, &buf[i], 1); in olpc_bat_eeprom_read()
542 ec_byte, ret); in olpc_bat_eeprom_read()
564 uint8_t ec_byte; in olpc_bat_error_read() local
567 ret = olpc_ec_cmd(EC_BAT_ERRCODE, NULL, 0, &ec_byte, 1); in olpc_bat_error_read()
571 return sysfs_emit(buf, "%d\n", ec_byte); in olpc_bat_error_read()