18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Functions private to power supply class
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright © 2007  Anton Vorontsov <cbou@mail.ru>
68c2ecf20Sopenharmony_ci *  Copyright © 2004  Szabolcs Gyurko
78c2ecf20Sopenharmony_ci *  Copyright © 2003  Ian Molton <spyro@f2s.com>
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci *  Modified: 2004, Oct     Szabolcs Gyurko
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cistruct device;
138c2ecf20Sopenharmony_cistruct device_type;
148c2ecf20Sopenharmony_cistruct power_supply;
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#ifdef CONFIG_SYSFS
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciextern void power_supply_init_attrs(struct device_type *dev_type);
198c2ecf20Sopenharmony_ciextern int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env);
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#else
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_cistatic inline void power_supply_init_attrs(struct device_type *dev_type) {}
248c2ecf20Sopenharmony_ci#define power_supply_uevent NULL
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#endif /* CONFIG_SYSFS */
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#ifdef CONFIG_LEDS_TRIGGERS
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciextern void power_supply_update_leds(struct power_supply *psy);
318c2ecf20Sopenharmony_ciextern int power_supply_create_triggers(struct power_supply *psy);
328c2ecf20Sopenharmony_ciextern void power_supply_remove_triggers(struct power_supply *psy);
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#else
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cistatic inline void power_supply_update_leds(struct power_supply *psy) {}
378c2ecf20Sopenharmony_cistatic inline int power_supply_create_triggers(struct power_supply *psy)
388c2ecf20Sopenharmony_ci{ return 0; }
398c2ecf20Sopenharmony_cistatic inline void power_supply_remove_triggers(struct power_supply *psy) {}
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#endif /* CONFIG_LEDS_TRIGGERS */
42