Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / power / supply / power_supply.h
blob7434a6f2477504ee6c0a3c7420e1444387b41180
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Functions private to power supply class
5 * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
6 * Copyright © 2004 Szabolcs Gyurko
7 * Copyright © 2003 Ian Molton <spyro@f2s.com>
9 * Modified: 2004, Oct Szabolcs Gyurko
12 struct device;
13 struct device_type;
14 struct power_supply;
16 extern int power_supply_property_is_writeable(struct power_supply *psy,
17 enum power_supply_property psp);
19 #ifdef CONFIG_SYSFS
21 extern void __init power_supply_init_attrs(void);
22 extern int power_supply_uevent(const struct device *dev, struct kobj_uevent_env *env);
23 extern const struct attribute_group *power_supply_attr_groups[];
25 #else
27 static inline void power_supply_init_attrs(void) {}
28 #define power_supply_attr_groups NULL
29 #define power_supply_uevent NULL
31 #endif /* CONFIG_SYSFS */
33 #ifdef CONFIG_LEDS_TRIGGERS
35 extern void power_supply_update_leds(struct power_supply *psy);
36 extern int power_supply_create_triggers(struct power_supply *psy);
37 extern void power_supply_remove_triggers(struct power_supply *psy);
39 #else
41 static inline void power_supply_update_leds(struct power_supply *psy) {}
42 static inline int power_supply_create_triggers(struct power_supply *psy)
43 { return 0; }
44 static inline void power_supply_remove_triggers(struct power_supply *psy) {}
46 #endif /* CONFIG_LEDS_TRIGGERS */
48 #ifdef CONFIG_POWER_SUPPLY_HWMON
50 int power_supply_add_hwmon_sysfs(struct power_supply *psy);
51 void power_supply_remove_hwmon_sysfs(struct power_supply *psy);
53 #else
55 static inline int power_supply_add_hwmon_sysfs(struct power_supply *psy)
57 return 0;
60 static inline
61 void power_supply_remove_hwmon_sysfs(struct power_supply *psy) {}
63 #endif /* CONFIG_POWER_SUPPLY_HWMON */