Home
last modified time | relevance | path

Searched refs:psy (Results 1 – 25 of 154) sorted by relevance

1234567

/linux-6.12.1/drivers/power/supply/
Dpower_supply_leds.c24 struct power_supply *psy; member
36 power_supply_update_leds(psy_trig->psy); in power_supply_led_trigger_activate()
40 static int power_supply_register_led_trigger(struct power_supply *psy, in power_supply_register_led_trigger() argument
55 psy_trig->trig.name = kasprintf(GFP_KERNEL, name_template, psy->desc->name); in power_supply_register_led_trigger()
60 psy_trig->psy = psy; in power_supply_register_led_trigger()
92 static void power_supply_update_bat_leds(struct power_supply *psy) in power_supply_update_bat_leds() argument
98 if (power_supply_get_property(psy, POWER_SUPPLY_PROP_STATUS, &status)) in power_supply_update_bat_leds()
101 dev_dbg(&psy->dev, "%s %d\n", __func__, status.intval); in power_supply_update_bat_leds()
105 led_trigger_event(psy->trig, LED_FULL); in power_supply_update_bat_leds()
106 led_trigger_event(psy->charging_trig, LED_OFF); in power_supply_update_bat_leds()
[all …]
Dpower_supply_core.c71 struct power_supply *psy = data; in __power_supply_changed_work() local
74 if (__power_supply_is_supplied_by(psy, pst)) { in __power_supply_changed_work()
85 struct power_supply *psy = container_of(work, struct power_supply, in power_supply_changed_work() local
88 dev_dbg(&psy->dev, "%s\n", __func__); in power_supply_changed_work()
90 spin_lock_irqsave(&psy->changed_lock, flags); in power_supply_changed_work()
98 if (likely(psy->changed)) { in power_supply_changed_work()
99 psy->changed = false; in power_supply_changed_work()
100 spin_unlock_irqrestore(&psy->changed_lock, flags); in power_supply_changed_work()
101 power_supply_for_each_device(psy, __power_supply_changed_work); in power_supply_changed_work()
102 power_supply_update_leds(psy); in power_supply_changed_work()
[all …]
Dcollie_battery.c30 struct power_supply *psy; member
93 static int collie_bat_get_property(struct power_supply *psy, in collie_bat_get_property() argument
98 struct collie_bat *bat = power_supply_get_drvdata(psy); in collie_bat_get_property()
140 static void collie_bat_external_power_changed(struct power_supply *psy) in collie_bat_external_power_changed() argument
155 struct power_supply *psy = bat->psy; in collie_bat_update() local
162 printk(KERN_NOTICE "%s not present\n", psy->desc->name); in collie_bat_update()
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,
[all …]
Dip5xxx_power.c114 static int ip5xxx_initialize(struct power_supply *psy) in ip5xxx_initialize() argument
116 struct ip5xxx *ip5xxx = power_supply_get_drvdata(psy); in ip5xxx_initialize()
165 dev_dbg(psy->dev.parent, "Initialized after power on\n"); in ip5xxx_initialize()
312 static int ip5xxx_battery_get_property(struct power_supply *psy, in ip5xxx_battery_get_property() argument
316 struct ip5xxx *ip5xxx = power_supply_get_drvdata(psy); in ip5xxx_battery_get_property()
320 ret = ip5xxx_initialize(psy); in ip5xxx_battery_get_property()
430 static int ip5xxx_battery_set_property(struct power_supply *psy, in ip5xxx_battery_set_property() argument
434 struct ip5xxx *ip5xxx = power_supply_get_drvdata(psy); in ip5xxx_battery_set_property()
438 ret = ip5xxx_initialize(psy); in ip5xxx_battery_set_property()
480 static int ip5xxx_battery_property_is_writeable(struct power_supply *psy, in ip5xxx_battery_property_is_writeable() argument
[all …]
Dug3105_battery.c71 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()
232 chip->supplied = power_supply_am_i_supplied(psy); in ug3105_work()
283 if (chip->status != prev_status && psy) in ug3105_work()
284 power_supply_changed(psy); in ug3105_work()
298 static int ug3105_get_property(struct power_supply *psy, in ug3105_get_property() argument
302 struct ug3105_chip *chip = power_supply_get_drvdata(psy); in ug3105_get_property()
307 if (!chip->psy) { in ug3105_get_property()
[all …]
Dlp8727_charger.c88 struct lp8727_psy *psy; member
241 power_supply_changed(pchg->psy->ac); in lp8727_delayed_func()
242 power_supply_changed(pchg->psy->usb); in lp8727_delayed_func()
243 power_supply_changed(pchg->psy->batt); in lp8727_delayed_func()
306 static int lp8727_charger_get_property(struct power_supply *psy, in lp8727_charger_get_property() argument
310 struct lp8727_chg *pchg = dev_get_drvdata(psy->dev.parent); in lp8727_charger_get_property()
315 val->intval = lp8727_is_charger_attached(psy->desc->name, pchg->devid); in lp8727_charger_get_property()
332 static int lp8727_battery_get_property(struct power_supply *psy, in lp8727_battery_get_property() argument
336 struct lp8727_chg *pchg = dev_get_drvdata(psy->dev.parent); in lp8727_battery_get_property()
343 if (!lp8727_is_charger_attached(psy->desc->name, pchg->devid)) { in lp8727_battery_get_property()
[all …]
Dpower_supply_hwmon.c12 struct power_supply *psy; member
190 if (power_supply_property_is_writeable(psyhw->psy, prop) > 0 && in power_supply_hwmon_is_visible()
224 struct power_supply *psy = psyhw->psy; in power_supply_hwmon_read() local
232 ret = power_supply_get_property(psy, prop, &pspval); in power_supply_hwmon_read()
273 struct power_supply *psy = psyhw->psy; in power_supply_hwmon_write() local
305 return power_supply_set_property(psy, prop, &pspval); in power_supply_hwmon_write()
351 int power_supply_add_hwmon_sysfs(struct power_supply *psy) in power_supply_add_hwmon_sysfs() argument
353 const struct power_supply_desc *desc = psy->desc; in power_supply_add_hwmon_sysfs()
355 struct device *dev = &psy->dev; in power_supply_add_hwmon_sysfs()
370 psyhw->psy = psy; in power_supply_add_hwmon_sysfs()
[all …]
Dpower_supply.h32 extern void power_supply_update_leds(struct power_supply *psy);
33 extern int power_supply_create_triggers(struct power_supply *psy);
34 extern void power_supply_remove_triggers(struct power_supply *psy);
38 static inline void power_supply_update_leds(struct power_supply *psy) {} in power_supply_update_leds() argument
39 static inline int power_supply_create_triggers(struct power_supply *psy) in power_supply_create_triggers() argument
41 static inline void power_supply_remove_triggers(struct power_supply *psy) {} in power_supply_remove_triggers() argument
Dds2781_battery.c48 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()
377 static int ds2781_battery_get_property(struct power_supply *psy, in ds2781_battery_get_property() argument
382 struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); in ds2781_battery_get_property()
451 struct power_supply *psy = to_power_supply(dev); in ds2781_get_pmod_enabled() local
452 struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); in ds2781_get_pmod_enabled()
470 struct power_supply *psy = to_power_supply(dev); in ds2781_set_pmod_enabled() local
471 struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); in ds2781_set_pmod_enabled()
505 struct power_supply *psy = to_power_supply(dev); in ds2781_get_sense_resistor_value() local
506 struct ds2781_device_info *dev_info = to_ds2781_device_info(psy); in ds2781_get_sense_resistor_value()
[all …]
Dds2780_battery.c50 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()
375 static int ds2780_battery_get_property(struct power_supply *psy, in ds2780_battery_get_property() argument
380 struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); in ds2780_battery_get_property()
449 struct power_supply *psy = to_power_supply(dev); in ds2780_get_pmod_enabled() local
450 struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); in ds2780_get_pmod_enabled()
468 struct power_supply *psy = to_power_supply(dev); in ds2780_set_pmod_enabled() local
469 struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); in ds2780_set_pmod_enabled()
503 struct power_supply *psy = to_power_supply(dev); in ds2780_get_sense_resistor_value() local
504 struct ds2780_device_info *dev_info = to_ds2780_device_info(psy); in ds2780_get_sense_resistor_value()
[all …]
Dpower_supply_sysfs.c275 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_show_property() local
281 value.intval = psy->desc->type; in power_supply_show_property()
283 ret = power_supply_get_property(psy, psp, &value); in power_supply_show_property()
303 psy->desc->usb_types, value.intval, buf); in power_supply_show_property()
306 ret = power_supply_charge_behaviour_show(dev, psy->desc->charge_behaviours, in power_supply_show_property()
328 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_store_property() local
355 ret = power_supply_set_property(psy, psp, &value); in power_supply_store_property()
367 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_attr_is_visible() local
377 for (i = 0; i < psy->desc->num_properties; i++) { in power_supply_attr_is_visible()
378 int property = psy->desc->properties[i]; in power_supply_attr_is_visible()
[all …]
Dgeneric-adc-battery.c45 struct power_supply *psy; member
53 static struct gab *to_generic_bat(struct power_supply *psy) in to_generic_bat() argument
55 return power_supply_get_drvdata(psy); in to_generic_bat()
58 static void gab_ext_power_changed(struct power_supply *psy) in gab_ext_power_changed() argument
60 struct gab *adc_bat = to_generic_bat(psy); in gab_ext_power_changed()
94 dev_err(&adc_bat->psy->dev, "read channel error: %d\n", ret); in gab_read_channel()
101 static int gab_get_property(struct power_supply *psy, in gab_get_property() argument
104 struct gab *adc_bat = to_generic_bat(psy); in gab_get_property()
133 if (!power_supply_am_i_supplied(adc_bat->psy)) in gab_work()
141 power_supply_changed(adc_bat->psy); in gab_work()
[all …]
Dwilco-charger.c86 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()
Dlego_ev3_battery.c31 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()
D88pm860x_charger.c285 struct power_supply *psy; in set_charging_fsm() local
293 psy = power_supply_get_by_name(pm860x_supplied_to[0]); in set_charging_fsm()
294 if (!psy) in set_charging_fsm()
296 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, in set_charging_fsm()
299 power_supply_put(psy); in set_charging_fsm()
304 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); 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
433 psy = power_supply_get_by_name(pm860x_supplied_to[0]); in pm860x_temp_handler()
[all …]
Dacer_a500_battery.c58 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()
Dltc4162-l-charger.c507 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
536 struct ltc4162l_info *info = power_supply_get_drvdata(psy); in vbat_show()
551 struct power_supply *psy = to_power_supply(dev); in vbat_avg_show() local
552 struct ltc4162l_info *info = power_supply_get_drvdata(psy); in vbat_avg_show()
567 struct power_supply *psy = to_power_supply(dev); in ibat_show() local
568 struct ltc4162l_info *info = power_supply_get_drvdata(psy); in ibat_show()
583 struct power_supply *psy = to_power_supply(dev); in force_telemetry_show() local
584 struct ltc4162l_info *info = power_supply_get_drvdata(psy); in force_telemetry_show()
[all …]
Drt5033_battery.c19 struct power_supply *psy; member
28 ret = power_supply_get_property_from_supplier(battery->psy, in rt5033_battery_get_status()
90 static int rt5033_battery_get_property(struct power_supply *psy, in rt5033_battery_get_property() argument
94 struct rt5033_battery *battery = power_supply_get_drvdata(psy); in rt5033_battery_get_property()
166 battery->psy = devm_power_supply_register(&client->dev, in rt5033_battery_probe()
169 if (IS_ERR(battery->psy)) in rt5033_battery_probe()
170 return dev_err_probe(&client->dev, PTR_ERR(battery->psy), in rt5033_battery_probe()
Dcros_usbpd-charger.c33 struct power_supply *psy; member
292 power_supply_changed(port->psy); in cros_usbpd_charger_get_power_info()
338 static void cros_usbpd_charger_power_changed(struct power_supply *psy) in cros_usbpd_charger_power_changed() argument
340 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_power_changed()
348 static int cros_usbpd_charger_get_prop(struct power_supply *psy, in cros_usbpd_charger_get_prop() argument
352 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_get_prop()
435 static int cros_usbpd_charger_set_prop(struct power_supply *psy, in cros_usbpd_charger_set_prop() argument
439 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_set_prop()
493 static int cros_usbpd_charger_property_is_writeable(struct power_supply *psy, in cros_usbpd_charger_property_is_writeable() argument
517 cros_usbpd_charger_power_changed(charger->ports[0]->psy); in cros_usbpd_charger_ec_event()
[all …]
Dsbs-manager.c42 struct power_supply *psy; member
92 static int sbsm_get_property(struct power_supply *psy, in sbsm_get_property() argument
96 struct sbsm_data *data = power_supply_get_drvdata(psy); in sbsm_get_property()
135 static int sbsm_prop_is_writeable(struct power_supply *psy, in sbsm_prop_is_writeable() argument
138 struct sbsm_data *data = power_supply_get_drvdata(psy); in sbsm_prop_is_writeable()
143 static int sbsm_set_property(struct power_supply *psy, in sbsm_set_property() argument
147 struct sbsm_data *data = power_supply_get_drvdata(psy); in sbsm_set_property()
255 power_supply_changed(sbsm->psy); in sbsm_alert()
383 data->psy = devm_power_supply_register(dev, psy_desc, &psy_cfg); in sbsm_probe()
384 if (IS_ERR(data->psy)) in sbsm_probe()
[all …]
/linux-6.12.1/include/linux/
Dpower_supply.h256 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);
769 extern void power_supply_put(struct power_supply *psy);
771 static inline void power_supply_put(struct power_supply *psy) {} in power_supply_put() argument
791 extern int power_supply_get_battery_info(struct power_supply *psy,
793 extern void power_supply_put_battery_info(struct power_supply *psy,
816 extern void power_supply_changed(struct power_supply *psy);
[all …]
/linux-6.12.1/drivers/mfd/
Dab8500-sysctrl.c37 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.12.1/drivers/hid/
Dhid-input-test.c33 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.12.1/arch/x86/platform/olpc/
Dolpc-xo15-sci.c78 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.12.1/drivers/usb/typec/ucsi/
Dpsy.c227 static int ucsi_psy_get_prop(struct power_supply *psy, in ucsi_psy_get_prop() argument
231 struct ucsi_connector *con = power_supply_get_drvdata(psy); in ucsi_psy_get_prop()
280 con->psy = power_supply_register(dev, &con->psy_desc, &psy_cfg); in ucsi_register_port_psy()
282 return PTR_ERR_OR_ZERO(con->psy); in ucsi_register_port_psy()
287 if (IS_ERR_OR_NULL(con->psy)) in ucsi_unregister_port_psy()
290 power_supply_unregister(con->psy); in ucsi_unregister_port_psy()
291 con->psy = NULL; in ucsi_unregister_port_psy()
296 if (IS_ERR_OR_NULL(con->psy)) in ucsi_port_psy_changed()
299 power_supply_changed(con->psy); in ucsi_port_psy_changed()

1234567