Re: [PATCH] mmc:sdhci:add support to request/free pins for controllers sharing hardware bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Barry,

How are SDIO interrupts handled ?

Philip

On Apr 25, 2011, at 8:34 PM, Barry Song wrote:

> From: Bin Shi <bin.shi@xxxxxxx>
> 
> some controllers share data bus or other pins between
> multi-controllers and need to switch the functions of shared pins
> runtime.
> this patch requested those shared pins before actual hardware access
> and release them after access
> 
> Signed-off-by: Bin Shi <bin.shi@xxxxxxx>
> Cc: Binghua Duan <binghua.duan@xxxxxxx>
> Cc: Andrei Warkentin <andreiw@xxxxxxxxxxxx>
> Cc: Philip Rakity <prakity@xxxxxxxxxxx>
> Signed-off-by: Barry Song <21cnbao@xxxxxxxxx>
> ---
>  drivers/mmc/host/sdhci.c |   13 +++++++++++++
>  drivers/mmc/host/sdhci.h |    2 ++
>  2 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index f70e21e..92ae9f7 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1143,6 +1143,13 @@ static void sdhci_request(struct mmc_host *mmc,
> struct mmc_request *mrq)
> 
>        host = mmc_priv(mmc);
> 
> +       /*
> +        * some controllers share data bus or other pins between
> multi-controller
> +        * and need to switch the function of pins runtime
> +        */
> +       if (host->ops->get_shared_pins)
> +               host->ops->get_shared_pins(host);
> +
>        spin_lock_irqsave(&host->lock, flags);
> 
>        WARN_ON(host->mrq != NULL);
> @@ -1417,6 +1424,12 @@ static void sdhci_tasklet_finish(unsigned long param)
>        spin_unlock_irqrestore(&host->lock, flags);
> 
>        mmc_request_done(host->mmc, mrq);
> +
> +       /*
> +        * release shared pins so that other controllers can use them
> +        */
> +       if (host->ops->put_shared_pins)
> +               host->ops->put_shared_pins(host);
>  }
> 
>  static void sdhci_timeout_timer(unsigned long data)
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index c6e25a7..5a26cfe 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -231,6 +231,8 @@ struct sdhci_ops {
>        unsigned int    (*get_ro)(struct sdhci_host *host);
>        void    (*platform_reset_enter)(struct sdhci_host *host, u8 mask);
>        void    (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
> +       unsigned int    (*get_shared_pins)(struct sdhci_host *host);
> +       unsigned int    (*put_shared_pins)(struct sdhci_host *host);
>  };
> 
>  #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
> --
> 1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux