This source file includes following definitions.
- extcon_dev_register
- extcon_dev_unregister
- devm_extcon_dev_register
- devm_extcon_dev_unregister
- extcon_dev_allocate
- extcon_dev_free
- devm_extcon_dev_allocate
- devm_extcon_dev_free
- extcon_set_state
- extcon_set_state_sync
- extcon_sync
- extcon_set_property
- extcon_set_property_sync
- extcon_set_property_capability
1
2
3
4
5
6
7
8
9
10 #ifndef __LINUX_EXTCON_PROVIDER_H__
11 #define __LINUX_EXTCON_PROVIDER_H__
12
13 #include <linux/extcon.h>
14
15 struct extcon_dev;
16
17 #if IS_ENABLED(CONFIG_EXTCON)
18
19
20 extern int extcon_dev_register(struct extcon_dev *edev);
21 extern void extcon_dev_unregister(struct extcon_dev *edev);
22 extern int devm_extcon_dev_register(struct device *dev,
23 struct extcon_dev *edev);
24 extern void devm_extcon_dev_unregister(struct device *dev,
25 struct extcon_dev *edev);
26
27
28 extern struct extcon_dev *extcon_dev_allocate(const unsigned int *cable);
29 extern void extcon_dev_free(struct extcon_dev *edev);
30 extern struct extcon_dev *devm_extcon_dev_allocate(struct device *dev,
31 const unsigned int *cable);
32 extern void devm_extcon_dev_free(struct device *dev, struct extcon_dev *edev);
33
34
35 extern int extcon_sync(struct extcon_dev *edev, unsigned int id);
36
37
38
39
40
41 extern int extcon_set_state(struct extcon_dev *edev, unsigned int id,
42 bool state);
43 extern int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id,
44 bool state);
45
46
47
48
49
50
51
52
53
54
55 extern int extcon_set_property(struct extcon_dev *edev, unsigned int id,
56 unsigned int prop,
57 union extcon_property_value prop_val);
58 extern int extcon_set_property_sync(struct extcon_dev *edev, unsigned int id,
59 unsigned int prop,
60 union extcon_property_value prop_val);
61 extern int extcon_set_property_capability(struct extcon_dev *edev,
62 unsigned int id, unsigned int prop);
63
64 #else
65 static inline int extcon_dev_register(struct extcon_dev *edev)
66 {
67 return 0;
68 }
69
70 static inline void extcon_dev_unregister(struct extcon_dev *edev) { }
71
72 static inline int devm_extcon_dev_register(struct device *dev,
73 struct extcon_dev *edev)
74 {
75 return -EINVAL;
76 }
77
78 static inline void devm_extcon_dev_unregister(struct device *dev,
79 struct extcon_dev *edev) { }
80
81 static inline struct extcon_dev *extcon_dev_allocate(const unsigned int *cable)
82 {
83 return ERR_PTR(-ENOSYS);
84 }
85
86 static inline void extcon_dev_free(struct extcon_dev *edev) { }
87
88 static inline struct extcon_dev *devm_extcon_dev_allocate(struct device *dev,
89 const unsigned int *cable)
90 {
91 return ERR_PTR(-ENOSYS);
92 }
93
94 static inline void devm_extcon_dev_free(struct extcon_dev *edev) { }
95
96
97 static inline int extcon_set_state(struct extcon_dev *edev, unsigned int id,
98 bool state)
99 {
100 return 0;
101 }
102
103 static inline int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id,
104 bool state)
105 {
106 return 0;
107 }
108
109 static inline int extcon_sync(struct extcon_dev *edev, unsigned int id)
110 {
111 return 0;
112 }
113
114 static inline int extcon_set_property(struct extcon_dev *edev, unsigned int id,
115 unsigned int prop,
116 union extcon_property_value prop_val)
117 {
118 return 0;
119 }
120
121 static inline int extcon_set_property_sync(struct extcon_dev *edev,
122 unsigned int id, unsigned int prop,
123 union extcon_property_value prop_val)
124 {
125 return 0;
126 }
127
128 static inline int extcon_set_property_capability(struct extcon_dev *edev,
129 unsigned int id, unsigned int prop)
130 {
131 return 0;
132 }
133 #endif
134 #endif