hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
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,7 +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 */
88
-#define EXTCON_DISP_HDMI_AUDIO 46 /* High-Definition Multimedia Interface Audio */
80
+#define EXTCON_DISP_CVBS 46 /* Composite Video Broadcast Signal */
81
+#define EXTCON_DISP_EDP 47 /* Embedded Display Port */
8982
9083 /* Miscellaneous external connector */
9184 #define EXTCON_DOCK 60
....@@ -127,19 +120,14 @@
127120 * @type: integer (intval)
128121 * @value: 0 (USB/USB2) or 1 (USB3)
129122 * @default: 0 (USB/USB2)
130
- * - EXTCON_PROP_USB_TYPEC_MED_HIGH_CURRENT
131
- * @type: integer (intval)
132
- * @value: 0 (default current), 1 (medium or high current)
133
- * @default: 0 (default current)
134123 *
135124 */
136125 #define EXTCON_PROP_USB_VBUS 0
137126 #define EXTCON_PROP_USB_TYPEC_POLARITY 1
138127 #define EXTCON_PROP_USB_SS 2
139
-#define EXTCON_PROP_USB_TYPEC_MED_HIGH_CURRENT 3
140128
141129 #define EXTCON_PROP_USB_MIN 0
142
-#define EXTCON_PROP_USB_MAX 3
130
+#define EXTCON_PROP_USB_MAX 2
143131 #define EXTCON_PROP_USB_CNT (EXTCON_PROP_USB_MAX - EXTCON_PROP_USB_MIN + 1)
144132
145133 /* Properties of EXTCON_TYPE_CHG. */
....@@ -185,7 +173,7 @@
185173 * Following APIs get the connected state of each external connector.
186174 * The 'id' argument indicates the defined external connector.
187175 */
188
-extern int extcon_get_state(struct extcon_dev *edev, unsigned int id);
176
+int extcon_get_state(struct extcon_dev *edev, unsigned int id);
189177
190178 /*
191179 * Following APIs get the property of each external connector.
....@@ -196,10 +184,10 @@
196184 * for each external connector. They are used to get the capability of the
197185 * property of each external connector based on the id and property.
198186 */
199
-extern int extcon_get_property(struct extcon_dev *edev, unsigned int id,
187
+int extcon_get_property(struct extcon_dev *edev, unsigned int id,
200188 unsigned int prop,
201189 union extcon_property_value *prop_val);
202
-extern int extcon_get_property_capability(struct extcon_dev *edev,
190
+int extcon_get_property_capability(struct extcon_dev *edev,
203191 unsigned int id, unsigned int prop);
204192
205193 /*
....@@ -211,45 +199,39 @@
211199 * extcon_register_notifier_all(*edev, *nb) : Register a notifier block
212200 * for all supported external connectors of the extcon.
213201 */
214
-extern int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
202
+int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
215203 struct notifier_block *nb);
216
-extern int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id,
204
+int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id,
217205 struct notifier_block *nb);
218
-extern int extcon_register_blocking_notifier(struct extcon_dev *edev,
219
- unsigned int id, struct notifier_block *nb);
220
-extern int extcon_unregister_blocking_notifier(struct extcon_dev *edev,
221
- unsigned int id, struct notifier_block *nb);
222
-extern int devm_extcon_register_notifier(struct device *dev,
206
+int devm_extcon_register_notifier(struct device *dev,
223207 struct extcon_dev *edev, unsigned int id,
224208 struct notifier_block *nb);
225
-extern void devm_extcon_unregister_notifier(struct device *dev,
209
+void devm_extcon_unregister_notifier(struct device *dev,
226210 struct extcon_dev *edev, unsigned int id,
227211 struct notifier_block *nb);
228212
229
-extern int extcon_register_notifier_all(struct extcon_dev *edev,
213
+int extcon_register_notifier_all(struct extcon_dev *edev,
230214 struct notifier_block *nb);
231
-extern int extcon_unregister_notifier_all(struct extcon_dev *edev,
215
+int extcon_unregister_notifier_all(struct extcon_dev *edev,
232216 struct notifier_block *nb);
233
-extern int devm_extcon_register_notifier_all(struct device *dev,
217
+int devm_extcon_register_notifier_all(struct device *dev,
234218 struct extcon_dev *edev,
235219 struct notifier_block *nb);
236
-extern void devm_extcon_unregister_notifier_all(struct device *dev,
220
+void devm_extcon_unregister_notifier_all(struct device *dev,
237221 struct extcon_dev *edev,
238222 struct notifier_block *nb);
239223
240224 /*
241225 * Following APIs get the extcon_dev from devicetree or by through extcon name.
242226 */
243
-extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name);
244
-extern struct extcon_dev *extcon_find_edev_by_node(struct device_node *node);
245
-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,
246230 int index);
247231
248232 /* Following API get the name of extcon device. */
249
-extern const char *extcon_get_edev_name(struct extcon_dev *edev);
233
+const char *extcon_get_edev_name(struct extcon_dev *edev);
250234
251
-extern int extcon_blocking_sync(struct extcon_dev *edev, unsigned int id,
252
- bool val);
253235 #else /* CONFIG_EXTCON */
254236 static inline int extcon_get_state(struct extcon_dev *edev, unsigned int id)
255237 {
....@@ -277,20 +259,6 @@
277259
278260 static inline int extcon_unregister_notifier(struct extcon_dev *edev,
279261 unsigned int id, struct notifier_block *nb)
280
-{
281
- return 0;
282
-}
283
-
284
-static inline int extcon_register_blocking_notifier(struct extcon_dev *edev,
285
- unsigned int id,
286
- struct notifier_block *nb)
287
-{
288
- return 0;
289
-}
290
-
291
-static inline int extcon_unregister_blocking_notifier(struct extcon_dev *edev,
292
- unsigned int id,
293
- struct notifier_block *nb)
294262 {
295263 return 0;
296264 }
....@@ -334,11 +302,6 @@
334302 return ERR_PTR(-ENODEV);
335303 }
336304
337
-static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
338
-{
339
- return NULL;
340
-}
341
-
342305 static inline struct extcon_dev *extcon_find_edev_by_node(struct device_node *node)
343306 {
344307 return ERR_PTR(-ENODEV);
....@@ -349,6 +312,11 @@
349312 {
350313 return ERR_PTR(-ENODEV);
351314 }
315
+
316
+static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
317
+{
318
+ return NULL;
319
+}
352320 #endif /* CONFIG_EXTCON */
353321
354322 /*