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

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>

authored by

Robert Baldyga and committed by
Felipe Balbi
eac68e8f ad78c918

+8 -10
+1
Documentation/devicetree/bindings/usb/dwc3.txt
··· 14 14 - phys: from the *Generic PHY* bindings 15 15 - phy-names: from the *Generic PHY* bindings 16 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 18 - snps,disable_scramble_quirk: true when SW should disable data scrambling. 18 19 Only really useful for FPGA builds. 19 20 - snps,has-lpm-erratum: true when DWC3 was configured with LPM Erratum enabled
-7
drivers/usb/dwc3/Kconfig
··· 104 104 help 105 105 Say Y here to enable debugging messages on DWC3 Driver. 106 106 107 - config 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 - 114 107 endif
+3
drivers/usb/dwc3/core.c
··· 804 804 "snps,is-utmi-l1-suspend"); 805 805 of_property_read_u8(node, "snps,hird-threshold", 806 806 &hird_threshold); 807 + dwc->usb3_lpm_capable = of_property_read_bool(node, 808 + "snps,usb3_lpm_capable"); 807 809 808 810 dwc->needs_fifo_resize = of_property_read_bool(node, 809 811 "tx-fifo-resize"); ··· 846 844 hird_threshold = pdata->hird_threshold; 847 845 848 846 dwc->needs_fifo_resize = pdata->tx_fifo_resize; 847 + dwc->usb3_lpm_capable = pdata->usb3_lpm_capable; 849 848 dwc->dr_mode = pdata->dr_mode; 850 849 851 850 dwc->disable_scramble_quirk = pdata->disable_scramble_quirk;
+2
drivers/usb/dwc3/core.h
··· 689 689 * @setup_packet_pending: true when there's a Setup Packet in FIFO. Workaround 690 690 * @start_config_issued: true when StartConfig command has been issued 691 691 * @three_stage_setup: set if we perform a three phase setup 692 + * @usb3_lpm_capable: set if hadrware supports Link Power Management 692 693 * @disable_scramble_quirk: set if we enable the disable scramble quirk 693 694 * @u2exit_lfps_quirk: set if we enable u2exit lfps quirk 694 695 * @u2ss_inp3_quirk: set if we enable P3 OK for U2/SS Inactive quirk ··· 813 812 unsigned setup_packet_pending:1; 814 813 unsigned start_config_issued:1; 815 814 unsigned three_stage_setup:1; 815 + unsigned usb3_lpm_capable:1; 816 816 817 817 unsigned disable_scramble_quirk:1; 818 818 unsigned u2exit_lfps_quirk:1;
+1 -3
drivers/usb/dwc3/host.c
··· 49 49 50 50 memset(&pdata, 0, sizeof(pdata)); 51 51 52 - #ifdef CONFIG_DWC3_HOST_USB3_LPM_ENABLE 53 - pdata.usb3_lpm_capable = 1; 54 - #endif 52 + pdata.usb3_lpm_capable = dwc->usb3_lpm_capable; 55 53 56 54 ret = platform_device_add_data(xhci, &pdata, sizeof(pdata)); 57 55 if (ret) {
+1
drivers/usb/dwc3/platform_data.h
··· 24 24 enum usb_device_speed maximum_speed; 25 25 enum usb_dr_mode dr_mode; 26 26 bool tx_fifo_resize; 27 + bool usb3_lpm_capable; 27 28 28 29 unsigned is_utmi_l1_suspend:1; 29 30 u8 hird_threshold;