aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2015-03-09 10:06:12 -0400
committerFelipe Balbi <balbi@ti.com>2015-03-10 16:33:33 -0400
commiteac68e8f979b82d257eea0a4bbcda7b169d330bf (patch)
treead3f38d39d31c8c82a9121f375d36c1029363548
parentad78c918602cb7cce0fab5d5813213853a6f351d (diff)
usb: dwc3: make LPM configurable in DT
This patch removes "Enable USB3 LPM Capability" option from Kconfig and adds snps,usb3_lpm_capable devicetree property instead of it. USB3 LPM (Link Power Management) capability is hardware property, and it's platform dependent, so if our hardware supports this feature, we want rather to configure it in devicetree than having it as Kconfig option. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--Documentation/devicetree/bindings/usb/dwc3.txt1
-rw-r--r--drivers/usb/dwc3/Kconfig7
-rw-r--r--drivers/usb/dwc3/core.c3
-rw-r--r--drivers/usb/dwc3/core.h2
-rw-r--r--drivers/usb/dwc3/host.c4
-rw-r--r--drivers/usb/dwc3/platform_data.h1
6 files changed, 8 insertions, 10 deletions
diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
index cd7f0454e13a..5cc364309edb 100644
--- a/Documentation/devicetree/bindings/usb/dwc3.txt
+++ b/Documentation/devicetree/bindings/usb/dwc3.txt
@@ -14,6 +14,7 @@ Optional properties:
14 - phys: from the *Generic PHY* bindings 14 - phys: from the *Generic PHY* bindings
15 - phy-names: from the *Generic PHY* bindings 15 - phy-names: from the *Generic PHY* bindings
16 - tx-fifo-resize: determines if the FIFO *has* to be reallocated. 16 - tx-fifo-resize: determines if the FIFO *has* to be reallocated.
17 - snps,usb3_lpm_capable: determines if platform is USB3 LPM capable
17 - snps,disable_scramble_quirk: true when SW should disable data scrambling. 18 - snps,disable_scramble_quirk: true when SW should disable data scrambling.
18 Only really useful for FPGA builds. 19 Only really useful for FPGA builds.
19 - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled 20 - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index edbf9c85af7e..827c4f80379f 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -104,11 +104,4 @@ config USB_DWC3_DEBUG
104 help 104 help
105 Say Y here to enable debugging messages on DWC3 Driver. 105 Say Y here to enable debugging messages on DWC3 Driver.
106 106
107config DWC3_HOST_USB3_LPM_ENABLE
108 bool "Enable USB3 LPM Capability"
109 depends on USB_DWC3_HOST=y || USB_DWC3_DUAL_ROLE=y
110 default n
111 help
112 Select this when you want to enable USB3 LPM with dwc3 xhci host.
113
114endif 107endif
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index cd59e919e27e..2bbab3d86fff 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -804,6 +804,8 @@ static int dwc3_probe(struct platform_device *pdev)
804 "snps,is-utmi-l1-suspend"); 804 "snps,is-utmi-l1-suspend");
805 of_property_read_u8(node, "snps,hird-threshold", 805 of_property_read_u8(node, "snps,hird-threshold",
806 &hird_threshold); 806 &hird_threshold);
807 dwc->usb3_lpm_capable = of_property_read_bool(node,
808 "snps,usb3_lpm_capable");
807 809
808 dwc->needs_fifo_resize = of_property_read_bool(node, 810 dwc->needs_fifo_resize = of_property_read_bool(node,
809 "tx-fifo-resize"); 811 "tx-fifo-resize");
@@ -844,6 +846,7 @@ static int dwc3_probe(struct platform_device *pdev)
844 hird_threshold = pdata->hird_threshold; 846 hird_threshold = pdata->hird_threshold;
845 847
846 dwc->needs_fifo_resize = pdata->tx_fifo_resize; 848 dwc->needs_fifo_resize = pdata->tx_fifo_resize;
849 dwc->usb3_lpm_capable = pdata->usb3_lpm_capable;
847 dwc->dr_mode = pdata->dr_mode; 850 dwc->dr_mode = pdata->dr_mode;
848 851
849 dwc->disable_scramble_quirk = pdata->disable_scramble_quirk; 852 dwc->disable_scramble_quirk = pdata->disable_scramble_quirk;
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index d201910b892f..fdab715a0631 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -689,6 +689,7 @@ struct dwc3_scratchpad_array {
689 * @setup_packet_pending: true when there's a Setup Packet in FIFO. Workaround 689 * @setup_packet_pending: true when there's a Setup Packet in FIFO. Workaround
690 * @start_config_issued: true when StartConfig command has been issued 690 * @start_config_issued: true when StartConfig command has been issued
691 * @three_stage_setup: set if we perform a three phase setup 691 * @three_stage_setup: set if we perform a three phase setup
692 * @usb3_lpm_capable: set if hadrware supports Link Power Management
692 * @disable_scramble_quirk: set if we enable the disable scramble quirk 693 * @disable_scramble_quirk: set if we enable the disable scramble quirk
693 * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk 694 * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk
694 * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk 695 * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk
@@ -812,6 +813,7 @@ struct dwc3 {
812 unsigned setup_packet_pending:1; 813 unsigned setup_packet_pending:1;
813 unsigned start_config_issued:1; 814 unsigned start_config_issued:1;
814 unsigned three_stage_setup:1; 815 unsigned three_stage_setup:1;
816 unsigned usb3_lpm_capable:1;
815 817
816 unsigned disable_scramble_quirk:1; 818 unsigned disable_scramble_quirk:1;
817 unsigned u2exit_lfps_quirk:1; 819 unsigned u2exit_lfps_quirk:1;
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index 12bfd3c5405e..c679f63783ae 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -49,9 +49,7 @@ int dwc3_host_init(struct dwc3 *dwc)
49 49
50 memset(&pdata, 0, sizeof(pdata)); 50 memset(&pdata, 0, sizeof(pdata));
51 51
52#ifdef CONFIG_DWC3_HOST_USB3_LPM_ENABLE 52 pdata.usb3_lpm_capable = dwc->usb3_lpm_capable;
53 pdata.usb3_lpm_capable = 1;
54#endif
55 53
56 ret = platform_device_add_data(xhci, &pdata, sizeof(pdata)); 54 ret = platform_device_add_data(xhci, &pdata, sizeof(pdata));
57 if (ret) { 55 if (ret) {
diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
index a3a3b6d5668c..a2bd464be828 100644
--- a/drivers/usb/dwc3/platform_data.h
+++ b/drivers/usb/dwc3/platform_data.h
@@ -24,6 +24,7 @@ struct dwc3_platform_data {
24 enum usb_device_speed maximum_speed; 24 enum usb_device_speed maximum_speed;
25 enum usb_dr_mode dr_mode; 25 enum usb_dr_mode dr_mode;
26 bool tx_fifo_resize; 26 bool tx_fifo_resize;
27 bool usb3_lpm_capable;
27 28
28 unsigned is_utmi_l1_suspend:1; 29 unsigned is_utmi_l1_suspend:1;
29 u8 hird_threshold; 30 u8 hird_threshold;