Lines Matching full:val

74 	int val;  in yoga_c630_psy_update_bat_info()  local
78 val = yoga_c630_ec_read8(ec, LENOVO_EC_BAT_PRESENT); in yoga_c630_psy_update_bat_info()
79 if (val < 0) in yoga_c630_psy_update_bat_info()
80 return val; 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()
83 return val; in yoga_c630_psy_update_bat_info()
85 val = yoga_c630_ec_read8(ec, LENOVO_EC_BAT_ATTRIBUTES); in yoga_c630_psy_update_bat_info()
86 if (val < 0) in yoga_c630_psy_update_bat_info()
87 return val; 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()
90 val = yoga_c630_ec_read16(ec, LENOVO_EC_BAT_DESIGN_CAPACITY); in yoga_c630_psy_update_bat_info()
91 if (val < 0) in yoga_c630_psy_update_bat_info()
92 return val; in yoga_c630_psy_update_bat_info()
93 ecbat->design_capacity = val * 1000; in yoga_c630_psy_update_bat_info()
101 val = yoga_c630_ec_read16(ec, LENOVO_EC_BAT_DESIGN_VOLTAGE); in yoga_c630_psy_update_bat_info()
102 if (val < 0) in yoga_c630_psy_update_bat_info()
103 return val; in yoga_c630_psy_update_bat_info()
104 ecbat->design_voltage = val; in yoga_c630_psy_update_bat_info()
108 val = yoga_c630_ec_read8(ec, LENOVO_EC_BAT_FULL_REGISTER); in yoga_c630_psy_update_bat_info()
109 if (val < 0) in yoga_c630_psy_update_bat_info()
110 return val; in yoga_c630_psy_update_bat_info()
111 val = yoga_c630_ec_read16(ec, in yoga_c630_psy_update_bat_info()
112 val & LENOVO_EC_BAT_FULL_REGISTER_IS_FACTORY ? in yoga_c630_psy_update_bat_info()
115 if (val < 0) in yoga_c630_psy_update_bat_info()
116 return val; in yoga_c630_psy_update_bat_info()
118 ecbat->full_charge_capacity = val * 1000; in yoga_c630_psy_update_bat_info()
132 int val; in yoga_c630_psy_maybe_update_bat_status() local
138 val = yoga_c630_ec_read8(ec, LENOVO_EC_BAT_STATUS); in yoga_c630_psy_maybe_update_bat_status()
139 if (val < 0) in yoga_c630_psy_maybe_update_bat_status()
140 return val; in yoga_c630_psy_maybe_update_bat_status()
141 ecbat->bat_status = val; in yoga_c630_psy_maybe_update_bat_status()
145 val = yoga_c630_ec_read16(ec, LENOVO_EC_BAT_REMAIN_CAPACITY); in yoga_c630_psy_maybe_update_bat_status()
146 if (val < 0) in yoga_c630_psy_maybe_update_bat_status()
147 return val; in yoga_c630_psy_maybe_update_bat_status()
148 ecbat->capacity_now = val * 1000; in yoga_c630_psy_maybe_update_bat_status()
152 val = yoga_c630_ec_read16(ec, LENOVO_EC_BAT_VOLTAGE); in yoga_c630_psy_maybe_update_bat_status()
153 if (val < 0) in yoga_c630_psy_maybe_update_bat_status()
154 return val; in yoga_c630_psy_maybe_update_bat_status()
155 ecbat->voltage_now = val * 1000; in yoga_c630_psy_maybe_update_bat_status()
159 val = yoga_c630_ec_read16(ec, LENOVO_EC_BAT_CURRENT); in yoga_c630_psy_maybe_update_bat_status()
160 if (val < 0) in yoga_c630_psy_maybe_update_bat_status()
161 return val; in yoga_c630_psy_maybe_update_bat_status()
162 current_mA = sign_extend32(val, 15); in yoga_c630_psy_maybe_update_bat_status()
179 int val; in yoga_c630_psy_update_adapter_status() local
183 val = yoga_c630_ec_read8(ec, LENOVO_EC_ADPT_STATUS); in yoga_c630_psy_update_adapter_status()
184 if (val < 0) in yoga_c630_psy_update_adapter_status()
185 return val; in yoga_c630_psy_update_adapter_status()
187 ecbat->adapter_online = !!(val & LENOVO_EC_ADPT_STATUS_PRESENT); in yoga_c630_psy_update_adapter_status()
208 union power_supply_propval *val) in yoga_c630_psy_bat_get_property() argument
223 val->intval = POWER_SUPPLY_STATUS_DISCHARGING; in yoga_c630_psy_bat_get_property()
225 val->intval = POWER_SUPPLY_STATUS_CHARGING; in yoga_c630_psy_bat_get_property()
227 val->intval = POWER_SUPPLY_STATUS_FULL; in yoga_c630_psy_bat_get_property()
229 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in yoga_c630_psy_bat_get_property()
232 val->intval = ecbat->bat_present; in yoga_c630_psy_bat_get_property()
235 val->intval = ecbat->design_voltage; in yoga_c630_psy_bat_get_property()
239 val->intval = ecbat->design_capacity; in yoga_c630_psy_bat_get_property()
243 val->intval = ecbat->full_charge_capacity; in yoga_c630_psy_bat_get_property()
247 val->intval = ecbat->capacity_now; in yoga_c630_psy_bat_get_property()
250 val->intval = ecbat->current_now; in yoga_c630_psy_bat_get_property()
253 val->intval = ecbat->rate_now; in yoga_c630_psy_bat_get_property()
256 val->intval = ecbat->voltage_now; in yoga_c630_psy_bat_get_property()
259 val->intval = POWER_SUPPLY_TECHNOLOGY_LION; in yoga_c630_psy_bat_get_property()
262 val->strval = "PABAS0241231"; in yoga_c630_psy_bat_get_property()
265 val->strval = "Compal"; in yoga_c630_psy_bat_get_property()
268 val->intval = POWER_SUPPLY_SCOPE_SYSTEM; in yoga_c630_psy_bat_get_property()
328 union power_supply_propval *val) in yoga_c630_psy_adpt_get_property() argument
339 val->intval = ecbat->adapter_online; in yoga_c630_psy_adpt_get_property()
342 val->intval = POWER_SUPPLY_USB_TYPE_C; in yoga_c630_psy_adpt_get_property()