/Linux-v5.4/drivers/power/supply/ |
D | power_supply_leds.c | 21 static void power_supply_update_bat_leds(struct power_supply *psy) in power_supply_update_bat_leds() argument 27 if (power_supply_get_property(psy, POWER_SUPPLY_PROP_STATUS, &status)) in power_supply_update_bat_leds() 30 dev_dbg(&psy->dev, "%s %d\n", __func__, status.intval); in power_supply_update_bat_leds() 34 led_trigger_event(psy->charging_full_trig, LED_FULL); in power_supply_update_bat_leds() 35 led_trigger_event(psy->charging_trig, LED_OFF); in power_supply_update_bat_leds() 36 led_trigger_event(psy->full_trig, LED_FULL); in power_supply_update_bat_leds() 37 led_trigger_event(psy->charging_blink_full_solid_trig, 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() 43 led_trigger_event(psy->full_trig, LED_OFF); in power_supply_update_bat_leds() [all …]
|
D | power_supply_core.c | 65 struct power_supply *psy = data; in __power_supply_changed_work() local 68 if (__power_supply_is_supplied_by(psy, pst)) { in __power_supply_changed_work() 79 struct power_supply *psy = container_of(work, struct power_supply, in power_supply_changed_work() local 82 dev_dbg(&psy->dev, "%s\n", __func__); in power_supply_changed_work() 84 spin_lock_irqsave(&psy->changed_lock, flags); in power_supply_changed_work() 92 if (likely(psy->changed)) { in power_supply_changed_work() 93 psy->changed = false; in power_supply_changed_work() 94 spin_unlock_irqrestore(&psy->changed_lock, flags); in power_supply_changed_work() 95 class_for_each_device(power_supply_class, NULL, psy, in power_supply_changed_work() 97 power_supply_update_leds(psy); in power_supply_changed_work() [all …]
|
D | tosa_battery.c | 25 struct power_supply *psy; member 60 value = wm97xx_read_aux_adc(dev_get_drvdata(bat->psy->dev.parent), in tosa_read_bat() 80 value = wm97xx_read_aux_adc(dev_get_drvdata(bat->psy->dev.parent), in tosa_read_temp() 90 static int tosa_bat_get_property(struct power_supply *psy, in tosa_bat_get_property() argument 95 struct tosa_bat *bat = power_supply_get_drvdata(psy); in tosa_bat_get_property() 142 static void tosa_bat_external_power_changed(struct power_supply *psy) in tosa_bat_external_power_changed() argument 157 struct power_supply *psy = bat->psy; in tosa_bat_update() local 164 printk(KERN_NOTICE "%s not present\n", psy->desc->name); in tosa_bat_update() 167 } else if (power_supply_am_i_supplied(psy)) { in tosa_bat_update() 190 power_supply_changed(psy); in tosa_bat_update() [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 | collie_battery.c | 28 struct power_supply *psy; member 91 static int collie_bat_get_property(struct power_supply *psy, in collie_bat_get_property() argument 96 struct collie_bat *bat = power_supply_get_drvdata(psy); in collie_bat_get_property() 138 static void collie_bat_external_power_changed(struct power_supply *psy) in collie_bat_external_power_changed() argument 153 struct power_supply *psy = bat->psy; in collie_bat_update() local 160 printk(KERN_NOTICE "%s not present\n", psy->desc->name); in collie_bat_update() 163 } else if (power_supply_am_i_supplied(psy)) { in collie_bat_update() 186 power_supply_changed(psy); in collie_bat_update() 231 .psy = NULL, 261 .psy = NULL, [all …]
|
D | power_supply_hwmon.c | 12 struct power_supply *psy; member 135 if (power_supply_property_is_writeable(psyhw->psy, prop) > 0 && in power_supply_hwmon_is_visible() 156 struct power_supply *psy = psyhw->psy; in power_supply_hwmon_read() local 164 ret = power_supply_get_property(psy, prop, &pspval); in power_supply_hwmon_read() 200 struct power_supply *psy = psyhw->psy; in power_supply_hwmon_write() local 232 return power_supply_set_property(psy, prop, &pspval); in power_supply_hwmon_write() 280 int power_supply_add_hwmon_sysfs(struct power_supply *psy) in power_supply_add_hwmon_sysfs() argument 282 const struct power_supply_desc *desc = psy->desc; in power_supply_add_hwmon_sysfs() 284 struct device *dev = &psy->dev; in power_supply_add_hwmon_sysfs() 299 psyhw->psy = psy; in power_supply_add_hwmon_sysfs() [all …]
|
D | power_supply_sysfs.c | 119 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_show_property() local 124 value.intval = psy->desc->type; in power_supply_show_property() 126 ret = power_supply_get_property(psy, psp, &value); in power_supply_show_property() 166 ret = power_supply_show_usb_type(dev, psy->desc->usb_types, in power_supply_show_property() 167 psy->desc->num_usb_types, in power_supply_show_property() 188 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_store_property() local 231 ret = power_supply_set_property(psy, psp, &value); in power_supply_store_property() 323 struct power_supply *psy = dev_get_drvdata(dev); in power_supply_attr_is_visible() local 330 for (i = 0; i < psy->desc->num_properties; i++) { in power_supply_attr_is_visible() 331 int property = psy->desc->properties[i]; in power_supply_attr_is_visible() [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 | s3c_adc_battery.c | 31 struct power_supply *psy; member 44 static void s3c_adc_bat_ext_power_changed(struct power_supply *psy) in s3c_adc_bat_ext_power_changed() argument 72 static int s3c_adc_backup_bat_get_property(struct power_supply *psy, in s3c_adc_backup_bat_get_property() argument 76 struct s3c_adc_bat *bat = power_supply_get_drvdata(psy); in s3c_adc_backup_bat_get_property() 79 dev_err(&psy->dev, "%s: no battery infos ?!\n", __func__); in s3c_adc_backup_bat_get_property() 140 static int s3c_adc_bat_get_property(struct power_supply *psy, in s3c_adc_bat_get_property() argument 144 struct s3c_adc_bat *bat = power_supply_get_drvdata(psy); in s3c_adc_bat_get_property() 152 dev_err(&psy->dev, "no battery infos ?!\n"); in s3c_adc_bat_get_property() 254 is_plugged = power_supply_am_i_supplied(bat->psy); in s3c_adc_bat_work() 282 power_supply_changed(bat->psy); in s3c_adc_bat_work() [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 | generic-adc-battery.c | 47 struct power_supply *psy; member 57 static struct gab *to_generic_bat(struct power_supply *psy) in to_generic_bat() argument 59 return power_supply_get_drvdata(psy); in to_generic_bat() 62 static void gab_ext_power_changed(struct power_supply *psy) in gab_ext_power_changed() argument 64 struct gab *adc_bat = to_generic_bat(psy); in gab_ext_power_changed() 144 static int gab_get_property(struct power_supply *psy, in gab_get_property() argument 153 adc_bat = to_generic_bat(psy); in gab_get_property() 155 dev_err(&psy->dev, "no battery infos ?!\n"); in gab_get_property() 212 is_plugged = power_supply_am_i_supplied(adc_bat->psy); in gab_work() 223 power_supply_changed(adc_bat->psy); in gab_work() [all …]
|
D | wilco-charger.c | 81 static int wilco_charge_get_property(struct power_supply *psy, in wilco_charge_get_property() argument 85 struct wilco_ec_device *ec = power_supply_get_drvdata(psy); in wilco_charge_get_property() 118 static int wilco_charge_set_property(struct power_supply *psy, in wilco_charge_set_property() argument 122 struct wilco_ec_device *ec = power_supply_get_drvdata(psy); in wilco_charge_set_property() 148 static int wilco_charge_property_is_writeable(struct power_supply *psy, in wilco_charge_property_is_writeable() argument 168 struct power_supply *psy; in wilco_charge_probe() local 171 psy = devm_power_supply_register(&pdev->dev, &wilco_ps_desc, &psy_cfg); in wilco_charge_probe() 173 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() 210 batt->psy = devm_power_supply_register(dev, &lego_ev3_battery_desc, in lego_ev3_battery_probe() 212 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 | 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()
|
D | bd70528-charger.c | 95 struct power_supply *psy = (struct power_supply *)arg; \ 97 power_supply_changed(psy); \ 98 dev_err(&psy->dev, (_wrn_)); \ 106 struct power_supply *psy = (struct power_supply *)arg; \ 108 power_supply_changed(psy); \ 109 dev_dbg(&psy->dev, (_wrn_)); \ 119 struct power_supply *psy; member 180 bdpsy->psy); in bd70528_get_irqs() 517 static int bd70528_charger_get_property(struct power_supply *psy, in bd70528_charger_get_property() argument 521 struct bd70528_psy *bdpsy = power_supply_get_drvdata(psy); in bd70528_charger_get_property() [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() 386 data->psy = devm_power_supply_register(dev, psy_desc, &psy_cfg); in sbsm_probe() 387 if (IS_ERR(data->psy)) { in sbsm_probe() [all …]
|
D | rt5033_battery.c | 68 static int rt5033_battery_get_property(struct power_supply *psy, in rt5033_battery_get_property() argument 72 struct rt5033_battery *battery = power_supply_get_drvdata(psy); in rt5033_battery_get_property() 141 battery->psy = power_supply_register(&client->dev, in rt5033_battery_probe() 143 if (IS_ERR(battery->psy)) { in rt5033_battery_probe() 145 ret = PTR_ERR(battery->psy); in rt5033_battery_probe() 156 power_supply_unregister(battery->psy); in rt5033_battery_remove()
|
D | cros_usbpd-charger.c | 32 struct power_supply *psy; member 308 power_supply_changed(port->psy); in cros_usbpd_charger_get_power_info() 354 static void cros_usbpd_charger_power_changed(struct power_supply *psy) in cros_usbpd_charger_power_changed() argument 356 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_power_changed() 364 static int cros_usbpd_charger_get_prop(struct power_supply *psy, in cros_usbpd_charger_get_prop() argument 368 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_get_prop() 451 static int cros_usbpd_charger_set_prop(struct power_supply *psy, in cros_usbpd_charger_set_prop() argument 455 struct port_data *port = power_supply_get_drvdata(psy); in cros_usbpd_charger_set_prop() 509 static int cros_usbpd_charger_property_is_writeable(struct power_supply *psy, in cros_usbpd_charger_property_is_writeable() argument 539 cros_usbpd_charger_power_changed(charger->ports[0]->psy); in cros_usbpd_charger_ec_event() [all …]
|
D | tps65217_charger.c | 33 struct power_supply *psy; member 104 static int tps65217_charger_get_property(struct power_supply *psy, in tps65217_charger_get_property() argument 108 struct tps65217_charger *charger = power_supply_get_drvdata(psy); in tps65217_charger_get_property() 146 power_supply_changed(charger->psy); in tps65217_charger_irq() 205 charger->psy = devm_power_supply_register(&pdev->dev, in tps65217_charger_probe() 208 if (IS_ERR(charger->psy)) { in tps65217_charger_probe() 210 return PTR_ERR(charger->psy); in tps65217_charger_probe()
|
D | bq2415x_charger.c | 811 struct power_supply *psy = v; in bq2415x_notifier_call() local 820 if (!psy->dev.parent || in bq2415x_notifier_call() 821 psy->dev.parent->of_node != bq->notify_node) in bq2415x_notifier_call() 824 if (strcmp(psy->desc->name, bq->init_data.notify_device) != 0) in bq2415x_notifier_call() 830 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_CURRENT_MAX, in bq2415x_notifier_call() 996 static int bq2415x_power_supply_get_property(struct power_supply *psy, in bq2415x_power_supply_get_property() argument 1000 struct bq2415x_device *bq = power_supply_get_drvdata(psy); in bq2415x_power_supply_get_property() 1043 struct power_supply *psy = dev_get_drvdata(dev); in bq2415x_sysfs_show_status() local 1044 struct bq2415x_device *bq = power_supply_get_drvdata(psy); in bq2415x_sysfs_show_status() 1076 struct power_supply *psy = dev_get_drvdata(dev); in bq2415x_sysfs_set_timer() local [all …]
|
/Linux-v5.4/include/linux/ |
D | power_supply.h | 237 int (*get_property)(struct power_supply *psy, 240 int (*set_property)(struct power_supply *psy, 248 int (*property_is_writeable)(struct power_supply *psy, 250 void (*external_power_changed)(struct power_supply *psy); 251 void (*set_charged)(struct power_supply *psy); 358 extern void power_supply_put(struct power_supply *psy); 373 extern int power_supply_get_battery_info(struct power_supply *psy, 375 extern void power_supply_put_battery_info(struct power_supply *psy, 384 extern void power_supply_changed(struct power_supply *psy); 385 extern int power_supply_am_i_supplied(struct power_supply *psy); [all …]
|
/Linux-v5.4/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()
|
/Linux-v5.4/arch/x86/platform/olpc/ |
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()
|