VSF Documented
power_supply.h
Go to the documentation of this file.
1#ifndef __VSF_LINUX_POWER_SUPPLY_H__
2#define __VSF_LINUX_POWER_SUPPLY_H__
3
4#include <linux/device.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
24};
25
32};
33
34enum {
38};
39
40enum {
46};
47
48enum {
55};
56
58 int intval;
59 const char *strval;
60};
61
62struct power_supply;
64 const char *name;
68
69 int (*get_property)(struct power_supply *psy,
70 enum power_supply_property psp,
71 union power_supply_propval *val);
72 int (*set_property)(struct power_supply *psy,
73 enum power_supply_property psp,
74 const union power_supply_propval *val);
75};
76
78 void *drv_data;
79};
80
82 const struct power_supply_desc *desc;
83};
84
85extern struct power_supply * power_supply_register(struct device *parent,
86 const struct power_supply_desc *desc,
87 const struct power_supply_config *cfg);
88extern struct power_supply * devm_power_supply_register(struct device *parent,
89 const struct power_supply_desc *desc,
90 const struct power_supply_config *cfg);
91
92extern void power_supply_unregister(struct power_supply *psy);
93extern int power_supply_powers(struct power_supply *psy, struct device *dev);
94
95extern void * power_supply_get_drvdata(struct power_supply *psy);
96extern void power_supply_changed(struct power_supply *psy);
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif
power_supply_type
Definition power_supply.h:10
@ POWER_SUPPLY_TYPE_USB_TYPE_C
Definition power_supply.h:19
@ POWER_SUPPLY_TYPE_MAINS
Definition power_supply.h:14
@ POWER_SUPPLY_TYPE_USB_PD_DRP
Definition power_supply.h:21
@ POWER_SUPPLY_TYPE_USB_DCP
Definition power_supply.h:16
@ POWER_SUPPLY_TYPE_UNKNOWN
Definition power_supply.h:11
@ POWER_SUPPLY_TYPE_UPS
Definition power_supply.h:13
@ POWER_SUPPLY_TYPE_WIRELESS
Definition power_supply.h:23
@ POWER_SUPPLY_TYPE_USB_PD
Definition power_supply.h:20
@ POWER_SUPPLY_TYPE_BATTERY
Definition power_supply.h:12
@ POWER_SUPPLY_TYPE_USB_CDP
Definition power_supply.h:17
@ POWER_SUPPLY_TYPE_APPLE_BRICK_ID
Definition power_supply.h:22
@ POWER_SUPPLY_TYPE_USB_ACA
Definition power_supply.h:18
@ POWER_SUPPLY_TYPE_USB
Definition power_supply.h:15
struct power_supply * power_supply_register(struct device *parent, const struct power_supply_desc *desc, const struct power_supply_config *cfg)
Definition vsf_linux_core.c:685
void * power_supply_get_drvdata(struct power_supply *psy)
Definition vsf_linux_core.c:701
struct power_supply * devm_power_supply_register(struct device *parent, const struct power_supply_desc *desc, const struct power_supply_config *cfg)
Definition vsf_linux_core.c:991
void power_supply_unregister(struct power_supply *psy)
Definition vsf_linux_core.c:692
power_supply_property
Definition power_supply.h:26
@ POWER_SUPPLY_PROP_SCOPE
Definition power_supply.h:30
@ POWER_SUPPLY_PROP_CHARGE_TYPE
Definition power_supply.h:28
@ POWER_SUPPLY_PROP_MODEL_NAME
Definition power_supply.h:31
@ POWER_SUPPLY_PROP_CAPACITY_LEVEL
Definition power_supply.h:29
@ POWER_SUPPLY_PROP_STATUS
Definition power_supply.h:27
@ POWER_SUPPLY_STATUS_NOT_CHARGING
Definition power_supply.h:44
@ POWER_SUPPLY_STATUS_UNKNOWN
Definition power_supply.h:41
@ POWER_SUPPLY_STATUS_DISCHARGING
Definition power_supply.h:43
@ POWER_SUPPLY_STATUS_CHARGING
Definition power_supply.h:42
@ POWER_SUPPLY_STATUS_FULL
Definition power_supply.h:45
void power_supply_changed(struct power_supply *psy)
Definition vsf_linux_core.c:706
@ POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN
Definition power_supply.h:49
@ POWER_SUPPLY_CAPACITY_LEVEL_HIGH
Definition power_supply.h:53
@ POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL
Definition power_supply.h:50
@ POWER_SUPPLY_CAPACITY_LEVEL_FULL
Definition power_supply.h:54
@ POWER_SUPPLY_CAPACITY_LEVEL_LOW
Definition power_supply.h:51
@ POWER_SUPPLY_CAPACITY_LEVEL_NORMAL
Definition power_supply.h:52
int power_supply_powers(struct power_supply *psy, struct device *dev)
Definition vsf_linux_core.c:696
@ POWER_SUPPLY_SCOPE_DEVICE
Definition power_supply.h:37
@ POWER_SUPPLY_SCOPE_SYSTEM
Definition power_supply.h:36
@ POWER_SUPPLY_SCOPE_UNKNOWN
Definition power_supply.h:35
Definition device.h:33
Definition power_supply.h:77
void * drv_data
Definition power_supply.h:78
Definition power_supply.h:63
size_t num_properties
Definition power_supply.h:67
const char * name
Definition power_supply.h:64
enum power_supply_type type
Definition power_supply.h:65
int(* set_property)(struct power_supply *psy, enum power_supply_property psp, const union power_supply_propval *val)
Definition power_supply.h:72
enum power_supply_property * properties
Definition power_supply.h:66
int(* get_property)(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val)
Definition power_supply.h:69
Definition power_supply.h:81
const struct power_supply_desc * desc
Definition power_supply.h:82
Definition power_supply.h:57
int intval
Definition power_supply.h:58
const char * strval
Definition power_supply.h:59