usb: phy-msm-ssusb-qmp: Make vls_clamp_reg as optional
Currently the SSUSB QMP PHY driver mandates that vls_clamp_reg be passed from the DTSI. But this register cannot be accessed on a platform on which Linux is a guest OS. This can lead to errors when trying to enable autonomous mode. Work around this situation by making the vls_clamp_reg property as optional. Change-Id: Idb103d9b7bda717a5f12689951a7452c46aa76dd Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
This commit is contained in:
parent
b77f7d2943
commit
53324ddb60
2 changed files with 16 additions and 13 deletions
|
@ -95,8 +95,6 @@ Required properties:
|
||||||
- reg: Address and length of the register set for the device
|
- reg: Address and length of the register set for the device
|
||||||
Required regs are:
|
Required regs are:
|
||||||
"qmp_phy_base" : QMP PHY Base register set.
|
"qmp_phy_base" : QMP PHY Base register set.
|
||||||
- "vls_clamp_reg" : top-level CSR register to be written to enable phy vls
|
|
||||||
clamp which allows phy to detect autonomous mode.
|
|
||||||
- <supply-name>-supply: phandle to the regulator device tree node
|
- <supply-name>-supply: phandle to the regulator device tree node
|
||||||
Required "supply-name" examples are:
|
Required "supply-name" examples are:
|
||||||
"vdd" : vdd supply for SSPHY digital circuit operation
|
"vdd" : vdd supply for SSPHY digital circuit operation
|
||||||
|
@ -125,6 +123,8 @@ Required properties:
|
||||||
|
|
||||||
Optional properties:
|
Optional properties:
|
||||||
- reg: Additional register set of address and length to control QMP PHY are:
|
- reg: Additional register set of address and length to control QMP PHY are:
|
||||||
|
"vls_clamp_reg" : top-level CSR register to be written to enable phy vls
|
||||||
|
clamp which allows phy to detect autonomous mode.
|
||||||
"tcsr_usb3_dp_phymode" : top-level CSR register to be written to select
|
"tcsr_usb3_dp_phymode" : top-level CSR register to be written to select
|
||||||
super speed usb qmp phy.
|
super speed usb qmp phy.
|
||||||
- clocks: a list of phandles to the PHY clocks. Use as per
|
- clocks: a list of phandles to the PHY clocks. Use as per
|
||||||
|
|
|
@ -473,11 +473,13 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (suspend) {
|
if (suspend) {
|
||||||
if (phy->cable_connected)
|
if (phy->cable_connected) {
|
||||||
msm_ssusb_qmp_enable_autonomous(phy, 1);
|
if (phy->vls_clamp_reg)
|
||||||
else
|
msm_ssusb_qmp_enable_autonomous(phy, 1);
|
||||||
|
} else {
|
||||||
writel_relaxed(0x00,
|
writel_relaxed(0x00,
|
||||||
phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
|
phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
|
||||||
|
}
|
||||||
|
|
||||||
/* Make sure above write completed with PHY */
|
/* Make sure above write completed with PHY */
|
||||||
wmb();
|
wmb();
|
||||||
|
@ -509,7 +511,8 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)
|
||||||
writel_relaxed(0x01,
|
writel_relaxed(0x01,
|
||||||
phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
|
phy->base + phy->phy_reg[USB3_PHY_POWER_DOWN_CONTROL]);
|
||||||
} else {
|
} else {
|
||||||
msm_ssusb_qmp_enable_autonomous(phy, 0);
|
if (phy->vls_clamp_reg)
|
||||||
|
msm_ssusb_qmp_enable_autonomous(phy, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure that above write completed with PHY */
|
/* Make sure that above write completed with PHY */
|
||||||
|
@ -648,13 +651,13 @@ static int msm_ssphy_qmp_probe(struct platform_device *pdev)
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||||
"vls_clamp_reg");
|
"vls_clamp_reg");
|
||||||
if (!res) {
|
if (!res) {
|
||||||
dev_err(dev, "failed getting vls_clamp_reg\n");
|
dev_dbg(dev, "vls_clamp_reg not passed\n");
|
||||||
return -ENODEV;
|
} else {
|
||||||
}
|
phy->vls_clamp_reg = devm_ioremap_resource(dev, res);
|
||||||
phy->vls_clamp_reg = devm_ioremap_resource(dev, res);
|
if (IS_ERR(phy->vls_clamp_reg)) {
|
||||||
if (IS_ERR(phy->vls_clamp_reg)) {
|
dev_err(dev, "couldn't find vls_clamp_reg address.\n");
|
||||||
dev_err(dev, "couldn't find vls_clamp_reg address.\n");
|
return PTR_ERR(phy->vls_clamp_reg);
|
||||||
return PTR_ERR(phy->vls_clamp_reg);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||||
|
|
Loading…
Add table
Reference in a new issue