diff options
author | George Cherian <george.cherian@ti.com> | 2013-10-15 06:02:14 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-12-19 10:27:42 -0500 |
commit | c4b34a3b7a505dd63268cf6dcf57d10068b47cb6 (patch) | |
tree | 8f37f59c1d410caaaec46f424f8e981d1a1a8e28 | |
parent | db67bc04bdc8cac2307af09c92cd73751905ec0e (diff) |
usb: phy: omap: Add omap-control Support for AM437x
This adds omap control module support for USBSS in AM437x SoC.
Update DT binding information to reflect these changes.
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | Documentation/devicetree/bindings/usb/omap-usb.txt | 2 | ||||
-rw-r--r-- | drivers/usb/phy/phy-omap-control.c | 19 | ||||
-rw-r--r-- | include/linux/usb/omap_control_usb.h | 6 |
3 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/usb/omap-usb.txt b/Documentation/devicetree/bindings/usb/omap-usb.txt index 090e5e22bd2b..c495135115cb 100644 --- a/Documentation/devicetree/bindings/usb/omap-usb.txt +++ b/Documentation/devicetree/bindings/usb/omap-usb.txt | |||
@@ -87,6 +87,8 @@ Required properties: | |||
87 | e.g. USB3 PHY and SATA PHY on OMAP5. | 87 | e.g. USB3 PHY and SATA PHY on OMAP5. |
88 | "ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on | 88 | "ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on |
89 | DRA7 platform. | 89 | DRA7 platform. |
90 | "ti,control-phy-am437usb2" - if it has power down register like USB2 PHY on | ||
91 | AM437 platform. | ||
90 | - reg : Address and length of the register set for the device. It contains | 92 | - reg : Address and length of the register set for the device. It contains |
91 | the address of "otghs_control" for control-phy-otghs or "power" register | 93 | the address of "otghs_control" for control-phy-otghs or "power" register |
92 | for other types. | 94 | for other types. |
diff --git a/drivers/usb/phy/phy-omap-control.c b/drivers/usb/phy/phy-omap-control.c index 09c5ace1edd8..e7253182e47d 100644 --- a/drivers/usb/phy/phy-omap-control.c +++ b/drivers/usb/phy/phy-omap-control.c | |||
@@ -84,6 +84,20 @@ void omap_control_usb_phy_power(struct device *dev, int on) | |||
84 | else | 84 | else |
85 | val |= OMAP_CTRL_USB2_PHY_PD; | 85 | val |= OMAP_CTRL_USB2_PHY_PD; |
86 | break; | 86 | break; |
87 | |||
88 | case OMAP_CTRL_TYPE_AM437USB2: | ||
89 | if (on) { | ||
90 | val &= ~(AM437X_CTRL_USB2_PHY_PD | | ||
91 | AM437X_CTRL_USB2_OTG_PD); | ||
92 | val |= (AM437X_CTRL_USB2_OTGVDET_EN | | ||
93 | AM437X_CTRL_USB2_OTGSESSEND_EN); | ||
94 | } else { | ||
95 | val &= ~(AM437X_CTRL_USB2_OTGVDET_EN | | ||
96 | AM437X_CTRL_USB2_OTGSESSEND_EN); | ||
97 | val |= (AM437X_CTRL_USB2_PHY_PD | | ||
98 | AM437X_CTRL_USB2_OTG_PD); | ||
99 | } | ||
100 | break; | ||
87 | default: | 101 | default: |
88 | dev_err(dev, "%s: type %d not recognized\n", | 102 | dev_err(dev, "%s: type %d not recognized\n", |
89 | __func__, control_usb->type); | 103 | __func__, control_usb->type); |
@@ -197,6 +211,7 @@ static const enum omap_control_usb_type otghs_data = OMAP_CTRL_TYPE_OTGHS; | |||
197 | static const enum omap_control_usb_type usb2_data = OMAP_CTRL_TYPE_USB2; | 211 | static const enum omap_control_usb_type usb2_data = OMAP_CTRL_TYPE_USB2; |
198 | static const enum omap_control_usb_type pipe3_data = OMAP_CTRL_TYPE_PIPE3; | 212 | static const enum omap_control_usb_type pipe3_data = OMAP_CTRL_TYPE_PIPE3; |
199 | static const enum omap_control_usb_type dra7usb2_data = OMAP_CTRL_TYPE_DRA7USB2; | 213 | static const enum omap_control_usb_type dra7usb2_data = OMAP_CTRL_TYPE_DRA7USB2; |
214 | static const enum omap_control_usb_type am437usb2_data = OMAP_CTRL_TYPE_AM437USB2; | ||
200 | 215 | ||
201 | static const struct of_device_id omap_control_usb_id_table[] = { | 216 | static const struct of_device_id omap_control_usb_id_table[] = { |
202 | { | 217 | { |
@@ -215,6 +230,10 @@ static const struct of_device_id omap_control_usb_id_table[] = { | |||
215 | .compatible = "ti,control-phy-dra7usb2", | 230 | .compatible = "ti,control-phy-dra7usb2", |
216 | .data = &dra7usb2_data, | 231 | .data = &dra7usb2_data, |
217 | }, | 232 | }, |
233 | { | ||
234 | .compatible = "ti,control-phy-am437usb2", | ||
235 | .data = &am437usb2_data, | ||
236 | }, | ||
218 | {}, | 237 | {}, |
219 | }; | 238 | }; |
220 | MODULE_DEVICE_TABLE(of, omap_control_usb_id_table); | 239 | MODULE_DEVICE_TABLE(of, omap_control_usb_id_table); |
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h index 596b01918813..69ae383ee3cc 100644 --- a/include/linux/usb/omap_control_usb.h +++ b/include/linux/usb/omap_control_usb.h | |||
@@ -24,6 +24,7 @@ enum omap_control_usb_type { | |||
24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ | 24 | OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ |
25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ | 25 | OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ |
26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ | 26 | OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ |
27 | OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */ | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | struct omap_control_usb { | 30 | struct omap_control_usb { |
@@ -64,6 +65,11 @@ enum omap_control_usb_mode { | |||
64 | 65 | ||
65 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) | 66 | #define OMAP_CTRL_USB2_PHY_PD BIT(28) |
66 | 67 | ||
68 | #define AM437X_CTRL_USB2_PHY_PD BIT(0) | ||
69 | #define AM437X_CTRL_USB2_OTG_PD BIT(1) | ||
70 | #define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) | ||
71 | #define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) | ||
72 | |||
67 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) | 73 | #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) |
68 | extern void omap_control_usb_phy_power(struct device *dev, int on); | 74 | extern void omap_control_usb_phy_power(struct device *dev, int on); |
69 | extern void omap_control_usb_set_mode(struct device *dev, | 75 | extern void omap_control_usb_set_mode(struct device *dev, |