Thomas Gleixner | 9c92ab6 | 2019-05-29 07:17:56 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 2 | /* |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 3 | * External Connector (extcon) framework |
Chanwoo Choi | 176aa36 | 2017-09-21 12:11:24 +0900 | [diff] [blame] | 4 | * - linux/include/linux/extcon.h for extcon consumer device driver. |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 5 | * |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame] | 6 | * Copyright (C) 2015 Samsung Electronics |
| 7 | * Author: Chanwoo Choi <cw00.choi@samsung.com> |
| 8 | * |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 9 | * Copyright (C) 2012 Samsung Electronics |
| 10 | * Author: Donggeun Kim <dg77.kim@samsung.com> |
| 11 | * Author: MyungJoo Ham <myungjoo.ham@samsung.com> |
| 12 | * |
| 13 | * based on switch class driver |
| 14 | * Copyright (C) 2008 Google, Inc. |
| 15 | * Author: Mike Lockwood <lockwood@android.com> |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 16 | */ |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 17 | |
| 18 | #ifndef __LINUX_EXTCON_H__ |
| 19 | #define __LINUX_EXTCON_H__ |
| 20 | |
Chanwoo Choi | d851718 | 2012-11-08 18:39:41 +0900 | [diff] [blame] | 21 | #include <linux/device.h> |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 22 | |
Chanwoo Choi | 73b6ecd | 2015-06-12 11:10:06 +0900 | [diff] [blame] | 23 | /* |
Chanwoo Choi | 55e4e2f | 2016-07-11 16:34:52 +0900 | [diff] [blame] | 24 | * Define the type of supported external connectors |
| 25 | */ |
| 26 | #define EXTCON_TYPE_USB BIT(0) /* USB connector */ |
| 27 | #define EXTCON_TYPE_CHG BIT(1) /* Charger connector */ |
| 28 | #define EXTCON_TYPE_JACK BIT(2) /* Jack connector */ |
| 29 | #define EXTCON_TYPE_DISP BIT(3) /* Display connector */ |
| 30 | #define EXTCON_TYPE_MISC BIT(4) /* Miscellaneous connector */ |
| 31 | |
| 32 | /* |
Chanwoo Choi | 73b6ecd | 2015-06-12 11:10:06 +0900 | [diff] [blame] | 33 | * Define the unique id of supported external connectors |
| 34 | */ |
Chanwoo Choi | 11eecf9 | 2015-10-03 14:15:13 +0900 | [diff] [blame] | 35 | #define EXTCON_NONE 0 |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 36 | |
Chanwoo Choi | 11eecf9 | 2015-10-03 14:15:13 +0900 | [diff] [blame] | 37 | /* USB external connector */ |
| 38 | #define EXTCON_USB 1 |
| 39 | #define EXTCON_USB_HOST 2 |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame] | 40 | |
Baolin Wang | db62286 | 2016-12-21 14:10:47 +0800 | [diff] [blame] | 41 | /* |
| 42 | * Charging external connector |
| 43 | * |
| 44 | * When one SDP charger connector was reported, we should also report |
| 45 | * the USB connector, which means EXTCON_CHG_USB_SDP should always |
| 46 | * appear together with EXTCON_USB. The same as ACA charger connector, |
| 47 | * EXTCON_CHG_USB_ACA would normally appear with EXTCON_USB_HOST. |
Baolin Wang | 62a3744 | 2017-01-03 13:50:54 +0800 | [diff] [blame] | 48 | * |
| 49 | * The EXTCON_CHG_USB_SLOW connector can provide at least 500mA of |
| 50 | * current at 5V. The EXTCON_CHG_USB_FAST connector can provide at |
| 51 | * least 1A of current at 5V. |
Baolin Wang | db62286 | 2016-12-21 14:10:47 +0800 | [diff] [blame] | 52 | */ |
Chanwoo Choi | 11eecf9 | 2015-10-03 14:15:13 +0900 | [diff] [blame] | 53 | #define EXTCON_CHG_USB_SDP 5 /* Standard Downstream Port */ |
| 54 | #define EXTCON_CHG_USB_DCP 6 /* Dedicated Charging Port */ |
| 55 | #define EXTCON_CHG_USB_CDP 7 /* Charging Downstream Port */ |
| 56 | #define EXTCON_CHG_USB_ACA 8 /* Accessory Charger Adapter */ |
| 57 | #define EXTCON_CHG_USB_FAST 9 |
| 58 | #define EXTCON_CHG_USB_SLOW 10 |
Chanwoo Choi | 7fe95fb | 2016-08-05 18:15:46 +0900 | [diff] [blame] | 59 | #define EXTCON_CHG_WPT 11 /* Wireless Power Transfer */ |
Chanwoo Choi | 3c5f0e0 | 2017-01-02 13:03:03 +0900 | [diff] [blame] | 60 | #define EXTCON_CHG_USB_PD 12 /* USB Power Delivery */ |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame] | 61 | |
Chanwoo Choi | 11eecf9 | 2015-10-03 14:15:13 +0900 | [diff] [blame] | 62 | /* Jack external connector */ |
| 63 | #define EXTCON_JACK_MICROPHONE 20 |
| 64 | #define EXTCON_JACK_HEADPHONE 21 |
| 65 | #define EXTCON_JACK_LINE_IN 22 |
| 66 | #define EXTCON_JACK_LINE_OUT 23 |
| 67 | #define EXTCON_JACK_VIDEO_IN 24 |
| 68 | #define EXTCON_JACK_VIDEO_OUT 25 |
| 69 | #define EXTCON_JACK_SPDIF_IN 26 /* Sony Philips Digital InterFace */ |
| 70 | #define EXTCON_JACK_SPDIF_OUT 27 |
Chanwoo Choi | 2a9de9c | 2015-04-24 19:16:05 +0900 | [diff] [blame] | 71 | |
Chanwoo Choi | 11eecf9 | 2015-10-03 14:15:13 +0900 | [diff] [blame] | 72 | /* Display external connector */ |
| 73 | #define EXTCON_DISP_HDMI 40 /* High-Definition Multimedia Interface */ |
| 74 | #define EXTCON_DISP_MHL 41 /* Mobile High-Definition Link */ |
| 75 | #define EXTCON_DISP_DVI 42 /* Digital Visual Interface */ |
| 76 | #define EXTCON_DISP_VGA 43 /* Video Graphics Array */ |
Chris Zhong | 2164188 | 2016-07-22 01:13:02 +0900 | [diff] [blame] | 77 | #define EXTCON_DISP_DP 44 /* Display Port */ |
Chanwoo Choi | 9c0595d | 2016-08-05 17:49:23 +0900 | [diff] [blame] | 78 | #define EXTCON_DISP_HMD 45 /* Head-Mounted Display */ |
Chanwoo Choi | 11eecf9 | 2015-10-03 14:15:13 +0900 | [diff] [blame] | 79 | |
| 80 | /* Miscellaneous external connector */ |
| 81 | #define EXTCON_DOCK 60 |
| 82 | #define EXTCON_JIG 61 |
| 83 | #define EXTCON_MECHANICAL 62 |
| 84 | |
| 85 | #define EXTCON_NUM 63 |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 86 | |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 87 | /* |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 88 | * Define the properties of supported external connectors. |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 89 | * |
| 90 | * When adding the new extcon property, they *must* have |
| 91 | * the type/value/default information. Also, you *have to* |
| 92 | * modify the EXTCON_PROP_[type]_START/END definitions |
| 93 | * which mean the range of the supported properties |
| 94 | * for each extcon type. |
| 95 | * |
| 96 | * The naming style of property |
| 97 | * : EXTCON_PROP_[type]_[property name] |
| 98 | * |
| 99 | * EXTCON_PROP_USB_[property name] : USB property |
| 100 | * EXTCON_PROP_CHG_[property name] : Charger property |
| 101 | * EXTCON_PROP_JACK_[property name] : Jack property |
| 102 | * EXTCON_PROP_DISP_[property name] : Display property |
| 103 | */ |
| 104 | |
| 105 | /* |
| 106 | * Properties of EXTCON_TYPE_USB. |
| 107 | * |
| 108 | * - EXTCON_PROP_USB_VBUS |
| 109 | * @type: integer (intval) |
| 110 | * @value: 0 (low) or 1 (high) |
| 111 | * @default: 0 (low) |
Chris Zhong | 2164188 | 2016-07-22 01:13:02 +0900 | [diff] [blame] | 112 | * - EXTCON_PROP_USB_TYPEC_POLARITY |
| 113 | * @type: integer (intval) |
| 114 | * @value: 0 (normal) or 1 (flip) |
| 115 | * @default: 0 (normal) |
Guenter Roeck | 8457a1b | 2016-08-15 06:15:35 -0700 | [diff] [blame] | 116 | * - EXTCON_PROP_USB_SS (SuperSpeed) |
| 117 | * @type: integer (intval) |
| 118 | * @value: 0 (USB/USB2) or 1 (USB3) |
| 119 | * @default: 0 (USB/USB2) |
| 120 | * |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 121 | */ |
| 122 | #define EXTCON_PROP_USB_VBUS 0 |
Chris Zhong | 2164188 | 2016-07-22 01:13:02 +0900 | [diff] [blame] | 123 | #define EXTCON_PROP_USB_TYPEC_POLARITY 1 |
Guenter Roeck | 8457a1b | 2016-08-15 06:15:35 -0700 | [diff] [blame] | 124 | #define EXTCON_PROP_USB_SS 2 |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 125 | |
| 126 | #define EXTCON_PROP_USB_MIN 0 |
Guenter Roeck | 8457a1b | 2016-08-15 06:15:35 -0700 | [diff] [blame] | 127 | #define EXTCON_PROP_USB_MAX 2 |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 128 | #define EXTCON_PROP_USB_CNT (EXTCON_PROP_USB_MAX - EXTCON_PROP_USB_MIN + 1) |
| 129 | |
| 130 | /* Properties of EXTCON_TYPE_CHG. */ |
| 131 | #define EXTCON_PROP_CHG_MIN 50 |
| 132 | #define EXTCON_PROP_CHG_MAX 50 |
| 133 | #define EXTCON_PROP_CHG_CNT (EXTCON_PROP_CHG_MAX - EXTCON_PROP_CHG_MIN + 1) |
| 134 | |
| 135 | /* Properties of EXTCON_TYPE_JACK. */ |
| 136 | #define EXTCON_PROP_JACK_MIN 100 |
| 137 | #define EXTCON_PROP_JACK_MAX 100 |
| 138 | #define EXTCON_PROP_JACK_CNT (EXTCON_PROP_JACK_MAX - EXTCON_PROP_JACK_MIN + 1) |
| 139 | |
Chris Zhong | c7914e8 | 2016-09-09 19:15:44 -0700 | [diff] [blame] | 140 | /* |
| 141 | * Properties of EXTCON_TYPE_DISP. |
| 142 | * |
| 143 | * - EXTCON_PROP_DISP_HPD (Hot Plug Detect) |
| 144 | * @type: integer (intval) |
| 145 | * @value: 0 (no hpd) or 1 (hpd) |
| 146 | * @default: 0 (no hpd) |
| 147 | * |
| 148 | */ |
| 149 | #define EXTCON_PROP_DISP_HPD 150 |
| 150 | |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 151 | /* Properties of EXTCON_TYPE_DISP. */ |
| 152 | #define EXTCON_PROP_DISP_MIN 150 |
Chris Zhong | c7914e8 | 2016-09-09 19:15:44 -0700 | [diff] [blame] | 153 | #define EXTCON_PROP_DISP_MAX 151 |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 154 | #define EXTCON_PROP_DISP_CNT (EXTCON_PROP_DISP_MAX - EXTCON_PROP_DISP_MIN + 1) |
| 155 | |
| 156 | /* |
| 157 | * Define the type of property's value. |
| 158 | * |
| 159 | * Define the property's value as union type. Because each property |
| 160 | * would need the different data type to store it. |
| 161 | */ |
| 162 | union extcon_property_value { |
| 163 | int intval; /* type : integer (intval) */ |
| 164 | }; |
| 165 | |
Chanwoo Choi | e6cf046 | 2016-12-26 20:37:38 +0900 | [diff] [blame] | 166 | struct extcon_dev; |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 167 | |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 168 | #if IS_ENABLED(CONFIG_EXTCON) |
Donggeun Kim | 74c5d09 | 2012-04-20 14:16:24 +0900 | [diff] [blame] | 169 | /* |
Chanwoo Choi | 176aa36 | 2017-09-21 12:11:24 +0900 | [diff] [blame] | 170 | * Following APIs get the connected state of each external connector. |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 171 | * The 'id' argument indicates the defined external connector. |
| 172 | */ |
| 173 | extern int extcon_get_state(struct extcon_dev *edev, unsigned int id); |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 174 | |
| 175 | /* |
Chanwoo Choi | 176aa36 | 2017-09-21 12:11:24 +0900 | [diff] [blame] | 176 | * Following APIs get the property of each external connector. |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 177 | * The 'id' argument indicates the defined external connector |
| 178 | * and the 'prop' indicates the extcon property. |
| 179 | * |
Chanwoo Choi | 176aa36 | 2017-09-21 12:11:24 +0900 | [diff] [blame] | 180 | * And extcon_get_property_capability() get the capability of the property |
| 181 | * for each external connector. They are used to get the capability of the |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 182 | * property of each external connector based on the id and property. |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 183 | */ |
| 184 | extern int extcon_get_property(struct extcon_dev *edev, unsigned int id, |
| 185 | unsigned int prop, |
| 186 | union extcon_property_value *prop_val); |
Chanwoo Choi | 7f2a0a1 | 2016-07-25 21:15:19 +0900 | [diff] [blame] | 187 | extern int extcon_get_property_capability(struct extcon_dev *edev, |
| 188 | unsigned int id, unsigned int prop); |
Chanwoo Choi | 7f2a0a1 | 2016-07-25 21:15:19 +0900 | [diff] [blame] | 189 | |
| 190 | /* |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 191 | * Following APIs register the notifier block in order to detect |
| 192 | * the change of both state and property value for each external connector. |
| 193 | * |
Chanwoo Choi | 815429b3 | 2017-03-29 19:30:17 +0900 | [diff] [blame] | 194 | * extcon_register_notifier(*edev, id, *nb) : Register a notifier block |
| 195 | * for specific external connector of the extcon. |
| 196 | * extcon_register_notifier_all(*edev, *nb) : Register a notifier block |
| 197 | * for all supported external connectors of the extcon. |
Donggeun Kim | 74c5d09 | 2012-04-20 14:16:24 +0900 | [diff] [blame] | 198 | */ |
Chanwoo Choi | 73b6ecd | 2015-06-12 11:10:06 +0900 | [diff] [blame] | 199 | extern int extcon_register_notifier(struct extcon_dev *edev, unsigned int id, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 200 | struct notifier_block *nb); |
Chanwoo Choi | 73b6ecd | 2015-06-12 11:10:06 +0900 | [diff] [blame] | 201 | extern int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 202 | struct notifier_block *nb); |
Chanwoo Choi | 58f3865 | 2016-06-27 20:03:39 +0900 | [diff] [blame] | 203 | extern int devm_extcon_register_notifier(struct device *dev, |
| 204 | struct extcon_dev *edev, unsigned int id, |
| 205 | struct notifier_block *nb); |
| 206 | extern void devm_extcon_unregister_notifier(struct device *dev, |
| 207 | struct extcon_dev *edev, unsigned int id, |
| 208 | struct notifier_block *nb); |
Chanwoo Choi | 1ad94ff | 2014-03-18 19:55:46 +0900 | [diff] [blame] | 209 | |
Chanwoo Choi | 815429b3 | 2017-03-29 19:30:17 +0900 | [diff] [blame] | 210 | extern int extcon_register_notifier_all(struct extcon_dev *edev, |
| 211 | struct notifier_block *nb); |
| 212 | extern int extcon_unregister_notifier_all(struct extcon_dev *edev, |
| 213 | struct notifier_block *nb); |
| 214 | extern int devm_extcon_register_notifier_all(struct device *dev, |
| 215 | struct extcon_dev *edev, |
| 216 | struct notifier_block *nb); |
| 217 | extern void devm_extcon_unregister_notifier_all(struct device *dev, |
| 218 | struct extcon_dev *edev, |
| 219 | struct notifier_block *nb); |
| 220 | |
Chanwoo Choi | 1ad94ff | 2014-03-18 19:55:46 +0900 | [diff] [blame] | 221 | /* |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 222 | * Following APIs get the extcon_dev from devicetree or by through extcon name. |
Chanwoo Choi | 1ad94ff | 2014-03-18 19:55:46 +0900 | [diff] [blame] | 223 | */ |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 224 | extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name); |
Andrzej Hajda | 370ed7a | 2018-02-27 13:22:07 +0100 | [diff] [blame] | 225 | extern struct extcon_dev *extcon_find_edev_by_node(struct device_node *node); |
Chanwoo Choi | b9ec23c | 2015-04-24 14:48:52 +0900 | [diff] [blame] | 226 | extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, |
| 227 | int index); |
Chanwoo Choi | 707d755 | 2015-04-15 13:57:51 +0900 | [diff] [blame] | 228 | |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 229 | /* Following API get the name of extcon device. */ |
Chanwoo Choi | 707d755 | 2015-04-15 13:57:51 +0900 | [diff] [blame] | 230 | extern const char *extcon_get_edev_name(struct extcon_dev *edev); |
| 231 | |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 232 | #else /* CONFIG_EXTCON */ |
Chanwoo Choi | 575c2b86 | 2016-07-22 13:03:17 +0900 | [diff] [blame] | 233 | static inline int extcon_get_state(struct extcon_dev *edev, unsigned int id) |
MyungJoo Ham | 806d9dd | 2012-04-20 14:16:25 +0900 | [diff] [blame] | 234 | { |
| 235 | return 0; |
| 236 | } |
| 237 | |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 238 | static inline int extcon_get_property(struct extcon_dev *edev, unsigned int id, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 239 | unsigned int prop, |
| 240 | union extcon_property_value *prop_val) |
Chanwoo Choi | 792e7e9e | 2016-07-11 19:30:43 +0900 | [diff] [blame] | 241 | { |
| 242 | return 0; |
| 243 | } |
Kishon Vijay Abraham I | cb9850d | 2016-09-15 15:46:11 +0530 | [diff] [blame] | 244 | |
Chanwoo Choi | 7f2a0a1 | 2016-07-25 21:15:19 +0900 | [diff] [blame] | 245 | static inline int extcon_get_property_capability(struct extcon_dev *edev, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 246 | unsigned int id, unsigned int prop) |
Chanwoo Choi | 7f2a0a1 | 2016-07-25 21:15:19 +0900 | [diff] [blame] | 247 | { |
| 248 | return 0; |
| 249 | } |
| 250 | |
Donggeun Kim | 74c5d09 | 2012-04-20 14:16:24 +0900 | [diff] [blame] | 251 | static inline int extcon_register_notifier(struct extcon_dev *edev, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 252 | unsigned int id, struct notifier_block *nb) |
Donggeun Kim | 74c5d09 | 2012-04-20 14:16:24 +0900 | [diff] [blame] | 253 | { |
| 254 | return 0; |
| 255 | } |
| 256 | |
| 257 | static inline int extcon_unregister_notifier(struct extcon_dev *edev, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 258 | unsigned int id, struct notifier_block *nb) |
Donggeun Kim | 74c5d09 | 2012-04-20 14:16:24 +0900 | [diff] [blame] | 259 | { |
| 260 | return 0; |
| 261 | } |
| 262 | |
Chanwoo Choi | 58f3865 | 2016-06-27 20:03:39 +0900 | [diff] [blame] | 263 | static inline int devm_extcon_register_notifier(struct device *dev, |
| 264 | struct extcon_dev *edev, unsigned int id, |
| 265 | struct notifier_block *nb) |
| 266 | { |
| 267 | return -ENOSYS; |
| 268 | } |
| 269 | |
| 270 | static inline void devm_extcon_unregister_notifier(struct device *dev, |
| 271 | struct extcon_dev *edev, unsigned int id, |
| 272 | struct notifier_block *nb) { } |
| 273 | |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 274 | static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name) |
| 275 | { |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 276 | return ERR_PTR(-ENODEV); |
Chanwoo Choi | 6ab6094f | 2017-04-03 19:45:48 +0900 | [diff] [blame] | 277 | } |
| 278 | |
Andrzej Hajda | 370ed7a | 2018-02-27 13:22:07 +0100 | [diff] [blame] | 279 | static inline struct extcon_dev *extcon_find_edev_by_node(struct device_node *node) |
| 280 | { |
| 281 | return ERR_PTR(-ENODEV); |
| 282 | } |
| 283 | |
Chanwoo Choi | 1ad94ff | 2014-03-18 19:55:46 +0900 | [diff] [blame] | 284 | static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 285 | int index) |
Chanwoo Choi | 1ad94ff | 2014-03-18 19:55:46 +0900 | [diff] [blame] | 286 | { |
| 287 | return ERR_PTR(-ENODEV); |
| 288 | } |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 289 | #endif /* CONFIG_EXTCON */ |
Chanwoo Choi | 830ae44 | 2016-05-31 17:32:30 +0900 | [diff] [blame] | 290 | |
| 291 | /* |
| 292 | * Following structure and API are deprecated. EXTCON remains the function |
| 293 | * definition to prevent the build break. |
| 294 | */ |
| 295 | struct extcon_specific_cable_nb { |
| 296 | struct notifier_block *user_nb; |
| 297 | int cable_index; |
| 298 | struct extcon_dev *edev; |
| 299 | unsigned long previous_value; |
| 300 | }; |
| 301 | |
| 302 | static inline int extcon_register_interest(struct extcon_specific_cable_nb *obj, |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 303 | const char *extcon_name, const char *cable_name, |
| 304 | struct notifier_block *nb) |
Chanwoo Choi | 830ae44 | 2016-05-31 17:32:30 +0900 | [diff] [blame] | 305 | { |
| 306 | return -EINVAL; |
| 307 | } |
| 308 | |
Chanwoo Choi | ab8a8fb | 2017-07-14 01:00:55 +0900 | [diff] [blame] | 309 | static inline int extcon_unregister_interest(struct extcon_specific_cable_nb *obj) |
Chanwoo Choi | 830ae44 | 2016-05-31 17:32:30 +0900 | [diff] [blame] | 310 | { |
| 311 | return -EINVAL; |
| 312 | } |
MyungJoo Ham | de55d87 | 2012-04-20 14:16:22 +0900 | [diff] [blame] | 313 | #endif /* __LINUX_EXTCON_H__ */ |