Lines Matching +full:li +full:- +full:ion

1 // SPDX-License-Identifier: GPL-2.0-only
116 [POWER_SUPPLY_TECHNOLOGY_LION] = "Li-ion",
117 [POWER_SUPPLY_TECHNOLOGY_LIPO] = "Li-poly",
140 [POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE] = "inhibit-charge",
141 [POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE] = "force-discharge",
236 return to_ps_attr(attr) - power_supply_attrs; in dev_attr_psp()
249 for (i = 0; i < desc->num_usb_types; ++i) { in power_supply_show_usb_type()
250 usb_type = desc->usb_types[i]; in power_supply_show_usb_type()
252 if (value->intval == usb_type) { in power_supply_show_usb_type()
264 return -EINVAL; in power_supply_show_usb_type()
268 buf[count - 1] = '\n'; in power_supply_show_usb_type()
283 value.intval = psy->desc->type; in power_supply_show_property()
288 if (ret == -ENODATA) in power_supply_show_property()
291 attr->attr.name); in power_supply_show_property()
292 else if (ret != -ENODEV && ret != -EAGAIN) in power_supply_show_property()
295 attr->attr.name, ret); in power_supply_show_property()
300 if (ps_attr->text_values_len > 0 && in power_supply_show_property()
301 value.intval < ps_attr->text_values_len && value.intval >= 0) { in power_supply_show_property()
302 return sysfs_emit(buf, "%s\n", ps_attr->text_values[value.intval]); in power_supply_show_property()
307 ret = power_supply_show_usb_type(dev, psy->desc, in power_supply_show_property()
329 ret = -EINVAL; in power_supply_store_property()
330 if (ps_attr->text_values_len > 0) { in power_supply_store_property()
331 ret = __sysfs_match_string(ps_attr->text_values, in power_supply_store_property()
332 ps_attr->text_values_len, buf); in power_supply_store_property()
373 for (i = 0; i < psy->desc->num_properties; i++) { in power_supply_attr_is_visible()
374 int property = psy->desc->properties[i]; in power_supply_attr_is_visible()
377 if (psy->desc->property_is_writeable && in power_supply_attr_is_visible()
378 psy->desc->property_is_writeable(psy, property) > 0) in power_supply_attr_is_visible()
385 if (power_supply_battery_info_has_prop(psy->battery_info, attrno)) in power_supply_attr_is_visible()
413 dev_type->groups = power_supply_attr_groups; in power_supply_init_attrs()
428 attr->attr.name = power_supply_attrs[i].attr_name; in power_supply_init_attrs()
429 attr->show = power_supply_show_property; in power_supply_init_attrs()
430 attr->store = power_supply_store_property; in power_supply_init_attrs()
431 __power_supply_attrs[i] = &attr->attr; in power_supply_init_attrs()
444 dev_attr = &pwr_attr->dev_attr; in add_prop_uevent()
447 if (ret == -ENODEV || ret == -ENODATA) { in add_prop_uevent()
449 * When a battery is absent, we expect -ENODEV. Don't abort; in add_prop_uevent()
463 pwr_attr->prop_name, prop_buf); in add_prop_uevent()
476 if (!psy || !psy->desc) { in power_supply_uevent()
481 ret = add_uevent_var(env, "POWER_SUPPLY_NAME=%s", psy->desc->name); in power_supply_uevent()
487 * resources have been freed. Exit early to avoid use-after-free. in power_supply_uevent()
489 if (psy->removing) in power_supply_uevent()
494 return -ENOMEM; in power_supply_uevent()
500 for (j = 0; j < psy->desc->num_properties; j++) { in power_supply_uevent()
501 set_bit(psy->desc->properties[j], psy_drv_properties); in power_supply_uevent()
502 ret = add_prop_uevent(dev, env, psy->desc->properties[j], in power_supply_uevent()
511 if (!power_supply_battery_info_has_prop(psy->battery_info, in power_supply_uevent()
551 return -EINVAL; in power_supply_charge_behaviour_show()
555 buf[count - 1] = '\n'; in power_supply_charge_behaviour_show()
571 return -EINVAL; in power_supply_charge_behaviour_parse()