/linux-6.3-rc2/drivers/power/supply/ |
A D | power_supply_leds.c | 67 if (!psy->charging_trig_name) in power_supply_create_bat_triggers() 70 psy->full_trig_name = kasprintf(GFP_KERNEL, "%s-full", psy->desc->name); in power_supply_create_bat_triggers() 71 if (!psy->full_trig_name) in power_supply_create_bat_triggers() 82 &psy->charging_trig); in power_supply_create_bat_triggers() 84 &psy->full_trig); in power_supply_create_bat_triggers() 91 kfree(psy->full_trig_name); in power_supply_create_bat_triggers() 107 kfree(psy->full_trig_name); in power_supply_remove_bat_triggers() 132 psy->desc->name); in power_supply_create_gen_triggers() 133 if (!psy->online_trig_name) in power_supply_create_gen_triggers() 136 led_trigger_register_simple(psy->online_trig_name, &psy->online_trig); in power_supply_create_gen_triggers() [all …]
|
A D | power_supply_core.c | 238 if (psy->supplied_from && psy->num_supplies > 0) in power_supply_check_supplies() 266 psy->supplied_from = devm_kzalloc(&psy->dev, sizeof(*psy->supplied_from), in power_supply_check_supplies() 271 *psy->supplied_from = devm_kcalloc(&psy->dev, in power_supply_check_supplies() 402 .psy = psy, in power_supply_get_property_from_supplier() 428 psy->desc->set_charged(psy); in power_supply_set_battery_charged() 1059 return psy->desc->get_property(psy, psp, val); in power_supply_get_property() 1070 return psy->desc->set_property(psy, psp, val); in power_supply_set_property() 1081 return psy->desc->property_is_writeable(psy, psp); in power_supply_property_is_writeable() 1091 psy->desc->external_power_changed(psy); in power_supply_external_power_changed() 1221 psy = kzalloc(sizeof(*psy), GFP_KERNEL); in __power_supply_register() [all …]
|
A D | lp8727_charger.c | 88 struct lp8727_psy *psy; member 445 struct lp8727_psy *psy; in lp8727_register_psy() local 447 psy = devm_kzalloc(pchg->dev, sizeof(*psy), GFP_KERNEL); in lp8727_register_psy() 448 if (!psy) in lp8727_register_psy() 451 pchg->psy = psy; in lp8727_register_psy() 457 if (IS_ERR(psy->ac)) in lp8727_register_psy() 462 if (IS_ERR(psy->usb)) in lp8727_register_psy() 466 if (IS_ERR(psy->batt)) in lp8727_register_psy() 474 power_supply_unregister(psy->ac); in lp8727_register_psy() 481 struct lp8727_psy *psy = pchg->psy; in lp8727_unregister_psy() local [all …]
|
A D | collie_battery.c | 30 struct power_supply *psy; member 155 struct power_supply *psy = bat->psy; in collie_bat_update() local 165 } else if (power_supply_am_i_supplied(psy)) { in collie_bat_update() 188 power_supply_changed(psy); in collie_bat_update() 233 .psy = NULL, 263 .psy = NULL, 393 if (IS_ERR(collie_bat_main.psy)) { in collie_bat_probe() 394 ret = PTR_ERR(collie_bat_main.psy); in collie_bat_probe() 402 if (IS_ERR(collie_bat_bu.psy)) { in collie_bat_probe() 403 ret = PTR_ERR(collie_bat_bu.psy); in collie_bat_probe() [all …]
|
A D | ip5xxx_power.c | 114 static int ip5xxx_initialize(struct power_supply *psy) in ip5xxx_initialize() argument 116 struct ip5xxx *ip5xxx = power_supply_get_drvdata(psy); in ip5xxx_initialize() 320 ret = ip5xxx_initialize(psy); in ip5xxx_battery_get_property() 438 ret = ip5xxx_initialize(psy); in ip5xxx_battery_set_property() 512 ret = ip5xxx_initialize(psy); in ip5xxx_boost_get_property() 547 ret = ip5xxx_initialize(psy); in ip5xxx_boost_set_property() 593 struct power_supply *psy; in ip5xxx_power_probe() local 608 if (IS_ERR(psy)) in ip5xxx_power_probe() 609 return PTR_ERR(psy); in ip5xxx_power_probe() 612 if (IS_ERR(psy)) in ip5xxx_power_probe() [all …]
|
A D | ug3105_battery.c | 71 struct power_supply *psy; member 185 struct power_supply *psy; in ug3105_work() local 189 psy = chip->psy; in ug3105_work() 190 if (!psy) in ug3105_work() 283 if (chip->status != prev_status && psy) in ug3105_work() 284 power_supply_changed(psy); in ug3105_work() 307 if (!chip->psy) { in ug3105_get_property() 389 struct power_supply *psy; in ug3105_probe() local 405 if (IS_ERR(psy)) in ug3105_probe() 406 return PTR_ERR(psy); in ug3105_probe() [all …]
|
A D | power_supply_hwmon.c | 12 struct power_supply *psy; member 210 struct power_supply *psy = psyhw->psy; in power_supply_hwmon_read() local 218 ret = power_supply_get_property(psy, prop, &pspval); in power_supply_hwmon_read() 254 struct power_supply *psy = psyhw->psy; in power_supply_hwmon_write() local 286 return power_supply_set_property(psy, prop, &pspval); in power_supply_hwmon_write() 327 int power_supply_add_hwmon_sysfs(struct power_supply *psy) in power_supply_add_hwmon_sysfs() argument 329 const struct power_supply_desc *desc = psy->desc; in power_supply_add_hwmon_sysfs() 331 struct device *dev = &psy->dev; in power_supply_add_hwmon_sysfs() 346 psyhw->psy = psy; in power_supply_add_hwmon_sysfs() 381 name = psy->desc->name; in power_supply_add_hwmon_sysfs() [all …]
|
A D | power_supply.h | 30 extern void power_supply_update_leds(struct power_supply *psy); 31 extern int power_supply_create_triggers(struct power_supply *psy); 32 extern void power_supply_remove_triggers(struct power_supply *psy); 36 static inline void power_supply_update_leds(struct power_supply *psy) {} in power_supply_update_leds() argument 37 static inline int power_supply_create_triggers(struct power_supply *psy) in power_supply_create_triggers() argument 39 static inline void power_supply_remove_triggers(struct power_supply *psy) {} in power_supply_remove_triggers() argument
|
A D | ds2780_battery.c | 50 to_ds2780_device_info(struct power_supply *psy) in to_ds2780_device_info() argument 52 return power_supply_get_drvdata(psy); in to_ds2780_device_info() 449 struct power_supply *psy = to_power_supply(dev); in ds2780_get_pmod_enabled() local 468 struct power_supply *psy = to_power_supply(dev); in ds2780_set_pmod_enabled() local 503 struct power_supply *psy = to_power_supply(dev); in ds2780_get_sense_resistor_value() local 521 struct power_supply *psy = to_power_supply(dev); in ds2780_set_sense_resistor_value() local 541 struct power_supply *psy = to_power_supply(dev); in ds2780_get_rsgain_setting() local 558 struct power_supply *psy = to_power_supply(dev); in ds2780_set_rsgain_setting() local 584 struct power_supply *psy = to_power_supply(dev); in ds2780_get_pio_pin() local 602 struct power_supply *psy = to_power_supply(dev); in ds2780_set_pio_pin() local [all …]
|
A D | ds2781_battery.c | 48 to_ds2781_device_info(struct power_supply *psy) in to_ds2781_device_info() argument 50 return power_supply_get_drvdata(psy); in to_ds2781_device_info() 451 struct power_supply *psy = to_power_supply(dev); in ds2781_get_pmod_enabled() local 470 struct power_supply *psy = to_power_supply(dev); in ds2781_set_pmod_enabled() local 505 struct power_supply *psy = to_power_supply(dev); in ds2781_get_sense_resistor_value() local 523 struct power_supply *psy = to_power_supply(dev); in ds2781_set_sense_resistor_value() local 543 struct power_supply *psy = to_power_supply(dev); in ds2781_get_rsgain_setting() local 560 struct power_supply *psy = to_power_supply(dev); in ds2781_set_rsgain_setting() local 586 struct power_supply *psy = to_power_supply(dev); in ds2781_get_pio_pin() local 604 struct power_supply *psy = to_power_supply(dev); in ds2781_set_pio_pin() local [all …]
|
A D | generic-adc-battery.c | 47 struct power_supply *psy; member 60 return power_supply_get_drvdata(psy); in to_generic_bat() 65 struct gab *adc_bat = to_generic_bat(psy); in gab_ext_power_changed() 141 static int gab_get_property(struct power_supply *psy, in gab_get_property() argument 150 adc_bat = to_generic_bat(psy); in gab_get_property() 152 dev_err(&psy->dev, "no battery infos ?!\n"); in gab_get_property() 220 power_supply_changed(adc_bat->psy); in gab_work() 320 if (IS_ERR(adc_bat->psy)) { in gab_probe() 321 ret = PTR_ERR(adc_bat->psy); in gab_probe() 348 power_supply_unregister(adc_bat->psy); in gab_probe() [all …]
|
A D | power_supply_sysfs.c | 276 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_show_property() local 282 value.intval = psy->desc->type; in power_supply_show_property() 305 ret = power_supply_show_usb_type(dev, psy->desc, in power_supply_show_property() 322 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_store_property() local 361 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_attr_is_visible() local 371 for (i = 0; i < psy->desc->num_properties; i++) { in power_supply_attr_is_visible() 372 int property = psy->desc->properties[i]; in power_supply_attr_is_visible() 375 if (psy->desc->property_is_writeable && in power_supply_attr_is_visible() 376 psy->desc->property_is_writeable(psy, property) > 0) in power_supply_attr_is_visible() 467 if (!psy || !psy->desc) { in power_supply_uevent() [all …]
|
A D | wilco-charger.c | 86 static int wilco_charge_get_property(struct power_supply *psy, in wilco_charge_get_property() argument 90 struct wilco_ec_device *ec = power_supply_get_drvdata(psy); in wilco_charge_get_property() 123 static int wilco_charge_set_property(struct power_supply *psy, in wilco_charge_set_property() argument 127 struct wilco_ec_device *ec = power_supply_get_drvdata(psy); in wilco_charge_set_property() 153 static int wilco_charge_property_is_writeable(struct power_supply *psy, in wilco_charge_property_is_writeable() argument 173 struct power_supply *psy; in wilco_charge_probe() local 176 psy = devm_power_supply_register(&pdev->dev, &wilco_ps_desc, &psy_cfg); in wilco_charge_probe() 178 return PTR_ERR_OR_ZERO(psy); in wilco_charge_probe()
|
A D | lego_ev3_battery.c | 31 struct power_supply *psy; member 37 static int lego_ev3_battery_get_property(struct power_supply *psy, in lego_ev3_battery_get_property() argument 41 struct lego_ev3_battery *batt = power_supply_get_drvdata(psy); in lego_ev3_battery_get_property() 91 static int lego_ev3_battery_set_property(struct power_supply *psy, in lego_ev3_battery_set_property() argument 95 struct lego_ev3_battery *batt = power_supply_get_drvdata(psy); in lego_ev3_battery_set_property() 126 static int lego_ev3_battery_property_is_writeable(struct power_supply *psy, in lego_ev3_battery_property_is_writeable() argument 129 struct lego_ev3_battery *batt = power_supply_get_drvdata(psy); in lego_ev3_battery_property_is_writeable() 204 batt->psy = devm_power_supply_register(dev, &lego_ev3_battery_desc, in lego_ev3_battery_probe() 206 err = PTR_ERR_OR_ZERO(batt->psy); in lego_ev3_battery_probe()
|
A D | 88pm860x_charger.c | 285 struct power_supply *psy; in set_charging_fsm() local 294 if (!psy) in set_charging_fsm() 299 power_supply_put(psy); in set_charging_fsm() 306 power_supply_put(psy); in set_charging_fsm() 309 power_supply_put(psy); in set_charging_fsm() 427 struct power_supply *psy; in pm860x_temp_handler() local 434 if (!psy) in pm860x_temp_handler() 452 power_supply_put(psy); in pm860x_temp_handler() 472 struct power_supply *psy; in pm860x_done_handler() local 490 if (!psy) in pm860x_done_handler() [all …]
|
A D | acer_a500_battery.c | 58 struct power_supply *psy; member 86 if (power_supply_am_i_supplied(bat->psy)) in a500_battery_get_status() 145 static int a500_battery_get_property(struct power_supply *psy, in a500_battery_get_property() argument 149 struct a500_battery *bat = power_supply_get_drvdata(psy); in a500_battery_get_property() 150 struct device *dev = psy->dev.parent; in a500_battery_get_property() 208 power_supply_changed(bat->psy); in a500_battery_poll_work() 241 bat->psy = devm_power_supply_register_no_ws(&pdev->dev, in a500_battery_probe() 244 if (IS_ERR(bat->psy)) in a500_battery_probe() 245 return dev_err_probe(&pdev->dev, PTR_ERR(bat->psy), in a500_battery_probe()
|
A D | ltc4162-l-charger.c | 507 struct power_supply *psy = to_power_supply(dev); in charge_status_show() local 508 struct ltc4162l_info *info = power_supply_get_drvdata(psy); in charge_status_show() 535 struct power_supply *psy = to_power_supply(dev); in vbat_show() local 551 struct power_supply *psy = to_power_supply(dev); in vbat_avg_show() local 567 struct power_supply *psy = to_power_supply(dev); in ibat_show() local 583 struct power_supply *psy = to_power_supply(dev); in force_telemetry_show() local 600 struct power_supply *psy = to_power_supply(dev); in force_telemetry_store() local 622 struct power_supply *psy = to_power_supply(dev); in arm_ship_mode_show() local 640 struct power_supply *psy = to_power_supply(dev); in arm_ship_mode_store() local 679 static int ltc4162l_get_property(struct power_supply *psy, in ltc4162l_get_property() argument [all …]
|
A D | twl4030_madc_battery.c | 25 struct power_supply *psy; member 107 static int twl4030_madc_bat_get_property(struct power_supply *psy, in twl4030_madc_bat_get_property() argument 111 struct twl4030_madc_battery *bat = power_supply_get_drvdata(psy); in twl4030_madc_bat_get_property() 171 static void twl4030_madc_bat_ext_changed(struct power_supply *psy) in twl4030_madc_bat_ext_changed() argument 173 power_supply_changed(psy); in twl4030_madc_bat_ext_changed() 233 twl4030_madc_bat->psy = power_supply_register(&pdev->dev, in twl4030_madc_battery_probe() 236 if (IS_ERR(twl4030_madc_bat->psy)) { in twl4030_madc_battery_probe() 237 ret = PTR_ERR(twl4030_madc_bat->psy); in twl4030_madc_battery_probe() 257 power_supply_unregister(bat->psy); in twl4030_madc_battery_remove()
|
A D | cros_usbpd-charger.c | 32 struct power_supply *psy; member 302 power_supply_changed(port->psy); in cros_usbpd_charger_get_power_info() 350 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_power_changed() 362 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_get_prop() 449 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_set_prop() 527 cros_usbpd_charger_power_changed(charger->ports[0]->psy); in cros_usbpd_charger_ec_event() 545 struct power_supply *psy; in cros_usbpd_charger_probe() local 652 psy = devm_power_supply_register_no_ws(dev, psy_desc, in cros_usbpd_charger_probe() 654 if (IS_ERR(psy)) { in cros_usbpd_charger_probe() 658 port->psy = psy; in cros_usbpd_charger_probe() [all …]
|
A D | cros_peripheral_charger.c | 29 struct power_supply *psy; member 168 power_supply_changed(port->psy); in cros_pchg_get_status() 194 static int cros_pchg_get_prop(struct power_supply *psy, in cros_pchg_get_prop() argument 198 struct port_data *port = power_supply_get_drvdata(psy); in cros_pchg_get_prop() 269 struct power_supply *psy; in cros_pchg_probe() local 330 psy = devm_power_supply_register(dev, psy_desc, &psy_cfg); in cros_pchg_probe() 331 if (IS_ERR(psy)) in cros_pchg_probe() 332 return dev_err_probe(dev, PTR_ERR(psy), in cros_pchg_probe() 334 port->psy = psy; in cros_pchg_probe()
|
/linux-6.3-rc2/include/linux/ |
A D | power_supply.h | 256 int (*get_property)(struct power_supply *psy, 259 int (*set_property)(struct power_supply *psy, 267 int (*property_is_writeable)(struct power_supply *psy, 269 void (*external_power_changed)(struct power_supply *psy); 270 void (*set_charged)(struct power_supply *psy); 774 extern void power_supply_put(struct power_supply *psy); 814 extern void power_supply_changed(struct power_supply *psy); 851 extern int power_supply_get_property(struct power_supply *psy, 855 extern int power_supply_set_property(struct power_supply *psy, 884 extern void power_supply_unregister(struct power_supply *psy); [all …]
|
/linux-6.3-rc2/drivers/mfd/ |
A D | ab8500-sysctrl.c | 37 struct power_supply *psy; in ab8500_power_off() local 51 psy = power_supply_get_by_name(pss[i]); in ab8500_power_off() 52 if (!psy) in ab8500_power_off() 55 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE, in ab8500_power_off() 57 power_supply_put(psy); in ab8500_power_off() 69 psy = power_supply_get_by_name("ab8500_btemp"); in ab8500_power_off() 70 if (psy) { in ab8500_power_off() 71 ret = power_supply_get_property(psy, in ab8500_power_off() 79 power_supply_put(psy); in ab8500_power_off()
|
/linux-6.3-rc2/drivers/hid/ |
A D | hid-input-test.c | 33 struct power_supply *psy; in hid_test_input_get_battery_property() local 42 psy = kunit_kzalloc(test, sizeof(*psy), GFP_KERNEL); in hid_test_input_get_battery_property() 43 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, psy); in hid_test_input_get_battery_property() 44 psy->drv_data = dev; in hid_test_input_get_battery_property() 48 ret = hidinput_get_battery_property(psy, POWER_SUPPLY_PROP_STATUS, &val); in hid_test_input_get_battery_property() 54 ret = hidinput_get_battery_property(psy, POWER_SUPPLY_PROP_STATUS, &val); in hid_test_input_get_battery_property() 60 ret = hidinput_get_battery_property(psy, POWER_SUPPLY_PROP_STATUS, &val); in hid_test_input_get_battery_property()
|
/linux-6.3-rc2/arch/x86/platform/olpc/ |
A D | olpc-xo15-sci.c | 78 struct power_supply *psy = power_supply_get_by_name("olpc_battery"); in battery_status_changed() local 80 if (psy) { in battery_status_changed() 81 power_supply_changed(psy); in battery_status_changed() 82 power_supply_put(psy); in battery_status_changed() 88 struct power_supply *psy = power_supply_get_by_name("olpc_ac"); in ac_status_changed() local 90 if (psy) { in ac_status_changed() 91 power_supply_changed(psy); in ac_status_changed() 92 power_supply_put(psy); in ac_status_changed()
|
/linux-6.3-rc2/drivers/usb/typec/ucsi/ |
A D | psy.c | 176 static int ucsi_psy_get_prop(struct power_supply *psy, in ucsi_psy_get_prop() argument 180 struct ucsi_connector *con = power_supply_get_drvdata(psy); in ucsi_psy_get_prop() 230 con->psy = power_supply_register(dev, &con->psy_desc, &psy_cfg); in ucsi_register_port_psy() 232 return PTR_ERR_OR_ZERO(con->psy); in ucsi_register_port_psy() 237 if (IS_ERR_OR_NULL(con->psy)) in ucsi_unregister_port_psy() 240 power_supply_unregister(con->psy); in ucsi_unregister_port_psy() 241 con->psy = NULL; in ucsi_unregister_port_psy() 246 if (IS_ERR_OR_NULL(con->psy)) in ucsi_port_psy_changed() 249 power_supply_changed(con->psy); in ucsi_port_psy_changed()
|