diff mbox series

[1/2] dt-bindings: usb: mediatek,mtk-xhci: add keep-clock-on

Message ID 1604301530-31546-1-git-send-email-macpaul.lin@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [1/2] dt-bindings: usb: mediatek,mtk-xhci: add keep-clock-on | expand

Commit Message

Macpaul Lin Nov. 2, 2020, 7:18 a.m. UTC
Option "mediatek,keep-clock-on" means to keep clock on during system
suspend and resume. Some platform will flush register settings if clock has
been disabled when system is suspended. Set this option to avoid clock off.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml |    7 +++++++
 1 file changed, 7 insertions(+)

Comments

Chunfeng Yun (云春峰) Nov. 3, 2020, 3:01 a.m. UTC | #1
Hi Macpaul,

On Mon, 2020-11-02 at 15:18 +0800, Macpaul Lin wrote:
> Option "mediatek,keep-clock-on" means to keep clock on during system
> suspend and resume. Some platform will flush register settings if clock has
> been disabled when system is suspended. Set this option to avoid clock off.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml |    7 +++++++

This depends on reviewing patch:
https://patchwork.kernel.org/project/linux-mediatek/patch/20201014014434.62239-6-chunfeng.yun@mediatek.com/
[v2,6/8] dt-bindings: usb: convert mediatek, mtk-xhci.txt to YAML schema

Please add it after "---", thanks


>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> index ea696c8..a956dde 100644
> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> @@ -104,6 +104,12 @@ properties:
>      description: enable USB remote wakeup, see power/wakeup-source.txt
>      type: boolean
>  
> +  mediatek,keep-clock-on:
> +    description: |
> +      Keep clock on during system suspend and resume. Some platform will flush
> +      register settings if clock has been disabled when system is suspended.
> +    type: boolean
> +
>    mediatek,syscon-wakeup:
>      $ref: /schemas/types.yaml#/definitions/phandle-array
>      maxItems: 1
> @@ -175,6 +181,7 @@ examples:
>          imod-interval-ns = <10000>;
>          mediatek,syscon-wakeup = <&pericfg 0x400 1>;
>          wakeup-source;
> +        mediatek,keep-clock-on;
>          usb3-lpm-capable;
>      };
>  ...
Rob Herring Nov. 4, 2020, 10:39 p.m. UTC | #2
On Mon, Nov 02, 2020 at 03:18:48PM +0800, Macpaul Lin wrote:
> Option "mediatek,keep-clock-on" means to keep clock on during system
> suspend and resume. Some platform will flush register settings if clock has
> been disabled when system is suspended. Set this option to avoid clock off.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> index ea696c8..a956dde 100644
> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> @@ -104,6 +104,12 @@ properties:
>      description: enable USB remote wakeup, see power/wakeup-source.txt
>      type: boolean
>  
> +  mediatek,keep-clock-on:
> +    description: |
> +      Keep clock on during system suspend and resume. Some platform will flush
> +      register settings if clock has been disabled when system is suspended.
> +    type: boolean
> +

This should be implied by the compatible string.

>    mediatek,syscon-wakeup:
>      $ref: /schemas/types.yaml#/definitions/phandle-array
>      maxItems: 1
> @@ -175,6 +181,7 @@ examples:
>          imod-interval-ns = <10000>;
>          mediatek,syscon-wakeup = <&pericfg 0x400 1>;
>          wakeup-source;
> +        mediatek,keep-clock-on;
>          usb3-lpm-capable;
>      };
>  ...
> -- 
> 1.7.9.5
Macpaul Lin Nov. 6, 2020, 9:29 a.m. UTC | #3
On Wed, 2020-11-04 at 16:39 -0600, Rob Herring wrote:
> On Mon, Nov 02, 2020 at 03:18:48PM +0800, Macpaul Lin wrote:
> > Option "mediatek,keep-clock-on" means to keep clock on during system
> > suspend and resume. Some platform will flush register settings if clock has
> > been disabled when system is suspended. Set this option to avoid clock off.
> > 
> > Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> > ---
> >  .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml |    7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > index ea696c8..a956dde 100644
> > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > @@ -104,6 +104,12 @@ properties:
> >      description: enable USB remote wakeup, see power/wakeup-source.txt
> >      type: boolean
> >  
> > +  mediatek,keep-clock-on:
> > +    description: |
> > +      Keep clock on during system suspend and resume. Some platform will flush
> > +      register settings if clock has been disabled when system is suspended.
> > +    type: boolean
> > +
> 
> This should be implied by the compatible string.

This should be an property according to system-wide design.

Mtk-xhci may be applied to different product lines for the same platform
(IC). Suspend on phone system is different to tablet or laptop. Phone's
power management module will turn off XHCI's power once the clock has
been turned off. For example, the headset plugged into phone won't do
disconnect and re-enumeration during system suspend. Click a button on
the headset to wake-up phone is necessary, and then, XHCI needs ready to
work immediately.

If the IC has been applied to a tablet or laptop product. When system is
suspending, the headset will be disconnected. The headset will do
re-enumerate when system is waking up. In this kind of applications, the
power of XHCI can be turned off with clock.

> >    mediatek,syscon-wakeup:
> >      $ref: /schemas/types.yaml#/definitions/phandle-array
> >      maxItems: 1
> > @@ -175,6 +181,7 @@ examples:
> >          imod-interval-ns = <10000>;
> >          mediatek,syscon-wakeup = <&pericfg 0x400 1>;
> >          wakeup-source;
> > +        mediatek,keep-clock-on;
> >          usb3-lpm-capable;
> >      };
> >  ...
> > -- 
> > 1.7.9.5

After a discussion with Chunfeng, I'll send a new version for 
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt because the
YAML file still need to be revised. The property
"mediatek,keep-clock-on" will be renamed to "mediatek,str-clock-on" for
implying it relates to suspend/resume capability.

Thanks.
Macpaul Lin
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
index ea696c8..a956dde 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
@@ -104,6 +104,12 @@  properties:
     description: enable USB remote wakeup, see power/wakeup-source.txt
     type: boolean
 
+  mediatek,keep-clock-on:
+    description: |
+      Keep clock on during system suspend and resume. Some platform will flush
+      register settings if clock has been disabled when system is suspended.
+    type: boolean
+
   mediatek,syscon-wakeup:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     maxItems: 1
@@ -175,6 +181,7 @@  examples:
         imod-interval-ns = <10000>;
         mediatek,syscon-wakeup = <&pericfg 0x400 1>;
         wakeup-source;
+        mediatek,keep-clock-on;
         usb3-lpm-capable;
     };
 ...