diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2014-11-19 10:28:18 -0500 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2014-11-21 09:18:50 -0500 |
commit | b7bc15b98e843926d01eb03b9c0e196d8ddbadeb (patch) | |
tree | 1ad10eb0f6e27ec06b17bbeed233b31d4cde66d3 /include/linux/phy | |
parent | d451057464a7ea2fe400e56c8a7e004c875f2a84 (diff) |
phy: improved lookup method
Separates registration of the phy and the lookup. The method
is copied from clkdev.c,
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'include/linux/phy')
-rw-r--r-- | include/linux/phy/phy.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 9fda68324298..849284e5873f 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
@@ -110,6 +110,13 @@ struct phy_init_data { | |||
110 | .port = _port, \ | 110 | .port = _port, \ |
111 | } | 111 | } |
112 | 112 | ||
113 | struct phy_lookup { | ||
114 | struct list_head node; | ||
115 | const char *dev_id; | ||
116 | const char *con_id; | ||
117 | struct phy *phy; | ||
118 | }; | ||
119 | |||
113 | #define to_phy(a) (container_of((a), struct phy, dev)) | 120 | #define to_phy(a) (container_of((a), struct phy, dev)) |
114 | 121 | ||
115 | #define of_phy_provider_register(dev, xlate) \ | 122 | #define of_phy_provider_register(dev, xlate) \ |
@@ -174,6 +181,8 @@ struct phy_provider *__devm_of_phy_provider_register(struct device *dev, | |||
174 | void of_phy_provider_unregister(struct phy_provider *phy_provider); | 181 | void of_phy_provider_unregister(struct phy_provider *phy_provider); |
175 | void devm_of_phy_provider_unregister(struct device *dev, | 182 | void devm_of_phy_provider_unregister(struct device *dev, |
176 | struct phy_provider *phy_provider); | 183 | struct phy_provider *phy_provider); |
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); | ||
177 | #else | 186 | #else |
178 | static inline int phy_pm_runtime_get(struct phy *phy) | 187 | static inline int phy_pm_runtime_get(struct phy *phy) |
179 | { | 188 | { |
@@ -345,6 +354,13 @@ static inline void devm_of_phy_provider_unregister(struct device *dev, | |||
345 | struct phy_provider *phy_provider) | 354 | struct phy_provider *phy_provider) |
346 | { | 355 | { |
347 | } | 356 | } |
357 | static inline int | ||
358 | phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id) | ||
359 | { | ||
360 | return 0; | ||
361 | } | ||
362 | static inline void phy_remove_lookup(struct phy *phy, const char *con_id, | ||
363 | const char *dev_id) { } | ||
348 | #endif | 364 | #endif |
349 | 365 | ||
350 | #endif /* __DRIVERS_PHY_H */ | 366 | #endif /* __DRIVERS_PHY_H */ |