Lines Matching +full:usb +full:- +full:sdp
1 // SPDX-License-Identifier: GPL-2.0-only
51 [POWER_SUPPLY_TYPE_USB] = "USB",
64 [POWER_SUPPLY_USB_TYPE_SDP] = "SDP",
114 [POWER_SUPPLY_TECHNOLOGY_LION] = "Li-ion",
115 [POWER_SUPPLY_TECHNOLOGY_LIPO] = "Li-poly",
226 return to_ps_attr(attr) - power_supply_attrs; in dev_attr_psp()
239 for (i = 0; i < desc->num_usb_types; ++i) { in power_supply_show_usb_type()
240 usb_type = desc->usb_types[i]; in power_supply_show_usb_type()
242 if (value->intval == usb_type) { in power_supply_show_usb_type()
254 return -EINVAL; in power_supply_show_usb_type()
258 buf[count - 1] = '\n'; in power_supply_show_usb_type()
273 value.intval = psy->desc->type; in power_supply_show_property()
278 if (ret == -ENODATA) in power_supply_show_property()
280 attr->attr.name); in power_supply_show_property()
281 else if (ret != -ENODEV && ret != -EAGAIN) in power_supply_show_property()
284 attr->attr.name, ret); in power_supply_show_property()
289 if (ps_attr->text_values_len > 0 && in power_supply_show_property()
290 value.intval < ps_attr->text_values_len && value.intval >= 0) { in power_supply_show_property()
291 return sprintf(buf, "%s\n", ps_attr->text_values[value.intval]); in power_supply_show_property()
296 ret = power_supply_show_usb_type(dev, psy->desc, in power_supply_show_property()
318 ret = -EINVAL; in power_supply_store_property()
319 if (ps_attr->text_values_len > 0) { in power_supply_store_property()
320 ret = __sysfs_match_string(ps_attr->text_values, in power_supply_store_property()
321 ps_attr->text_values_len, buf); in power_supply_store_property()
362 for (i = 0; i < psy->desc->num_properties; i++) { in power_supply_attr_is_visible()
363 int property = psy->desc->properties[i]; in power_supply_attr_is_visible()
366 if (psy->desc->property_is_writeable && in power_supply_attr_is_visible()
367 psy->desc->property_is_writeable(psy, property) > 0) in power_supply_attr_is_visible()
399 dev_type->groups = power_supply_attr_groups; in power_supply_init_attrs()
414 attr->attr.name = power_supply_attrs[i].attr_name; in power_supply_init_attrs()
415 attr->show = power_supply_show_property; in power_supply_init_attrs()
416 attr->store = power_supply_store_property; in power_supply_init_attrs()
417 __power_supply_attrs[i] = &attr->attr; in power_supply_init_attrs()
430 dev_attr = &pwr_attr->dev_attr; in add_prop_uevent()
433 if (ret == -ENODEV || ret == -ENODATA) { in add_prop_uevent()
435 * When a battery is absent, we expect -ENODEV. Don't abort; in add_prop_uevent()
449 pwr_attr->prop_name, prop_buf); in add_prop_uevent()
458 if (!psy || !psy->desc) { in power_supply_uevent()
463 ret = add_uevent_var(env, "POWER_SUPPLY_NAME=%s", psy->desc->name); in power_supply_uevent()
469 return -ENOMEM; in power_supply_uevent()
475 for (j = 0; j < psy->desc->num_properties; j++) { in power_supply_uevent()
476 ret = add_prop_uevent(dev, env, psy->desc->properties[j], in power_supply_uevent()