/drivers/power/supply/ |
D | power_supply_leds.c | 22 static void power_supply_update_bat_leds(struct power_supply *psy) in power_supply_update_bat_leds() argument 26 if (power_supply_get_property(psy, POWER_SUPPLY_PROP_STATUS, &status)) in power_supply_update_bat_leds() 29 dev_dbg(&psy->dev, "%s %d\n", __func__, status.intval); in power_supply_update_bat_leds() 33 led_trigger_event(psy->charging_full_trig, LED_FULL); in power_supply_update_bat_leds() 34 led_trigger_event(psy->charging_trig, LED_OFF); in power_supply_update_bat_leds() 35 led_trigger_event(psy->full_trig, LED_FULL); in power_supply_update_bat_leds() 37 led_trigger_event(psy->charging_blink_full_solid_trig, LED_OFF); in power_supply_update_bat_leds() 38 led_trigger_event(psy->charging_blink_full_solid_trig, LED_FULL); in power_supply_update_bat_leds() 41 led_trigger_event(psy->charging_full_trig, LED_FULL); in power_supply_update_bat_leds() 42 led_trigger_event(psy->charging_trig, LED_FULL); in power_supply_update_bat_leds() [all …]
|
D | power_supply_core.c | 39 struct power_supply **psy; member 74 struct power_supply *psy = data; in __power_supply_changed_work() local 77 if (__power_supply_is_supplied_by(psy, pst)) { in __power_supply_changed_work() 88 struct power_supply *psy = container_of(work, struct power_supply, in power_supply_changed_work() local 91 dev_dbg(&psy->dev, "%s\n", __func__); in power_supply_changed_work() 93 spin_lock_irqsave(&psy->changed_lock, flags); in power_supply_changed_work() 101 if (likely(psy->changed)) { in power_supply_changed_work() 102 psy->changed = false; in power_supply_changed_work() 103 spin_unlock_irqrestore(&psy->changed_lock, flags); in power_supply_changed_work() 104 class_for_each_device(power_supply_class, NULL, psy, in power_supply_changed_work() [all …]
|
D | lp8727_charger.c | 88 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 …]
|
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() 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 …]
|
D | collie_battery.c | 30 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 …]
|
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() 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 …]
|
D | power_supply_hwmon.c | 12 struct power_supply *psy; member 176 if (power_supply_property_is_writeable(psyhw->psy, prop) > 0 && in power_supply_hwmon_is_visible() 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() [all …]
|
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() 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 …]
|
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() 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 …]
|
D | power_supply_sysfs.c | 278 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_show_property() local 284 value.intval = psy->desc->type; in power_supply_show_property() 286 ret = power_supply_get_property(psy, psp, &value); in power_supply_show_property() 308 ret = power_supply_show_usb_type(dev, psy->desc, in power_supply_show_property() 325 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_store_property() local 352 ret = power_supply_set_property(psy, psp, &value); in power_supply_store_property() 364 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_attr_is_visible() local 374 for (i = 0; i < psy->desc->num_properties; i++) { in power_supply_attr_is_visible() 375 int property = psy->desc->properties[i]; in power_supply_attr_is_visible() 378 if (psy->desc->property_is_writeable && in power_supply_attr_is_visible() [all …]
|
D | generic-adc-battery.c | 45 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 …]
|
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
|
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()
|
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()
|
D | 88pm860x_charger.c | 285 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 …]
|
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 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 …]
|
D | rt5033_battery.c | 19 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 = power_supply_register(&client->dev, in rt5033_battery_probe() 168 if (IS_ERR(battery->psy)) in rt5033_battery_probe() 169 return dev_err_probe(&client->dev, PTR_ERR(battery->psy), in rt5033_battery_probe() 179 power_supply_unregister(battery->psy); in rt5033_battery_remove()
|
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()
|
D | cros_usbpd-charger.c | 33 struct power_supply *psy; member 303 power_supply_changed(port->psy); in cros_usbpd_charger_get_power_info() 349 static void cros_usbpd_charger_power_changed(struct power_supply *psy) in cros_usbpd_charger_power_changed() argument 351 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_power_changed() 359 static int cros_usbpd_charger_get_prop(struct power_supply *psy, in cros_usbpd_charger_get_prop() argument 363 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_get_prop() 446 static int cros_usbpd_charger_set_prop(struct power_supply *psy, in cros_usbpd_charger_set_prop() argument 450 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_set_prop() 504 static int cros_usbpd_charger_property_is_writeable(struct power_supply *psy, in cros_usbpd_charger_property_is_writeable() argument 528 cros_usbpd_charger_power_changed(charger->ports[0]->psy); in cros_usbpd_charger_ec_event() [all …]
|
D | sbs-manager.c | 42 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 …]
|
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() 268 struct power_supply *psy; in cros_pchg_probe() local 331 psy = devm_power_supply_register(dev, psy_desc, &psy_cfg); in cros_pchg_probe() 332 if (IS_ERR(psy)) in cros_pchg_probe() 333 return dev_err_probe(dev, PTR_ERR(psy), in cros_pchg_probe() 335 port->psy = psy; in cros_pchg_probe()
|
D | charger-manager.c | 98 struct power_supply *psy; in is_batt_present() local 109 psy = power_supply_get_by_name(cm->desc->psy_fuel_gauge); in is_batt_present() 110 if (!psy) in is_batt_present() 113 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, in is_batt_present() 117 power_supply_put(psy); in is_batt_present() 121 psy = power_supply_get_by_name( in is_batt_present() 123 if (!psy) { in is_batt_present() 129 ret = power_supply_get_property(psy, in is_batt_present() 131 power_supply_put(psy); in is_batt_present() 154 struct power_supply *psy; in is_ext_pwr_online() local [all …]
|
/drivers/mfd/ |
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()
|
/drivers/hid/ |
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()
|
/drivers/usb/typec/ucsi/ |
D | psy.c | 197 static int ucsi_psy_get_prop(struct power_supply *psy, in ucsi_psy_get_prop() argument 201 struct ucsi_connector *con = power_supply_get_drvdata(psy); in ucsi_psy_get_prop() 253 con->psy = power_supply_register(dev, &con->psy_desc, &psy_cfg); in ucsi_register_port_psy() 255 return PTR_ERR_OR_ZERO(con->psy); in ucsi_register_port_psy() 260 if (IS_ERR_OR_NULL(con->psy)) in ucsi_unregister_port_psy() 263 power_supply_unregister(con->psy); in ucsi_unregister_port_psy() 264 con->psy = NULL; in ucsi_unregister_port_psy() 269 if (IS_ERR_OR_NULL(con->psy)) in ucsi_port_psy_changed() 272 power_supply_changed(con->psy); in ucsi_port_psy_changed()
|