diff options
| author | Manu Gautam <mgautam@codeaurora.org> | 2018-01-16 05:57:09 -0500 |
|---|---|---|
| committer | Kishon Vijay Abraham I <kishon@ti.com> | 2018-03-08 03:26:17 -0500 |
| commit | 3b3cd24ae61b3bbe9d3cecaff33e7cb3250ce47a (patch) | |
| tree | b321514a374f357ec67bd3c2f80f5e105ef7c57e /include/linux/phy | |
| parent | efb05a50c956b4ccd09c8401eed53bf3894d4026 (diff) | |
phy: Add USB speed related PHY modes
Add following USB speed related PHY modes:
LS (Low Speed), FS (Full Speed), HS (High Speed), SS (Super Speed)
Speed related information is required by some QCOM PHY drivers
to program PHY monitor resume/remote-wakeup events in suspended
state. Speed is needed in order to set correct polarity of wakeup
events for detection. E.g. QUSB2 PHY monitors DP/DM line state
depending on whether speed is LS or FS/HS to detect resume.
Similarly QMP USB3 PHY in SS mode should monitor RX terminations
attach/detach and LFPS events depending on SSPHY is active or not.
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'include/linux/phy')
| -rw-r--r-- | include/linux/phy/phy.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index 4f8423a948d5..485469e6fa7f 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
| @@ -25,7 +25,15 @@ struct phy; | |||
| 25 | enum phy_mode { | 25 | enum phy_mode { |
| 26 | PHY_MODE_INVALID, | 26 | PHY_MODE_INVALID, |
| 27 | PHY_MODE_USB_HOST, | 27 | PHY_MODE_USB_HOST, |
| 28 | PHY_MODE_USB_HOST_LS, | ||
| 29 | PHY_MODE_USB_HOST_FS, | ||
| 30 | PHY_MODE_USB_HOST_HS, | ||
| 31 | PHY_MODE_USB_HOST_SS, | ||
| 28 | PHY_MODE_USB_DEVICE, | 32 | PHY_MODE_USB_DEVICE, |
| 33 | PHY_MODE_USB_DEVICE_LS, | ||
| 34 | PHY_MODE_USB_DEVICE_FS, | ||
| 35 | PHY_MODE_USB_DEVICE_HS, | ||
| 36 | PHY_MODE_USB_DEVICE_SS, | ||
| 29 | PHY_MODE_USB_OTG, | 37 | PHY_MODE_USB_OTG, |
| 30 | PHY_MODE_SGMII, | 38 | PHY_MODE_SGMII, |
| 31 | PHY_MODE_10GKR, | 39 | PHY_MODE_10GKR, |
| @@ -61,6 +69,7 @@ struct phy_ops { | |||
| 61 | */ | 69 | */ |
| 62 | struct phy_attrs { | 70 | struct phy_attrs { |
| 63 | u32 bus_width; | 71 | u32 bus_width; |
| 72 | enum phy_mode mode; | ||
| 64 | }; | 73 | }; |
| 65 | 74 | ||
| 66 | /** | 75 | /** |
| @@ -144,6 +153,10 @@ int phy_exit(struct phy *phy); | |||
| 144 | int phy_power_on(struct phy *phy); | 153 | int phy_power_on(struct phy *phy); |
| 145 | int phy_power_off(struct phy *phy); | 154 | int phy_power_off(struct phy *phy); |
| 146 | int phy_set_mode(struct phy *phy, enum phy_mode mode); | 155 | int phy_set_mode(struct phy *phy, enum phy_mode mode); |
| 156 | static inline enum phy_mode phy_get_mode(struct phy *phy) | ||
| 157 | { | ||
| 158 | return phy->attrs.mode; | ||
| 159 | } | ||
| 147 | int phy_reset(struct phy *phy); | 160 | int phy_reset(struct phy *phy); |
| 148 | int phy_calibrate(struct phy *phy); | 161 | int phy_calibrate(struct phy *phy); |
| 149 | static inline int phy_get_bus_width(struct phy *phy) | 162 | static inline int phy_get_bus_width(struct phy *phy) |
| @@ -260,6 +273,11 @@ static inline int phy_set_mode(struct phy *phy, enum phy_mode mode) | |||
| 260 | return -ENOSYS; | 273 | return -ENOSYS; |
| 261 | } | 274 | } |
| 262 | 275 | ||
| 276 | static inline enum phy_mode phy_get_mode(struct phy *phy) | ||
| 277 | { | ||
| 278 | return PHY_MODE_INVALID; | ||
| 279 | } | ||
| 280 | |||
| 263 | static inline int phy_reset(struct phy *phy) | 281 | static inline int phy_reset(struct phy *phy) |
| 264 | { | 282 | { |
| 265 | if (!phy) | 283 | if (!phy) |
