diff mbox series

[v12,6/6] arm64: dts: qcom: sc7280: Add wakeup-source property for USB node

Message ID 1649321104-31322-7-git-send-email-quic_c_sanm@quicinc.com
State Superseded
Headers show
Series USB DWC3 host wake up support from system suspend | expand

Commit Message

Sandeep Maheswaram April 7, 2022, 8:45 a.m. UTC
Adding wakeup-source property for USB controller in SC7280.
This property is added to inform that the USB controller is
wake up capable and to conditionally power down the phy during
system suspend.

Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 1 +
 1 file changed, 1 insertion(+)

Comments

Matthias Kaehlcke April 7, 2022, 6:06 p.m. UTC | #1
On Thu, Apr 07, 2022 at 02:15:04PM +0530, Sandeep Maheswaram wrote:
> Adding wakeup-source property for USB controller in SC7280.
> This property is added to inform that the USB controller is
> wake up capable and to conditionally power down the phy during
> system suspend.
> 
> Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
> ---
>  arch/arm64/boot/dts/qcom/sc7280.dtsi | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> index f0b64be..046262a 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> @@ -2916,6 +2916,7 @@
>  				phys = <&usb_1_hsphy>, <&usb_1_ssphy>;
>  				phy-names = "usb2-phy", "usb3-phy";
>  				maximum-speed = "super-speed";
> +				wakeup-source;
>  			};
>  		};

Not all SC7280 boards may want to enable wakeup from USB, so this is
probably best configured on a per-board basis.
Pavan Kondeti April 8, 2022, 2:02 a.m. UTC | #2
On Thu, Apr 07, 2022 at 11:06:40AM -0700, Matthias Kaehlcke wrote:
> On Thu, Apr 07, 2022 at 02:15:04PM +0530, Sandeep Maheswaram wrote:
> > Adding wakeup-source property for USB controller in SC7280.
> > This property is added to inform that the USB controller is
> > wake up capable and to conditionally power down the phy during
> > system suspend.
> > 
> > Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
> > ---
> >  arch/arm64/boot/dts/qcom/sc7280.dtsi | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > index f0b64be..046262a 100644
> > --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > @@ -2916,6 +2916,7 @@
> >  				phys = <&usb_1_hsphy>, <&usb_1_ssphy>;
> >  				phy-names = "usb2-phy", "usb3-phy";
> >  				maximum-speed = "super-speed";
> > +				wakeup-source;
> >  			};
> >  		};
> 
> Not all SC7280 boards may want to enable wakeup from USB, so this is
> probably best configured on a per-board basis.

This wakeup capability is provided by the SoC. If a particular
board does not want to support, ideally it needs to be disabled from
user space. The capability is always there but some platforms choose to
disable it.

Thanks,
Pavan
Matthias Kaehlcke April 8, 2022, 3:28 p.m. UTC | #3
On Fri, Apr 08, 2022 at 07:32:39AM +0530, Pavan Kondeti wrote:
> On Thu, Apr 07, 2022 at 11:06:40AM -0700, Matthias Kaehlcke wrote:
> > On Thu, Apr 07, 2022 at 02:15:04PM +0530, Sandeep Maheswaram wrote:
> > > Adding wakeup-source property for USB controller in SC7280.
> > > This property is added to inform that the USB controller is
> > > wake up capable and to conditionally power down the phy during
> > > system suspend.
> > > 
> > > Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com>
> > > ---
> > >  arch/arm64/boot/dts/qcom/sc7280.dtsi | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > > index f0b64be..046262a 100644
> > > --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > > +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > > @@ -2916,6 +2916,7 @@
> > >  				phys = <&usb_1_hsphy>, <&usb_1_ssphy>;
> > >  				phy-names = "usb2-phy", "usb3-phy";
> > >  				maximum-speed = "super-speed";
> > > +				wakeup-source;
> > >  			};
> > >  		};
> > 
> > Not all SC7280 boards may want to enable wakeup from USB, so this is
> > probably best configured on a per-board basis.
> 
> This wakeup capability is provided by the SoC. If a particular
> board does not want to support, ideally it needs to be disabled from
> user space. The capability is always there but some platforms choose to
> disable it.

I guess 'wakeup-source' is a bit of an edge case between hardware capability
(which is certainly required to make wakeup work) and policy.

arch/arm64/boot/dts/mediatek/mt2712-evb.dts and
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi are two example where
'wakeup-source' is set at the board level for a USB controller.

It's also true that user space can disable wakeup as you said, and a board
could also delete the property in its device tree if desired.

With that I agree that setting 'wakeup-source' at the SoC level provides
more flexibility and is more in line with the DT as hardware description.

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index f0b64be..046262a 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -2916,6 +2916,7 @@ 
 				phys = <&usb_1_hsphy>, <&usb_1_ssphy>;
 				phy-names = "usb2-phy", "usb3-phy";
 				maximum-speed = "super-speed";
+				wakeup-source;
 			};
 		};