* [PATCH] dwc3: make LPM configurable in DT
@ 2015-03-06 10:08 Robert Baldyga
2015-03-07 5:40 ` Felipe Balbi
0 siblings, 1 reply; 2+ messages in thread
From: Robert Baldyga @ 2015-03-06 10:08 UTC (permalink / raw)
To: balbi; +Cc: gregkh, linux-usb, linux-kernel, m.szyprowski, Robert Baldyga
LPM capability is hardware property, so now it's moved to DT.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
Documentation/devicetree/bindings/usb/dwc3.txt | 1 +
drivers/usb/dwc3/Kconfig | 7 -------
drivers/usb/dwc3/core.c | 3 +++
drivers/usb/dwc3/core.h | 1 +
drivers/usb/dwc3/host.c | 5 ++---
drivers/usb/dwc3/platform_data.h | 1 +
6 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
index cd7f045..36b9148 100644
--- a/Documentation/devicetree/bindings/usb/dwc3.txt
+++ b/Documentation/devicetree/bindings/usb/dwc3.txt
@@ -14,6 +14,7 @@ Optional properties:
- phys: from the *Generic PHY* bindings
- phy-names: from the *Generic PHY* bindings
- tx-fifo-resize: determines if the FIFO *has* to be reallocated.
+ - usb3_lpm_capable: determines if platform is USB3 LPM capable
- snps,disable_scramble_quirk: true when SW should disable data scrambling.
Only really useful for FPGA builds.
- 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 edbf9c8..827c4f8 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -104,11 +104,4 @@ config USB_DWC3_DEBUG
help
Say Y here to enable debugging messages on DWC3 Driver.
-config DWC3_HOST_USB3_LPM_ENABLE
- bool "Enable USB3 LPM Capability"
- depends on USB_DWC3_HOST=y || USB_DWC3_DUAL_ROLE=y
- default n
- help
- Select this when you want to enable USB3 LPM with dwc3 xhci host.
-
endif
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 9f0e209..a8d4d6d 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -811,6 +811,8 @@ static int dwc3_probe(struct platform_device *pdev)
dwc->needs_fifo_resize = of_property_read_bool(node,
"tx-fifo-resize");
+ dwc->usb3_lpm_capable = of_property_read_bool(node,
+ "usb3_lpm_capable");
dwc->dr_mode = of_usb_get_dr_mode(node);
dwc->disable_scramble_quirk = of_property_read_bool(node,
@@ -848,6 +850,7 @@ static int dwc3_probe(struct platform_device *pdev)
hird_threshold = pdata->hird_threshold;
dwc->needs_fifo_resize = pdata->tx_fifo_resize;
+ dwc->usb3_lpm_capable = pdata->usb3_lpm_capable;
dwc->dr_mode = pdata->dr_mode;
dwc->disable_scramble_quirk = pdata->disable_scramble_quirk;
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index d201910..622f65f 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -812,6 +812,7 @@ struct dwc3 {
unsigned setup_packet_pending:1;
unsigned start_config_issued:1;
unsigned three_stage_setup:1;
+ unsigned usb3_lpm_capable:1;
unsigned disable_scramble_quirk:1;
unsigned u2exit_lfps_quirk:1;
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index 12bfd3c..507eddf 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -49,9 +49,8 @@ int dwc3_host_init(struct dwc3 *dwc)
memset(&pdata, 0, sizeof(pdata));
-#ifdef CONFIG_DWC3_HOST_USB3_LPM_ENABLE
- pdata.usb3_lpm_capable = 1;
-#endif
+ if (dwc->usb3_lpm_capable)
+ pdata.usb3_lpm_capable = 1;
ret = platform_device_add_data(xhci, &pdata, sizeof(pdata));
if (ret) {
diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
index a3a3b6d5..a2bd464 100644
--- a/drivers/usb/dwc3/platform_data.h
+++ b/drivers/usb/dwc3/platform_data.h
@@ -24,6 +24,7 @@ struct dwc3_platform_data {
enum usb_device_speed maximum_speed;
enum usb_dr_mode dr_mode;
bool tx_fifo_resize;
+ bool usb3_lpm_capable;
unsigned is_utmi_l1_suspend:1;
u8 hird_threshold;
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] dwc3: make LPM configurable in DT
2015-03-06 10:08 [PATCH] dwc3: make LPM configurable in DT Robert Baldyga
@ 2015-03-07 5:40 ` Felipe Balbi
0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2015-03-07 5:40 UTC (permalink / raw)
To: Robert Baldyga; +Cc: balbi, gregkh, linux-usb, linux-kernel, m.szyprowski
[-- Attachment #1: Type: text/plain, Size: 2957 bytes --]
Hi,
On Fri, Mar 06, 2015 at 11:08:53AM +0100, Robert Baldyga wrote:
> LPM capability is hardware property, so now it's moved to DT.
you need a better commit log here.
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
> Documentation/devicetree/bindings/usb/dwc3.txt | 1 +
> drivers/usb/dwc3/Kconfig | 7 -------
> drivers/usb/dwc3/core.c | 3 +++
> drivers/usb/dwc3/core.h | 1 +
> drivers/usb/dwc3/host.c | 5 ++---
> drivers/usb/dwc3/platform_data.h | 1 +
> 6 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt
> index cd7f045..36b9148 100644
> --- a/Documentation/devicetree/bindings/usb/dwc3.txt
> +++ b/Documentation/devicetree/bindings/usb/dwc3.txt
> @@ -14,6 +14,7 @@ Optional properties:
> - phys: from the *Generic PHY* bindings
> - phy-names: from the *Generic PHY* bindings
> - tx-fifo-resize: determines if the FIFO *has* to be reallocated.
> + - usb3_lpm_capable: determines if platform is USB3 LPM capable
needs a snps, prefix
> @@ -848,6 +850,7 @@ static int dwc3_probe(struct platform_device *pdev)
> hird_threshold = pdata->hird_threshold;
>
> dwc->needs_fifo_resize = pdata->tx_fifo_resize;
> + dwc->usb3_lpm_capable = pdata->usb3_lpm_capable;
> dwc->dr_mode = pdata->dr_mode;
>
> dwc->disable_scramble_quirk = pdata->disable_scramble_quirk;
> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
> index d201910..622f65f 100644
> --- a/drivers/usb/dwc3/core.h
> +++ b/drivers/usb/dwc3/core.h
> @@ -812,6 +812,7 @@ struct dwc3 {
> unsigned setup_packet_pending:1;
> unsigned start_config_issued:1;
> unsigned three_stage_setup:1;
> + unsigned usb3_lpm_capable:1;
missing kdoc for this new field.
>
> unsigned disable_scramble_quirk:1;
> unsigned u2exit_lfps_quirk:1;
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index 12bfd3c..507eddf 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -49,9 +49,8 @@ int dwc3_host_init(struct dwc3 *dwc)
>
> memset(&pdata, 0, sizeof(pdata));
>
> -#ifdef CONFIG_DWC3_HOST_USB3_LPM_ENABLE
> - pdata.usb3_lpm_capable = 1;
> -#endif
> + if (dwc->usb3_lpm_capable)
> + pdata.usb3_lpm_capable = 1;
pdata.usb3_lpm_capable = dwc->usb3_lpm_capable; ??
drop the branch altogether
> diff --git a/drivers/usb/dwc3/platform_data.h b/drivers/usb/dwc3/platform_data.h
> index a3a3b6d5..a2bd464 100644
> --- a/drivers/usb/dwc3/platform_data.h
> +++ b/drivers/usb/dwc3/platform_data.h
> @@ -24,6 +24,7 @@ struct dwc3_platform_data {
> enum usb_device_speed maximum_speed;
> enum usb_dr_mode dr_mode;
> bool tx_fifo_resize;
> + bool usb3_lpm_capable;
add kdoc for this too.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-07 5:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-06 10:08 [PATCH] dwc3: make LPM configurable in DT Robert Baldyga
2015-03-07 5:40 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome