aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2014-10-30 23:11:14 -0400
committerFelipe Balbi <balbi@ti.com>2014-11-03 11:03:39 -0500
commit0effe0a3e741c0e2318f541ce207c9bd6cfe985c (patch)
tree12e9459e375e2b9ea3891dc267e9771371571a73
parent59acfa208164205f94a11f454d08cd88f06b9908 (diff)
usb: dwc3: add disable usb2 suspend phy quirk
This patch adds disable usb2 suspend phy quirk, and some special platforms can configure that if it is needed. Signed-off-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--Documentation/devicetree/bindings/usb/dwc3.txt1
-rw-r--r--drivers/usb/dwc3/core.c6
-rw-r--r--drivers/usb/dwc3/core.h2
-rw-r--r--drivers/usb/dwc3/platform_data.h1
4 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
index 08b394ebeb3e..f200ecc1f0dc 100644
--- a/Documentation/devicetree/bindings/usb/dwc3.txt
+++ b/Documentation/devicetree/bindings/usb/dwc3.txt
@@ -33,6 +33,7 @@ Optional properties:
33 - snps,tx_de_emphasis: the value driven to the PHY is controlled by the 33 - snps,tx_de_emphasis: the value driven to the PHY is controlled by the
34 LTSSM during USB3 Compliance mode. 34 LTSSM during USB3 Compliance mode.
35 - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy. 35 - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy.
36 - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy.
36 37
37This is usually a subnode to DWC3 glue to which it is connected. 38This is usually a subnode to DWC3 glue to which it is connected.
38 39
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 87ffb86bc2f2..3ea55f214439 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -422,6 +422,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc)
422 if (dwc->revision > DWC3_REVISION_194A) 422 if (dwc->revision > DWC3_REVISION_194A)
423 reg |= DWC3_GUSB2PHYCFG_SUSPHY; 423 reg |= DWC3_GUSB2PHYCFG_SUSPHY;
424 424
425 if (dwc->dis_u2_susphy_quirk && dwc->is_fpga)
426 reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
427
425 dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); 428 dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
426 429
427 mdelay(100); 430 mdelay(100);
@@ -817,6 +820,8 @@ static int dwc3_probe(struct platform_device *pdev)
817 "snps,rx_detect_poll_quirk"); 820 "snps,rx_detect_poll_quirk");
818 dwc->dis_u3_susphy_quirk = of_property_read_bool(node, 821 dwc->dis_u3_susphy_quirk = of_property_read_bool(node,
819 "snps,dis_u3_susphy_quirk"); 822 "snps,dis_u3_susphy_quirk");
823 dwc->dis_u2_susphy_quirk = of_property_read_bool(node,
824 "snps,dis_u2_susphy_quirk");
820 825
821 dwc->tx_de_emphasis_quirk = of_property_read_bool(node, 826 dwc->tx_de_emphasis_quirk = of_property_read_bool(node,
822 "snps,tx_de_emphasis_quirk"); 827 "snps,tx_de_emphasis_quirk");
@@ -840,6 +845,7 @@ static int dwc3_probe(struct platform_device *pdev)
840 dwc->lfps_filter_quirk = pdata->lfps_filter_quirk; 845 dwc->lfps_filter_quirk = pdata->lfps_filter_quirk;
841 dwc->rx_detect_poll_quirk = pdata->rx_detect_poll_quirk; 846 dwc->rx_detect_poll_quirk = pdata->rx_detect_poll_quirk;
842 dwc->dis_u3_susphy_quirk = pdata->dis_u3_susphy_quirk; 847 dwc->dis_u3_susphy_quirk = pdata->dis_u3_susphy_quirk;
848 dwc->dis_u2_susphy_quirk = pdata->dis_u2_susphy_quirk;
843 849
844 dwc->tx_de_emphasis_quirk = pdata->tx_de_emphasis_quirk; 850 dwc->tx_de_emphasis_quirk = pdata->tx_de_emphasis_quirk;
845 if (pdata->tx_de_emphasis) 851 if (pdata->tx_de_emphasis)
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index fa778b0a5ab7..cf86d3022b52 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -698,6 +698,7 @@ struct dwc3_scratchpad_array {
698 * @lfps_filter_quirk: set if we enable LFPS filter quirk 698 * @lfps_filter_quirk: set if we enable LFPS filter quirk
699 * @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps quirk 699 * @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps quirk
700 * @dis_u3_susphy_quirk: set if we disable usb3 suspend phy 700 * @dis_u3_susphy_quirk: set if we disable usb3 suspend phy
701 * @dis_u2_susphy_quirk: set if we disable usb2 suspend phy
701 * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk 702 * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk
702 * @tx_de_emphasis: Tx de-emphasis value 703 * @tx_de_emphasis: Tx de-emphasis value
703 * 0 - -6dB de-emphasis 704 * 0 - -6dB de-emphasis
@@ -820,6 +821,7 @@ struct dwc3 {
820 unsigned lfps_filter_quirk:1; 821 unsigned lfps_filter_quirk:1;
821 unsigned rx_detect_poll_quirk:1; 822 unsigned rx_detect_poll_quirk:1;
822 unsigned dis_u3_susphy_quirk:1; 823 unsigned dis_u3_susphy_quirk:1;
824 unsigned dis_u2_susphy_quirk:1;
823 825
824 unsigned tx_de_emphasis_quirk:1; 826 unsigned tx_de_emphasis_quirk:1;
825 unsigned tx_de_emphasis:2; 827 unsigned tx_de_emphasis:2;
diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
index 0f1d5adc657d..245300be057a 100644
--- a/drivers/usb/dwc3/platform_data.h
+++ b/drivers/usb/dwc3/platform_data.h
@@ -37,6 +37,7 @@ struct dwc3_platform_data {
37 unsigned lfps_filter_quirk:1; 37 unsigned lfps_filter_quirk:1;
38 unsigned rx_detect_poll_quirk:1; 38 unsigned rx_detect_poll_quirk:1;
39 unsigned dis_u3_susphy_quirk:1; 39 unsigned dis_u3_susphy_quirk:1;
40 unsigned dis_u2_susphy_quirk:1;
40 41
41 unsigned tx_de_emphasis_quirk:1; 42 unsigned tx_de_emphasis_quirk:1;
42 unsigned tx_de_emphasis:2; 43 unsigned tx_de_emphasis:2;