diff mbox series

[v4,1/3] dt-bindings: mmc: add cap-sdio-async-irq flag

Message ID 20220119103212.13158-2-axe.yang@mediatek.com (mailing list archive)
State New, archived
Headers show
Series mmc: mediatek: add support for SDIO eint IRQ | expand

Commit Message

Axe Yang (杨磊) Jan. 19, 2022, 10:32 a.m. UTC
Asynchronous interrupt is a mechanism that allow SDIO devices alarm
interrupt when host stop providing clock to card. Add a DT flag to
enable this feature if it is supported by SDIO card.

Signed-off-by: Axe Yang <axe.yang@mediatek.com>
---
 Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Ulf Hansson Feb. 14, 2022, 3:23 p.m. UTC | #1
On Wed, 19 Jan 2022 at 11:32, Axe Yang <axe.yang@mediatek.com> wrote:
>
> Asynchronous interrupt is a mechanism that allow SDIO devices alarm
> interrupt when host stop providing clock to card. Add a DT flag to
> enable this feature if it is supported by SDIO card.
>
> Signed-off-by: Axe Yang <axe.yang@mediatek.com>
> ---
>  Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> index 513f3c8758aa..16fb06f88471 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> +++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> @@ -165,6 +165,11 @@ properties:
>      description:
>        eMMC hardware reset is supported
>
> +  cap-sdio-async-irq:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      SDIO async interrupt is supported.

We already have a DT property for this, I believe.

"wakeup-source" is probably what you want, but we have additional
properties that are related to this too. See more below.

> +
>    cap-sdio-irq:
>      $ref: /schemas/types.yaml#/definitions/flag
>      description:

The above, "cap-sdio-irq", informs whether the SDIO IRQs can be
supported at all, by the host controller.

The property "keep-power-in-suspend" informs whether we can preserve
the power to the card during a suspend/resume cycle. This should be
needed in your case too, I think.

In other words, you may need to combine "cap-sdio-irq",
"wakeup-source" and "keep-power-in-suspend" to describe your HW.

However, what perhaps is missing, is a common MMC/SDIO binding that
let us describe an optional irq-line, which sometimes is being used
for the wakeup irq. In the sdhci-omap case, we look for an irq mapping
towards "wakeup" if specified in the "interrupt-names" property.

In some case, when the SDIO card supports an out-of-band IRQ line, the
similar should be specified in the child-node corresponding to the
SDIO card.

Kind regards
Uffe
Axe Yang (杨磊) Feb. 21, 2022, 7:04 a.m. UTC | #2
On Mon, 2022-02-14 at 16:23 +0100, Ulf Hansson wrote:
> On Wed, 19 Jan 2022 at 11:32, Axe Yang <axe.yang@mediatek.com> wrote:
> > 
> > Asynchronous interrupt is a mechanism that allow SDIO devices alarm
> > interrupt when host stop providing clock to card. Add a DT flag to
> > enable this feature if it is supported by SDIO card.
> > 
> > Signed-off-by: Axe Yang <axe.yang@mediatek.com>
> > ---
> >  Documentation/devicetree/bindings/mmc/mmc-controller.yaml | 5
> > +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/mmc-
> > controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-
> > controller.yaml
> > index 513f3c8758aa..16fb06f88471 100644
> > --- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> > +++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
> > @@ -165,6 +165,11 @@ properties:
> >      description:
> >        eMMC hardware reset is supported
> > 
> > +  cap-sdio-async-irq:
> > +    $ref: /schemas/types.yaml#/definitions/flag
> > +    description:
> > +      SDIO async interrupt is supported.
> 
> We already have a DT property for this, I believe.
> 
> "wakeup-source" is probably what you want, but we have additional
> properties that are related to this too. See more below.
> 
> > +
> >    cap-sdio-irq:
> >      $ref: /schemas/types.yaml#/definitions/flag
> >      description:
> 
> The above, "cap-sdio-irq", informs whether the SDIO IRQs can be
> supported at all, by the host controller.
> 
> The property "keep-power-in-suspend" informs whether we can preserve
> the power to the card during a suspend/resume cycle. This should be
> needed in your case too, I think.
> 
> In other words, you may need to combine "cap-sdio-irq",
> "wakeup-source" and "keep-power-in-suspend" to describe your HW.
> 
> However, what perhaps is missing, is a common MMC/SDIO binding that
> let us describe an optional irq-line, which sometimes is being used
> for the wakeup irq. In the sdhci-omap case, we look for an irq
> mapping
> towards "wakeup" if specified in the "interrupt-names" property.
> 
> In some case, when the SDIO card supports an out-of-band IRQ line,
> the
> similar should be specified in the child-node corresponding to the
> SDIO card.
> 
> 

Yes, the intention of the patchset is to wakeup SDIO host in
runtime/system suspend state within SDIO DAT1(in-band wakeup).

I will implement it with "wakeup-source", thanks for your review.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
index 513f3c8758aa..16fb06f88471 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
+++ b/Documentation/devicetree/bindings/mmc/mmc-controller.yaml
@@ -165,6 +165,11 @@  properties:
     description:
       eMMC hardware reset is supported
 
+  cap-sdio-async-irq:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      SDIO async interrupt is supported.
+
   cap-sdio-irq:
     $ref: /schemas/types.yaml#/definitions/flag
     description: