power_supply.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Functions private to power supply class
  4. *
  5. * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
  6. * Copyright © 2004 Szabolcs Gyurko
  7. * Copyright © 2003 Ian Molton <spyro@f2s.com>
  8. *
  9. * Modified: 2004, Oct Szabolcs Gyurko
  10. */
  11. struct device;
  12. struct device_type;
  13. struct power_supply;
  14. #ifdef CONFIG_SYSFS
  15. extern void power_supply_init_attrs(struct device_type *dev_type);
  16. extern int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env);
  17. #else
  18. static inline void power_supply_init_attrs(struct device_type *dev_type) {}
  19. #define power_supply_uevent NULL
  20. #endif /* CONFIG_SYSFS */
  21. #ifdef CONFIG_LEDS_TRIGGERS
  22. extern void power_supply_update_leds(struct power_supply *psy);
  23. extern int power_supply_create_triggers(struct power_supply *psy);
  24. extern void power_supply_remove_triggers(struct power_supply *psy);
  25. #else
  26. static inline void power_supply_update_leds(struct power_supply *psy) {}
  27. static inline int power_supply_create_triggers(struct power_supply *psy)
  28. { return 0; }
  29. static inline void power_supply_remove_triggers(struct power_supply *psy) {}
  30. #endif /* CONFIG_LEDS_TRIGGERS */