hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/extcon.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * External Connector (extcon) framework
34 * - linux/include/linux/extcon.h for extcon consumer device driver.
....@@ -12,15 +13,6 @@
1213 * based on switch class driver
1314 * Copyright (C) 2008 Google, Inc.
1415 * Author: Mike Lockwood <lockwood@android.com>
15
- *
16
- * This software is licensed under the terms of the GNU General Public
17
- * License version 2, as published by the Free Software Foundation, and
18
- * may be copied, distributed, and modified under those terms.
19
- *
20
- * This program is distributed in the hope that it will be useful,
21
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- * GNU General Public License for more details.
2416 */
2517
2618 #ifndef __LINUX_EXTCON_H__
....@@ -85,6 +77,8 @@
8577 #define EXTCON_DISP_VGA 43 /* Video Graphics Array */
8678 #define EXTCON_DISP_DP 44 /* Display Port */
8779 #define EXTCON_DISP_HMD 45 /* Head-Mounted Display */
80
+#define EXTCON_DISP_CVBS 46 /* Composite Video Broadcast Signal */
81
+#define EXTCON_DISP_EDP 47 /* Embedded Display Port */
8882
8983 /* Miscellaneous external connector */
9084 #define EXTCON_DOCK 60
....@@ -126,19 +120,14 @@
126120 * @type: integer (intval)
127121 * @value: 0 (USB/USB2) or 1 (USB3)
128122 * @default: 0 (USB/USB2)
129
- * - EXTCON_PROP_USB_TYPEC_MED_HIGH_CURRENT
130
- * @type: integer (intval)
131
- * @value: 0 (default current), 1 (medium or high current)
132
- * @default: 0 (default current)
133123 *
134124 */
135125 #define EXTCON_PROP_USB_VBUS 0
136126 #define EXTCON_PROP_USB_TYPEC_POLARITY 1
137127 #define EXTCON_PROP_USB_SS 2
138
-#define EXTCON_PROP_USB_TYPEC_MED_HIGH_CURRENT 3
139128
140129 #define EXTCON_PROP_USB_MIN 0
141
-#define EXTCON_PROP_USB_MAX 3
130
+#define EXTCON_PROP_USB_MAX 2
142131 #define EXTCON_PROP_USB_CNT (EXTCON_PROP_USB_MAX - EXTCON_PROP_USB_MIN + 1)
143132
144133 /* Properties of EXTCON_TYPE_CHG. */
....@@ -184,7 +173,7 @@
184173 * Following APIs get the connected state of each external connector.
185174 * The 'id' argument indicates the defined external connector.
186175 */
187
-extern int extcon_get_state(struct extcon_dev *edev, unsigned int id);
176
+int extcon_get_state(struct extcon_dev *edev, unsigned int id);
188177
189178 /*
190179 * Following APIs get the property of each external connector.
....@@ -195,10 +184,10 @@
195184 * for each external connector. They are used to get the capability of the
196185 * property of each external connector based on the id and property.
197186 */
198
-extern int extcon_get_property(struct extcon_dev *edev, unsigned int id,
187
+int extcon_get_property(struct extcon_dev *edev, unsigned int id,
199188 unsigned int prop,
200189 union extcon_property_value *prop_val);
201
-extern int extcon_get_property_capability(struct extcon_dev *edev,
190
+int extcon_get_property_capability(struct extcon_dev *edev,
202191 unsigned int id, unsigned int prop);
203192
204193 /*
....@@ -210,45 +199,39 @@
210199 * extcon_register_notifier_all(*edev, *nb) : Register a notifier block
211200 * for all supported external connectors of the extcon.
212201 */
213
-extern int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
202
+int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
214203 struct notifier_block *nb);
215
-extern int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id,
204
+int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id,
216205 struct notifier_block *nb);
217
-extern int extcon_register_blocking_notifier(struct extcon_dev *edev,
218
- unsigned int id, struct notifier_block *nb);
219
-extern int extcon_unregister_blocking_notifier(struct extcon_dev *edev,
220
- unsigned int id, struct notifier_block *nb);
221
-extern int devm_extcon_register_notifier(struct device *dev,
206
+int devm_extcon_register_notifier(struct device *dev,
222207 struct extcon_dev *edev, unsigned int id,
223208 struct notifier_block *nb);
224
-extern void devm_extcon_unregister_notifier(struct device *dev,
209
+void devm_extcon_unregister_notifier(struct device *dev,
225210 struct extcon_dev *edev, unsigned int id,
226211 struct notifier_block *nb);
227212
228
-extern int extcon_register_notifier_all(struct extcon_dev *edev,
213
+int extcon_register_notifier_all(struct extcon_dev *edev,
229214 struct notifier_block *nb);
230
-extern int extcon_unregister_notifier_all(struct extcon_dev *edev,
215
+int extcon_unregister_notifier_all(struct extcon_dev *edev,
231216 struct notifier_block *nb);
232
-extern int devm_extcon_register_notifier_all(struct device *dev,
217
+int devm_extcon_register_notifier_all(struct device *dev,
233218 struct extcon_dev *edev,
234219 struct notifier_block *nb);
235
-extern void devm_extcon_unregister_notifier_all(struct device *dev,
220
+void devm_extcon_unregister_notifier_all(struct device *dev,
236221 struct extcon_dev *edev,
237222 struct notifier_block *nb);
238223
239224 /*
240225 * Following APIs get the extcon_dev from devicetree or by through extcon name.
241226 */
242
-extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name);
243
-extern struct extcon_dev *extcon_find_edev_by_node(struct device_node *node);
244
-extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
227
+struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name);
228
+struct extcon_dev *extcon_find_edev_by_node(struct device_node *node);
229
+struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
245230 int index);
246231
247232 /* Following API get the name of extcon device. */
248
-extern const char *extcon_get_edev_name(struct extcon_dev *edev);
233
+const char *extcon_get_edev_name(struct extcon_dev *edev);
249234
250
-extern int extcon_blocking_sync(struct extcon_dev *edev, unsigned int id,
251
- bool val);
252235 #else /* CONFIG_EXTCON */
253236 static inline int extcon_get_state(struct extcon_dev *edev, unsigned int id)
254237 {
....@@ -276,20 +259,6 @@
276259
277260 static inline int extcon_unregister_notifier(struct extcon_dev *edev,
278261 unsigned int id, struct notifier_block *nb)
279
-{
280
- return 0;
281
-}
282
-
283
-static inline int extcon_register_blocking_notifier(struct extcon_dev *edev,
284
- unsigned int id,
285
- struct notifier_block *nb)
286
-{
287
- return 0;
288
-}
289
-
290
-static inline int extcon_unregister_blocking_notifier(struct extcon_dev *edev,
291
- unsigned int id,
292
- struct notifier_block *nb)
293262 {
294263 return 0;
295264 }
....@@ -333,11 +302,6 @@
333302 return ERR_PTR(-ENODEV);
334303 }
335304
336
-static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
337
-{
338
- return NULL;
339
-}
340
-
341305 static inline struct extcon_dev *extcon_find_edev_by_node(struct device_node *node)
342306 {
343307 return ERR_PTR(-ENODEV);
....@@ -348,6 +312,11 @@
348312 {
349313 return ERR_PTR(-ENODEV);
350314 }
315
+
316
+static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
317
+{
318
+ return NULL;
319
+}
351320 #endif /* CONFIG_EXTCON */
352321
353322 /*