Thread (20 messages) 20 messages, 5 authors, 2016-06-20

[PATCH v3 1/2] usb: ohci-at91: Forcibly suspend ports while USB suspend

From: Yang, Wenyou <hidden>
Date: 2016-06-20 03:17:16
Also in: linux-devicetree, lkml

Hi Aleandre,
-----Original Message-----
From: Alexandre Belloni [mailto:alexandre.belloni at free-electrons.com]
Sent: 2016?6?17? 21:55
To: Yang, Wenyou <redacted>
Cc: Rob Herring <robh@kernel.org>; Alan Stern <stern@rowland.harvard.edu>;
Greg Kroah-Hartman [off-list ref]; Ferre, Nicolas
[off-list ref]; Pawel Moll [off-list ref]; Mark Brown
[off-list ref]; Ian Campbell [off-list ref]; Kumar
Gala [off-list ref]; linux-kernel at vger.kernel.org;
devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-
usb at vger.kernel.org
Subject: Re: [PATCH v3 1/2] usb: ohci-at91: Forcibly suspend ports while USB
suspend

On 17/06/2016 at 13:44:22 +0000, Yang, Wenyou wrote :
quoted
Hi Alexandre,
quoted
-----Original Message-----
From: Alexandre Belloni
[mailto:alexandre.belloni at free-electrons.com]
Sent: 2016?6?9? 4:38
To: Rob Herring <robh@kernel.org>
Cc: Yang, Wenyou <redacted>; Alan Stern
[off-list ref]; Greg Kroah-Hartman
[off-list ref]; Ferre, Nicolas
[off-list ref]; Pawel Moll [off-list ref]; Mark
Brown [off-list ref]; Ian Campbell
[off-list ref]; Kumar Gala [off-list ref];
linux-kernel at vger.kernel.org; devicetree at vger.kernel.org; linux-arm-
kernel at lists.infradead.org; linux-usb at vger.kernel.org
Subject: Re: [PATCH v3 1/2] usb: ohci-at91: Forcibly suspend ports
while USB suspend

On 08/06/2016 at 15:26:51 -0500, Rob Herring wrote :
quoted
On Wed, Jun 08, 2016 at 12:15:10PM +0800, Wenyou Yang wrote:
quoted
In order to the save power consumption, as a workaround, suspend
forcibly the USB PORTA/B/C via set the SUSPEND_A/B/C bits of
OHCI Interrupt Configuration Register in the SFRs while OHCI USB
suspend.
quoted
quoted
quoted
quoted
This suspend operation must be done before the USB clock is
disabled, resume after the USB clock is enabled.

Signed-off-by: Wenyou Yang <redacted>
---

Changes in v3:
 - Change the compatible description for more precise.

Changes in v2:
 - Add compatible to support forcibly suspend the ports.
 - Add soc/at91/at91_sfr.h to accommodate the defines.
 - Add error checking for .sfr_regmap.
 - Remove unnecessary regmap_read() statement.

 .../devicetree/bindings/usb/atmel-usb.txt          |  6 +-
 drivers/usb/host/ohci-at91.c                       | 80
+++++++++++++++++++++-
quoted
quoted
quoted
quoted
 include/soc/at91/at91_sfr.h                        | 29 ++++++++
 3 files changed, 112 insertions(+), 3 deletions(-)  create mode
100644 include/soc/at91/at91_sfr.h
diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.txt
b/Documentation/devicetree/bindings/usb/atmel-usb.txt
index 5883b73..888deaa 100644
--- a/Documentation/devicetree/bindings/usb/atmel-usb.txt
+++ b/Documentation/devicetree/bindings/usb/atmel-usb.txt
@@ -3,8 +3,10 @@ Atmel SOC USB controllers  OHCI

 Required properties:
- - compatible: Should be "atmel,at91rm9200-ohci" for USB controllers
-   used in host mode.
+ - compatible: Should be one of the following
+	       "atmel,at91rm9200-ohci" for USB controllers used in host
mode.
quoted
quoted
quoted
quoted
+	       "atmel,sama5d2-ohci" for USB controllers used in host mode
+	       on SAMA5D2 which can force to suspend.
Guess I wasn't clear enough before. Drop "which can force to suspend".
Well, my point is that we don't need a new compatible anyway.
Could you give some advice?.
Sure, what I mean is that you can try to get the regmap for the SFR in every case.
Depending on whether you were able to get it, you can decide to call
ohci_at91_port_suspend/resume or not (just test for sfr_regmap != NULL).
I don't think so. The SFR includes a lot of miscellaneous functions, more than this one.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering http://free-electrons.com

Best Regards,
Wenyou Yang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help