Lines Matching refs:phy

3  * phy.h -- generic phy header file
19 #include <linux/phy/phy-dp.h>
20 #include <linux/phy/phy-lvds.h>
21 #include <linux/phy/phy-mipi-dphy.h>
23 struct phy;
55 * union phy_configure_opts - Opaque generic phy configuration
58 * the MIPI_DPHY phy mode.
62 * the LVDS phy mode.
71 * struct phy_ops - set of function pointers for performing phy operations
72 * @init: operation to be performed for initializing phy
74 * @power_on: powering on the phy
75 * @power_off: powering off the phy
76 * @set_mode: set the mode of the phy
77 * @set_media: set the media type of the phy (optional)
78 * @set_speed: set the speed of the phy (optional)
79 * @reset: resetting the phy
80 * @calibrate: calibrate the phy
85 int (*init)(struct phy *phy);
86 int (*exit)(struct phy *phy);
87 int (*power_on)(struct phy *phy);
88 int (*power_off)(struct phy *phy);
89 int (*set_mode)(struct phy *phy, enum phy_mode mode, int submode);
90 int (*set_media)(struct phy *phy, enum phy_media media);
91 int (*set_speed)(struct phy *phy, int speed);
99 * been called on the phy.
103 int (*configure)(struct phy *phy, union phy_configure_opts *opts);
111 * handled by the phy. Implementations are free to tune the
121 int (*validate)(struct phy *phy, enum phy_mode mode, int submode,
123 int (*reset)(struct phy *phy);
124 int (*calibrate)(struct phy *phy);
126 /* notify phy connect status change */
127 int (*connect)(struct phy *phy, int port);
128 int (*disconnect)(struct phy *phy, int port);
130 void (*release)(struct phy *phy);
135 * struct phy_attrs - represents phy attributes
147 * struct phy - represents the phy device
148 * @dev: phy device
149 * @id: id of the phy device
150 * @ops: function pointers for performing phy operations
155 * @pwr: power regulator associated with the phy
158 struct phy {
171 * struct phy_provider - represents the phy provider
172 * @dev: phy provider device
176 * @of_xlate: function pointer to obtain phy instance from phy pointer
183 struct phy * (*of_xlate)(struct device *dev,
188 * struct phy_lookup - PHY association in list of phys managed by the phy driver
192 * @phy: the phy of the association
198 struct phy *phy;
201 #define to_phy(a) (container_of((a), struct phy, dev))
215 static inline void phy_set_drvdata(struct phy *phy, void *data)
217 dev_set_drvdata(&phy->dev, data);
220 static inline void *phy_get_drvdata(struct phy *phy)
222 return dev_get_drvdata(&phy->dev);
226 int phy_pm_runtime_get(struct phy *phy);
227 int phy_pm_runtime_get_sync(struct phy *phy);
228 int phy_pm_runtime_put(struct phy *phy);
229 int phy_pm_runtime_put_sync(struct phy *phy);
230 void phy_pm_runtime_allow(struct phy *phy);
231 void phy_pm_runtime_forbid(struct phy *phy);
232 int phy_init(struct phy *phy);
233 int phy_exit(struct phy *phy);
234 int phy_power_on(struct phy *phy);
235 int phy_power_off(struct phy *phy);
236 int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode);
237 #define phy_set_mode(phy, mode) \
238 phy_set_mode_ext(phy, mode, 0)
239 int phy_set_media(struct phy *phy, enum phy_media media);
240 int phy_set_speed(struct phy *phy, int speed);
241 int phy_configure(struct phy *phy, union phy_configure_opts *opts);
242 int phy_validate(struct phy *phy, enum phy_mode mode, int submode,
245 static inline enum phy_mode phy_get_mode(struct phy *phy)
247 return phy->attrs.mode;
249 int phy_reset(struct phy *phy);
250 int phy_calibrate(struct phy *phy);
251 int phy_notify_connect(struct phy *phy, int port);
252 int phy_notify_disconnect(struct phy *phy, int port);
253 static inline int phy_get_bus_width(struct phy *phy)
255 return phy->attrs.bus_width;
257 static inline void phy_set_bus_width(struct phy *phy, int bus_width)
259 phy->attrs.bus_width = bus_width;
261 struct phy *phy_get(struct device *dev, const char *string);
262 struct phy *devm_phy_get(struct device *dev, const char *string);
263 struct phy *devm_phy_optional_get(struct device *dev, const char *string);
264 struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
266 struct phy *devm_of_phy_optional_get(struct device *dev, struct device_node *np,
268 struct phy *devm_of_phy_get_by_index(struct device *dev, struct device_node *np,
270 void of_phy_put(struct phy *phy);
271 void phy_put(struct device *dev, struct phy *phy);
272 void devm_phy_put(struct device *dev, struct phy *phy);
273 struct phy *of_phy_get(struct device_node *np, const char *con_id);
274 struct phy *of_phy_simple_xlate(struct device *dev,
276 struct phy *phy_create(struct device *dev, struct device_node *node,
278 struct phy *devm_phy_create(struct device *dev, struct device_node *node,
280 void phy_destroy(struct phy *phy);
281 void devm_phy_destroy(struct device *dev, struct phy *phy);
284 struct phy * (*of_xlate)(struct device *dev,
288 struct phy * (*of_xlate)(struct device *dev,
293 int phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id);
294 void phy_remove_lookup(struct phy *phy, const char *con_id, const char *dev_id);
296 static inline int phy_pm_runtime_get(struct phy *phy)
298 if (!phy)
303 static inline int phy_pm_runtime_get_sync(struct phy *phy)
305 if (!phy)
310 static inline int phy_pm_runtime_put(struct phy *phy)
312 if (!phy)
317 static inline int phy_pm_runtime_put_sync(struct phy *phy)
319 if (!phy)
324 static inline void phy_pm_runtime_allow(struct phy *phy)
329 static inline void phy_pm_runtime_forbid(struct phy *phy)
334 static inline int phy_init(struct phy *phy)
336 if (!phy)
341 static inline int phy_exit(struct phy *phy)
343 if (!phy)
348 static inline int phy_power_on(struct phy *phy)
350 if (!phy)
355 static inline int phy_power_off(struct phy *phy)
357 if (!phy)
362 static inline int phy_set_mode_ext(struct phy *phy, enum phy_mode mode,
365 if (!phy)
370 #define phy_set_mode(phy, mode) \
371 phy_set_mode_ext(phy, mode, 0)
373 static inline int phy_set_media(struct phy *phy, enum phy_media media)
375 if (!phy)
380 static inline int phy_set_speed(struct phy *phy, int speed)
382 if (!phy)
387 static inline enum phy_mode phy_get_mode(struct phy *phy)
392 static inline int phy_reset(struct phy *phy)
394 if (!phy)
399 static inline int phy_calibrate(struct phy *phy)
401 if (!phy)
406 static inline int phy_notify_connect(struct phy *phy, int index)
408 if (!phy)
413 static inline int phy_notify_disconnect(struct phy *phy, int index)
415 if (!phy)
420 static inline int phy_configure(struct phy *phy,
423 if (!phy)
429 static inline int phy_validate(struct phy *phy, enum phy_mode mode, int submode,
432 if (!phy)
438 static inline int phy_get_bus_width(struct phy *phy)
443 static inline void phy_set_bus_width(struct phy *phy, int bus_width)
448 static inline struct phy *phy_get(struct device *dev, const char *string)
453 static inline struct phy *devm_phy_get(struct device *dev, const char *string)
458 static inline struct phy *devm_phy_optional_get(struct device *dev,
464 static inline struct phy *devm_of_phy_get(struct device *dev,
471 static inline struct phy *devm_of_phy_optional_get(struct device *dev,
478 static inline struct phy *devm_of_phy_get_by_index(struct device *dev,
485 static inline void of_phy_put(struct phy *phy)
489 static inline void phy_put(struct device *dev, struct phy *phy)
493 static inline void devm_phy_put(struct device *dev, struct phy *phy)
497 static inline struct phy *of_phy_get(struct device_node *np, const char *con_id)
502 static inline struct phy *of_phy_simple_xlate(struct device *dev,
508 static inline struct phy *phy_create(struct device *dev,
515 static inline struct phy *devm_phy_create(struct device *dev,
522 static inline void phy_destroy(struct phy *phy)
526 static inline void devm_phy_destroy(struct device *dev, struct phy *phy)
532 struct phy * (*of_xlate)(struct device *dev,
540 struct phy * (*of_xlate)(struct device *dev,
555 phy_create_lookup(struct phy *phy, const char *con_id, const char *dev_id)
559 static inline void phy_remove_lookup(struct phy *phy, const char *con_id,