Searched refs:ecbat (Results 1 – 2 of 2) sorted by relevance
71 static int yoga_c630_psy_update_bat_info(struct yoga_c630_psy *ecbat) in yoga_c630_psy_update_bat_info() argument73 struct yoga_c630_ec *ec = ecbat->ec; in yoga_c630_psy_update_bat_info()76 lockdep_assert_held(&ecbat->lock); in yoga_c630_psy_update_bat_info()81 ecbat->bat_present = !!(val & LENOVO_EC_BAT_PRESENT_IS_PRESENT); in yoga_c630_psy_update_bat_info()82 if (!ecbat->bat_present) in yoga_c630_psy_update_bat_info()88 ecbat->unit_mA = val & LENOVO_EC_BAT_ATTRIBUTES_UNIT_IS_MA; in yoga_c630_psy_update_bat_info()93 ecbat->design_capacity = val * 1000; in yoga_c630_psy_update_bat_info()104 ecbat->design_voltage = val; in yoga_c630_psy_update_bat_info()118 ecbat->full_charge_capacity = val * 1000; in yoga_c630_psy_update_bat_info()120 if (!ecbat->unit_mA) { in yoga_c630_psy_update_bat_info()[all …]
126 static int gaokun_psy_get_adp_status(struct gaokun_psy *ecbat) in gaokun_psy_get_adp_status() argument132 ret = gaokun_ec_psy_read_byte(ecbat->ec, EC_ADP_STATUS, &online); in gaokun_psy_get_adp_status()136 ecbat->online = !!(online & EC_AC_STATUS); in gaokun_psy_get_adp_status()145 struct gaokun_psy *ecbat = power_supply_get_drvdata(psy); in gaokun_psy_get_adp_property() local148 ret = gaokun_psy_get_adp_status(ecbat); in gaokun_psy_get_adp_property()154 val->intval = ecbat->online; in gaokun_psy_get_adp_property()183 static inline void gaokun_psy_get_bat_present(struct gaokun_psy *ecbat) in gaokun_psy_get_bat_present() argument189 gaokun_ec_write(ecbat->ec, (u8 []){0x02, 0xB2, 1, 0x90}); in gaokun_psy_get_bat_present()191 ret = gaokun_ec_psy_read_byte(ecbat->ec, EC_ADP_STATUS, &present); in gaokun_psy_get_bat_present()193 ecbat->bat_present = ret ? false : !!(present & EC_BAT_PRESENT); in gaokun_psy_get_bat_present()[all …]