[PATCH] mmc: omap_hsmmc: Enable SDIO IRQ using a GPIO in idle mode.

Grant Likely grant.likely at secretlab.ca
Sat Feb 9 00:05:20 EST 2013


On Thu, 20 Dec 2012 23:12:12 +0100, Andreas Fenkart <andreas.fenkart at streamunlimited.com> wrote:
> Without functional clock the omap_hsmmc module can't forward
> SDIO IRQs to the system. This patch reconfigures dat1 line
> as a gpio while the fclk is off. And uses SDIO IRQ detection of
> the module, while fclk is present.
> 
> Signed-off-by: Andreas Fenkart <andreas.fenkart at streamunlimited.com>
> ---
>  .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |   42 ++++
>  arch/arm/plat-omap/include/plat/mmc.h              |    4 +
>  drivers/mmc/host/omap_hsmmc.c                      |  219 ++++++++++++++++++--
>  3 files changed, 247 insertions(+), 18 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> index d1b8932..4d57637 100644
> --- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
> @@ -24,6 +24,29 @@ One tx and one rx pair is required.
>  dma-names: DMA request names. These strings correspond 1:1 with
>  the ordered pairs in dmas. The RX request must be "rx" and the
>  TX request must be "tx".
> +ti,cirq-gpio: When omap_hsmmc module is suspended, its functional
> +clock is turned off. Without fclk it can't forward SDIO IRQs to the
> +system. For that to happen, it needs to tell the PRCM to restore
> +its fclk, which is done through the swakeup line.
> +
> +                   ------
> +                  | PRCM |
> +                   ------
> +                    | ^
> +               fclk | | swakeup
> +                    v |
> +                  -------               ------
> +      <-- IRQ -- | hsmmc | <-- CIRQ -- | card |
> +                  -------               ------
> +
> +The problem is, that on the AM335x family the swakeup line is
> +missing, it has not been routed from the module to the PRCM.
> +The way to work around this, is to reconfigure the dat1 line as a
> +GPIO upon suspend. Beyond this option you also need to set named
> +states "default" and "idle "in the .dts file for the pins, using
> +pinctrl-single.c. The MMC driver will then then toggle between
> +default and idle during the runtime.
> +
>  
>  Examples:
>  
> @@ -53,3 +76,22 @@ Examples:
>  			&edma 25>;
>  		dma-names = "tx", "rx";
>  	};
> +
> +[am335x with with gpio for sdio irq]
> +
> +	mmc1_cirq_pin: pinmux_cirq_pin {
> +		pinctrl-single,pins = <
> +			0x0f8 0x3f	/* MMC0_DAT1 as GPIO2_28 */
> +		>;
> +	};
> +
> +	mmc1: mmc at 48060000 {
> +		pinctrl-names = "default", "idle";
> +		pinctrl-0 = <&mmc1_pins>;
> +		pinctrl-1 = <&mmc1_cirq_pin>;
> +		ti,cirq-gpio = <&gpio3 28 0>;
> +		ti,non-removable;
> +		bus-width = <4>;
> +		vmmc-supply = <&ldo2_reg>;
> +		vmmc_aux-supply = <&vmmc>;
> +	};

Binding looks reasonable.

Reviewed-by: Grant Likely <grant.likely at secretlab.ca>



More information about the devicetree-discuss mailing list