Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

George Cherian and committed by
Felipe Balbi
c4b34a3b db67bc04

+27
+2
Documentation/devicetree/bindings/usb/omap-usb.txt
··· 87 87 e.g. USB3 PHY and SATA PHY on OMAP5. 88 88 "ti,control-phy-dra7usb2" - if it has power down register like USB2 PHY on 89 89 DRA7 platform. 90 + "ti,control-phy-am437usb2" - if it has power down register like USB2 PHY on 91 + AM437 platform. 90 92 - reg : Address and length of the register set for the device. It contains 91 93 the address of "otghs_control" for control-phy-otghs or "power" register 92 94 for other types.
+19
drivers/usb/phy/phy-omap-control.c
··· 84 84 else 85 85 val |= OMAP_CTRL_USB2_PHY_PD; 86 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 101 default: 88 102 dev_err(dev, "%s: type %d not recognized\n", 89 103 __func__, control_usb->type); ··· 211 197 static const enum omap_control_usb_type usb2_data = OMAP_CTRL_TYPE_USB2; 212 198 static const enum omap_control_usb_type pipe3_data = OMAP_CTRL_TYPE_PIPE3; 213 199 static const enum omap_control_usb_type dra7usb2_data = OMAP_CTRL_TYPE_DRA7USB2; 200 + static const enum omap_control_usb_type am437usb2_data = OMAP_CTRL_TYPE_AM437USB2; 214 201 215 202 static const struct of_device_id omap_control_usb_id_table[] = { 216 203 { ··· 229 214 { 230 215 .compatible = "ti,control-phy-dra7usb2", 231 216 .data = &dra7usb2_data, 217 + }, 218 + { 219 + .compatible = "ti,control-phy-am437usb2", 220 + .data = &am437usb2_data, 232 221 }, 233 222 {}, 234 223 };
+6
include/linux/usb/omap_control_usb.h
··· 24 24 OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ 25 25 OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ 26 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 30 struct omap_control_usb { ··· 64 63 #define OMAP_CTRL_USB3_PHY_TX_RX_POWEROFF 0x0 65 64 66 65 #define OMAP_CTRL_USB2_PHY_PD BIT(28) 66 + 67 + #define AM437X_CTRL_USB2_PHY_PD BIT(0) 68 + #define AM437X_CTRL_USB2_OTG_PD BIT(1) 69 + #define AM437X_CTRL_USB2_OTGVDET_EN BIT(19) 70 + #define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20) 67 71 68 72 #if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) 69 73 extern void omap_control_usb_phy_power(struct device *dev, int on);