From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Belloni Subject: Re: [PATCH v3 1/2] usb: ohci-at91: Forcibly suspend ports while USB suspend Date: Fri, 17 Jun 2016 15:54:48 +0200 Message-ID: <20160617135448.GI5809@piout.net> References: <1465359311-14544-1-git-send-email-wenyou.yang@atmel.com> <1465359311-14544-2-git-send-email-wenyou.yang@atmel.com> <20160608202651.GA23604@rob-hp-laptop> <20160608203810.GF2466@piout.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: "Yang, Wenyou" Cc: Rob Herring , Alan Stern , Greg Kroah-Hartman , "Ferre, Nicolas" , Pawel Moll , Mark Brown , Ian Campbell , Kumar Gala , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-usb@vger.kernel.org" List-Id: devicetree@vger.kernel.org On 17/06/2016 at 13:44:22 +0000, Yang, Wenyou wrote : > Hi Alexandre, >=20 > > -----Original Message----- > > From: Alexandre Belloni [mailto:alexandre.belloni@free-electrons.co= m] > > Sent: 2016=E5=B9=B46=E6=9C=889=E6=97=A5 4:38 > > To: Rob Herring > > Cc: Yang, Wenyou ; Alan Stern > > ; Greg Kroah-Hartman > > ; Ferre, Nicolas ; > > Pawel Moll ; Mark Brown ; I= an > > Campbell ; Kumar Gala ; > > linux-kernel@vger.kernel.org; devicetree@vger.kernel.org; linux-arm= - > > kernel@lists.infradead.org; linux-usb@vger.kernel.org > > Subject: Re: [PATCH v3 1/2] usb: ohci-at91: Forcibly suspend ports = while USB > > suspend > >=20 > > On 08/06/2016 at 15:26:51 -0500, Rob Herring wrote : > > > On Wed, Jun 08, 2016 at 12:15:10PM +0800, Wenyou Yang wrote: > > > > In order to the save power consumption, as a workaround, suspen= d > > > > forcibly the USB PORTA/B/C via set the SUSPEND_A/B/C bits of OH= CI > > > > Interrupt Configuration Register in the SFRs while OHCI USB sus= pend. > > > > > > > > This suspend operation must be done before the USB clock is > > > > disabled, resume after the USB clock is enabled. > > > > > > > > Signed-off-by: Wenyou Yang > > > > --- > > > > > > > > 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 ++++++= +++++++++++++++- > > > > include/soc/at91/at91_sfr.h | 29 ++++++= ++ > > > > 3 files changed, 112 insertions(+), 3 deletions(-) create mod= e > > > > 100644 include/soc/at91/at91_sfr.h > > > > > > > > diff --git a/Documentation/devicetree/bindings/usb/atmel-usb.tx= t > > > > 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 contr= ollers > > > > - used in host mode. > > > > + - compatible: Should be one of the following > > > > + "atmel,at91rm9200-ohci" for USB controllers used in ho= st mode. > > > > + "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 susp= end". > > > > >=20 > > Well, my point is that we don't need a new compatible anyway. >=20 > Could you give some advice?. >=20 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 decid= e to call ohci_at91_port_suspend/resume or not (just test for sfr_regmap !=3D NULL). --=20 Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com