Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 1 | /* |
| 2 | * phy.h -- generic phy header file |
| 3 | * |
| 4 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com |
| 5 | * |
| 6 | * Author: Kishon Vijay Abraham I <kishon@ti.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __DRIVERS_PHY_H |
| 15 | #define __DRIVERS_PHY_H |
| 16 | |
| 17 | #include <linux/err.h> |
| 18 | #include <linux/of.h> |
| 19 | #include <linux/device.h> |
| 20 | #include <linux/pm_runtime.h> |
Roger Quadros | 3be8812 | 2014-07-04 12:55:45 +0300 | [diff] [blame] | 21 | #include <linux/regulator/consumer.h> |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 22 | |
| 23 | struct phy; |
| 24 | |
David Lechner | 300eb01 | 2016-05-09 18:39:59 -0500 | [diff] [blame] | 25 | enum phy_mode { |
| 26 | PHY_MODE_INVALID, |
| 27 | PHY_MODE_USB_HOST, |
| 28 | PHY_MODE_USB_DEVICE, |
| 29 | PHY_MODE_USB_OTG, |
Antoine Tenart | 5c23f2d | 2017-08-30 10:29:12 +0200 | [diff] [blame] | 30 | PHY_MODE_SGMII, |
| 31 | PHY_MODE_10GKR, |
Vivek Gautam | fd3e4c9 | 2017-10-12 11:49:33 +0530 | [diff] [blame^] | 32 | PHY_MODE_UFS_HS_A, |
| 33 | PHY_MODE_UFS_HS_B, |
David Lechner | 300eb01 | 2016-05-09 18:39:59 -0500 | [diff] [blame] | 34 | }; |
| 35 | |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 36 | /** |
| 37 | * struct phy_ops - set of function pointers for performing phy operations |
| 38 | * @init: operation to be performed for initializing phy |
| 39 | * @exit: operation to be performed while exiting |
| 40 | * @power_on: powering on the phy |
| 41 | * @power_off: powering off the phy |
David Lechner | 300eb01 | 2016-05-09 18:39:59 -0500 | [diff] [blame] | 42 | * @set_mode: set the mode of the phy |
Randy Li | cac18ec | 2016-09-10 02:59:37 +0800 | [diff] [blame] | 43 | * @reset: resetting the phy |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 44 | * @owner: the module owner containing the ops |
| 45 | */ |
| 46 | struct phy_ops { |
| 47 | int (*init)(struct phy *phy); |
| 48 | int (*exit)(struct phy *phy); |
| 49 | int (*power_on)(struct phy *phy); |
| 50 | int (*power_off)(struct phy *phy); |
David Lechner | 300eb01 | 2016-05-09 18:39:59 -0500 | [diff] [blame] | 51 | int (*set_mode)(struct phy *phy, enum phy_mode mode); |
Randy Li | cac18ec | 2016-09-10 02:59:37 +0800 | [diff] [blame] | 52 | int (*reset)(struct phy *phy); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 53 | struct module *owner; |
| 54 | }; |
| 55 | |
| 56 | /** |
Matt Porter | 8feed34 | 2013-12-19 09:23:02 -0500 | [diff] [blame] | 57 | * struct phy_attrs - represents phy attributes |
| 58 | * @bus_width: Data path width implemented by PHY |
| 59 | */ |
| 60 | struct phy_attrs { |
| 61 | u32 bus_width; |
| 62 | }; |
| 63 | |
| 64 | /** |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 65 | * struct phy - represents the phy device |
| 66 | * @dev: phy device |
| 67 | * @id: id of the phy device |
| 68 | * @ops: function pointers for performing phy operations |
| 69 | * @init_data: list of PHY consumers (non-dt only) |
| 70 | * @mutex: mutex to protect phy_ops |
| 71 | * @init_count: used to protect when the PHY is used by multiple consumers |
| 72 | * @power_count: used to protect when the PHY is used by multiple consumers |
Matt Porter | 8feed34 | 2013-12-19 09:23:02 -0500 | [diff] [blame] | 73 | * @phy_attrs: used to specify PHY specific attributes |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 74 | */ |
| 75 | struct phy { |
| 76 | struct device dev; |
| 77 | int id; |
| 78 | const struct phy_ops *ops; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 79 | struct mutex mutex; |
| 80 | int init_count; |
| 81 | int power_count; |
Matt Porter | 8feed34 | 2013-12-19 09:23:02 -0500 | [diff] [blame] | 82 | struct phy_attrs attrs; |
Roger Quadros | 3be8812 | 2014-07-04 12:55:45 +0300 | [diff] [blame] | 83 | struct regulator *pwr; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | /** |
| 87 | * struct phy_provider - represents the phy provider |
| 88 | * @dev: phy provider device |
| 89 | * @owner: the module owner having of_xlate |
| 90 | * @of_xlate: function pointer to obtain phy instance from phy pointer |
| 91 | * @list: to maintain a linked list of PHY providers |
| 92 | */ |
| 93 | struct phy_provider { |
| 94 | struct device *dev; |
Thierry Reding | 1140f7c | 2016-04-05 17:17:34 +0200 | [diff] [blame] | 95 | struct device_node *children; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 96 | struct module *owner; |
| 97 | struct list_head list; |
| 98 | struct phy * (*of_xlate)(struct device *dev, |
| 99 | struct of_phandle_args *args); |
| 100 | }; |
| 101 | |
Heikki Krogerus | b7bc15b | 2014-11-19 17:28:18 +0200 | [diff] [blame] | 102 | struct phy_lookup { |
| 103 | struct list_head node; |
| 104 | const char *dev_id; |
| 105 | const char *con_id; |
| 106 | struct phy *phy; |
| 107 | }; |
| 108 | |
Heikki Krogerus | d451057 | 2014-11-19 17:28:17 +0200 | [diff] [blame] | 109 | #define to_phy(a) (container_of((a), struct phy, dev)) |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 110 | |
| 111 | #define of_phy_provider_register(dev, xlate) \ |
Thierry Reding | 1140f7c | 2016-04-05 17:17:34 +0200 | [diff] [blame] | 112 | __of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate)) |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 113 | |
| 114 | #define devm_of_phy_provider_register(dev, xlate) \ |
Thierry Reding | 1140f7c | 2016-04-05 17:17:34 +0200 | [diff] [blame] | 115 | __devm_of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate)) |
| 116 | |
| 117 | #define of_phy_provider_register_full(dev, children, xlate) \ |
| 118 | __of_phy_provider_register(dev, children, THIS_MODULE, xlate) |
| 119 | |
| 120 | #define devm_of_phy_provider_register_full(dev, children, xlate) \ |
| 121 | __devm_of_phy_provider_register(dev, children, THIS_MODULE, xlate) |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 122 | |
| 123 | static inline void phy_set_drvdata(struct phy *phy, void *data) |
| 124 | { |
| 125 | dev_set_drvdata(&phy->dev, data); |
| 126 | } |
| 127 | |
| 128 | static inline void *phy_get_drvdata(struct phy *phy) |
| 129 | { |
| 130 | return dev_get_drvdata(&phy->dev); |
| 131 | } |
| 132 | |
| 133 | #if IS_ENABLED(CONFIG_GENERIC_PHY) |
| 134 | int phy_pm_runtime_get(struct phy *phy); |
| 135 | int phy_pm_runtime_get_sync(struct phy *phy); |
| 136 | int phy_pm_runtime_put(struct phy *phy); |
| 137 | int phy_pm_runtime_put_sync(struct phy *phy); |
| 138 | void phy_pm_runtime_allow(struct phy *phy); |
| 139 | void phy_pm_runtime_forbid(struct phy *phy); |
| 140 | int phy_init(struct phy *phy); |
| 141 | int phy_exit(struct phy *phy); |
| 142 | int phy_power_on(struct phy *phy); |
| 143 | int phy_power_off(struct phy *phy); |
David Lechner | 300eb01 | 2016-05-09 18:39:59 -0500 | [diff] [blame] | 144 | int phy_set_mode(struct phy *phy, enum phy_mode mode); |
Randy Li | cac18ec | 2016-09-10 02:59:37 +0800 | [diff] [blame] | 145 | int phy_reset(struct phy *phy); |
Matt Porter | 8feed34 | 2013-12-19 09:23:02 -0500 | [diff] [blame] | 146 | static inline int phy_get_bus_width(struct phy *phy) |
| 147 | { |
| 148 | return phy->attrs.bus_width; |
| 149 | } |
| 150 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) |
| 151 | { |
| 152 | phy->attrs.bus_width = bus_width; |
| 153 | } |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 154 | struct phy *phy_get(struct device *dev, const char *string); |
Andrew Lunn | 788a4d5 | 2014-02-04 18:33:12 +0100 | [diff] [blame] | 155 | struct phy *phy_optional_get(struct device *dev, const char *string); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 156 | struct phy *devm_phy_get(struct device *dev, const char *string); |
Andrew Lunn | 788a4d5 | 2014-02-04 18:33:12 +0100 | [diff] [blame] | 157 | struct phy *devm_phy_optional_get(struct device *dev, const char *string); |
Kamil Debski | b5d682f | 2014-03-06 12:16:47 +0100 | [diff] [blame] | 158 | struct phy *devm_of_phy_get(struct device *dev, struct device_node *np, |
| 159 | const char *con_id); |
Arun Ramamurthy | 6be109b | 2015-04-22 16:04:11 -0700 | [diff] [blame] | 160 | struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np, |
| 161 | int index); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 162 | void phy_put(struct phy *phy); |
| 163 | void devm_phy_put(struct device *dev, struct phy *phy); |
Kamil Debski | 0b3f3b2 | 2014-03-06 12:16:46 +0100 | [diff] [blame] | 164 | struct phy *of_phy_get(struct device_node *np, const char *con_id); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 165 | struct phy *of_phy_simple_xlate(struct device *dev, |
| 166 | struct of_phandle_args *args); |
Kishon Vijay Abraham I | f0ed817 | 2014-07-14 15:55:02 +0530 | [diff] [blame] | 167 | struct phy *phy_create(struct device *dev, struct device_node *node, |
Heikki Krogerus | dbc9863 | 2014-11-19 17:28:21 +0200 | [diff] [blame] | 168 | const struct phy_ops *ops); |
Kishon Vijay Abraham I | f0ed817 | 2014-07-14 15:55:02 +0530 | [diff] [blame] | 169 | struct phy *devm_phy_create(struct device *dev, struct device_node *node, |
Heikki Krogerus | dbc9863 | 2014-11-19 17:28:21 +0200 | [diff] [blame] | 170 | const struct phy_ops *ops); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 171 | void phy_destroy(struct phy *phy); |
| 172 | void devm_phy_destroy(struct device *dev, struct phy *phy); |
| 173 | struct phy_provider *__of_phy_provider_register(struct device *dev, |
Thierry Reding | 1140f7c | 2016-04-05 17:17:34 +0200 | [diff] [blame] | 174 | struct device_node *children, struct module *owner, |
| 175 | struct phy * (*of_xlate)(struct device *dev, |
| 176 | struct of_phandle_args *args)); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 177 | struct phy_provider *__devm_of_phy_provider_register(struct device *dev, |
Thierry Reding | 1140f7c | 2016-04-05 17:17:34 +0200 | [diff] [blame] | 178 | struct device_node *children, struct module *owner, |
| 179 | struct phy * (*of_xlate)(struct device *dev, |
| 180 | struct of_phandle_args *args)); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 181 | void of_phy_provider_unregister(struct phy_provider *phy_provider); |
| 182 | void devm_of_phy_provider_unregister(struct device *dev, |
| 183 | struct phy_provider *phy_provider); |
Heikki Krogerus | b7bc15b | 2014-11-19 17:28:18 +0200 | [diff] [blame] | 184 | int phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id); |
| 185 | void phy_remove_lookup(struct phy *phy, const char *con_id, const char *dev_id); |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 186 | #else |
| 187 | static inline int phy_pm_runtime_get(struct phy *phy) |
| 188 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 189 | if (!phy) |
| 190 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 191 | return -ENOSYS; |
| 192 | } |
| 193 | |
| 194 | static inline int phy_pm_runtime_get_sync(struct phy *phy) |
| 195 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 196 | if (!phy) |
| 197 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 198 | return -ENOSYS; |
| 199 | } |
| 200 | |
| 201 | static inline int phy_pm_runtime_put(struct phy *phy) |
| 202 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 203 | if (!phy) |
| 204 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 205 | return -ENOSYS; |
| 206 | } |
| 207 | |
| 208 | static inline int phy_pm_runtime_put_sync(struct phy *phy) |
| 209 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 210 | if (!phy) |
| 211 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 212 | return -ENOSYS; |
| 213 | } |
| 214 | |
| 215 | static inline void phy_pm_runtime_allow(struct phy *phy) |
| 216 | { |
| 217 | return; |
| 218 | } |
| 219 | |
| 220 | static inline void phy_pm_runtime_forbid(struct phy *phy) |
| 221 | { |
| 222 | return; |
| 223 | } |
| 224 | |
| 225 | static inline int phy_init(struct phy *phy) |
| 226 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 227 | if (!phy) |
| 228 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 229 | return -ENOSYS; |
| 230 | } |
| 231 | |
| 232 | static inline int phy_exit(struct phy *phy) |
| 233 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 234 | if (!phy) |
| 235 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 236 | return -ENOSYS; |
| 237 | } |
| 238 | |
| 239 | static inline int phy_power_on(struct phy *phy) |
| 240 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 241 | if (!phy) |
| 242 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 243 | return -ENOSYS; |
| 244 | } |
| 245 | |
| 246 | static inline int phy_power_off(struct phy *phy) |
| 247 | { |
Grygorii Strashko | 2b97789 | 2014-04-19 08:51:44 +0530 | [diff] [blame] | 248 | if (!phy) |
| 249 | return 0; |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 250 | return -ENOSYS; |
| 251 | } |
| 252 | |
David Lechner | 300eb01 | 2016-05-09 18:39:59 -0500 | [diff] [blame] | 253 | static inline int phy_set_mode(struct phy *phy, enum phy_mode mode) |
| 254 | { |
| 255 | if (!phy) |
| 256 | return 0; |
| 257 | return -ENOSYS; |
| 258 | } |
| 259 | |
Randy Li | 98430c7 | 2016-10-25 22:15:34 +0800 | [diff] [blame] | 260 | static inline int phy_reset(struct phy *phy) |
| 261 | { |
| 262 | if (!phy) |
| 263 | return 0; |
| 264 | return -ENOSYS; |
| 265 | } |
| 266 | |
Matt Porter | 8feed34 | 2013-12-19 09:23:02 -0500 | [diff] [blame] | 267 | static inline int phy_get_bus_width(struct phy *phy) |
| 268 | { |
| 269 | return -ENOSYS; |
| 270 | } |
| 271 | |
| 272 | static inline void phy_set_bus_width(struct phy *phy, int bus_width) |
| 273 | { |
| 274 | return; |
| 275 | } |
| 276 | |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 277 | static inline struct phy *phy_get(struct device *dev, const char *string) |
| 278 | { |
| 279 | return ERR_PTR(-ENOSYS); |
| 280 | } |
| 281 | |
Andrew Lunn | 788a4d5 | 2014-02-04 18:33:12 +0100 | [diff] [blame] | 282 | static inline struct phy *phy_optional_get(struct device *dev, |
| 283 | const char *string) |
| 284 | { |
| 285 | return ERR_PTR(-ENOSYS); |
| 286 | } |
| 287 | |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 288 | static inline struct phy *devm_phy_get(struct device *dev, const char *string) |
| 289 | { |
| 290 | return ERR_PTR(-ENOSYS); |
| 291 | } |
| 292 | |
Andrew Lunn | 788a4d5 | 2014-02-04 18:33:12 +0100 | [diff] [blame] | 293 | static inline struct phy *devm_phy_optional_get(struct device *dev, |
| 294 | const char *string) |
| 295 | { |
Maxime Ripard | 11a6e41 | 2017-09-04 14:53:13 +0200 | [diff] [blame] | 296 | return NULL; |
Andrew Lunn | 788a4d5 | 2014-02-04 18:33:12 +0100 | [diff] [blame] | 297 | } |
| 298 | |
Kamil Debski | b5d682f | 2014-03-06 12:16:47 +0100 | [diff] [blame] | 299 | static inline struct phy *devm_of_phy_get(struct device *dev, |
| 300 | struct device_node *np, |
| 301 | const char *con_id) |
| 302 | { |
| 303 | return ERR_PTR(-ENOSYS); |
| 304 | } |
| 305 | |
Arun Ramamurthy | 6be109b | 2015-04-22 16:04:11 -0700 | [diff] [blame] | 306 | static inline struct phy *devm_of_phy_get_by_index(struct device *dev, |
| 307 | struct device_node *np, |
| 308 | int index) |
| 309 | { |
| 310 | return ERR_PTR(-ENOSYS); |
| 311 | } |
| 312 | |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 313 | static inline void phy_put(struct phy *phy) |
| 314 | { |
| 315 | } |
| 316 | |
| 317 | static inline void devm_phy_put(struct device *dev, struct phy *phy) |
| 318 | { |
| 319 | } |
| 320 | |
Kamil Debski | 0b3f3b2 | 2014-03-06 12:16:46 +0100 | [diff] [blame] | 321 | static inline struct phy *of_phy_get(struct device_node *np, const char *con_id) |
| 322 | { |
| 323 | return ERR_PTR(-ENOSYS); |
| 324 | } |
| 325 | |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 326 | static inline struct phy *of_phy_simple_xlate(struct device *dev, |
| 327 | struct of_phandle_args *args) |
| 328 | { |
| 329 | return ERR_PTR(-ENOSYS); |
| 330 | } |
| 331 | |
| 332 | static inline struct phy *phy_create(struct device *dev, |
Kishon Vijay Abraham I | f0ed817 | 2014-07-14 15:55:02 +0530 | [diff] [blame] | 333 | struct device_node *node, |
Heikki Krogerus | dbc9863 | 2014-11-19 17:28:21 +0200 | [diff] [blame] | 334 | const struct phy_ops *ops) |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 335 | { |
| 336 | return ERR_PTR(-ENOSYS); |
| 337 | } |
| 338 | |
| 339 | static inline struct phy *devm_phy_create(struct device *dev, |
Kishon Vijay Abraham I | f0ed817 | 2014-07-14 15:55:02 +0530 | [diff] [blame] | 340 | struct device_node *node, |
Heikki Krogerus | dbc9863 | 2014-11-19 17:28:21 +0200 | [diff] [blame] | 341 | const struct phy_ops *ops) |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 342 | { |
| 343 | return ERR_PTR(-ENOSYS); |
| 344 | } |
| 345 | |
| 346 | static inline void phy_destroy(struct phy *phy) |
| 347 | { |
| 348 | } |
| 349 | |
| 350 | static inline void devm_phy_destroy(struct device *dev, struct phy *phy) |
| 351 | { |
| 352 | } |
| 353 | |
| 354 | static inline struct phy_provider *__of_phy_provider_register( |
Thierry Reding | 1140f7c | 2016-04-05 17:17:34 +0200 | [diff] [blame] | 355 | struct device *dev, struct device_node *children, struct module *owner, |
| 356 | struct phy * (*of_xlate)(struct device *dev, |
| 357 | struct of_phandle_args *args)) |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 358 | { |
| 359 | return ERR_PTR(-ENOSYS); |
| 360 | } |
| 361 | |
| 362 | static inline struct phy_provider *__devm_of_phy_provider_register(struct device |
Thierry Reding | 1140f7c | 2016-04-05 17:17:34 +0200 | [diff] [blame] | 363 | *dev, struct device_node *children, struct module *owner, |
| 364 | struct phy * (*of_xlate)(struct device *dev, |
| 365 | struct of_phandle_args *args)) |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 366 | { |
| 367 | return ERR_PTR(-ENOSYS); |
| 368 | } |
| 369 | |
| 370 | static inline void of_phy_provider_unregister(struct phy_provider *phy_provider) |
| 371 | { |
| 372 | } |
| 373 | |
| 374 | static inline void devm_of_phy_provider_unregister(struct device *dev, |
| 375 | struct phy_provider *phy_provider) |
| 376 | { |
| 377 | } |
Heikki Krogerus | b7bc15b | 2014-11-19 17:28:18 +0200 | [diff] [blame] | 378 | static inline int |
| 379 | phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id) |
| 380 | { |
| 381 | return 0; |
| 382 | } |
| 383 | static inline void phy_remove_lookup(struct phy *phy, const char *con_id, |
| 384 | const char *dev_id) { } |
Kishon Vijay Abraham I | ff76496 | 2013-09-27 11:53:25 +0530 | [diff] [blame] | 385 | #endif |
| 386 | |
| 387 | #endif /* __DRIVERS_PHY_H */ |