Re: [PATCH 2/2] MMC: MMC/SD/CE-ATA/SDIO driver for Intel Moorestown platform
From: Pierre Ossman
Date: Sun May 10 2009 - 14:42:33 EST
On Thu, 30 Apr 2009 17:19:06 +0800
"Li, Jiebing" <jiebing.li@xxxxxxxxx> wrote:
>
> This patch enables support of SDIO bus driver suspend/resume operation and supply sysfs interface for user
> to call suspend/resume selectively.Remind that this function should work together with SDIO device driver's
> suspend/resume function.
>
As Matthew asked, what's the use case?
> And Moorestown's specific code is added into this patch to enable the second SDIO slot of the host controller.
>
Again, stop mixing unrelated things in the same patch.
> @@ -452,3 +828,84 @@ err:
> return err;
> }
>
> +/*
> + * warn device driver and perform a SDIO device reset.
> + * Assume that device driver knows hot to handle resets.
> + */
> +int sdio_reset_device(struct mmc_card *card)
> +{
Use case?
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index b4cf691..0c9d2eb 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -44,6 +44,14 @@ config MMC_SDHCI_IO_ACCESSORS
> This is silent Kconfig symbol that is selected by the drivers that
> need to overwrite SDHCI IO memory accessors.
>
> +config MMC_SDHCI_MRST_SDIO1
> + bool
> + depends on MMC_SDHCI
> + help
> + This enables Moorestown SD host controller's 2nd SDIO slot.
> +
> + If unsure, say N.
> +
Detect this at runtime.
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index a2804f1..4d4ad6d 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -914,6 +914,17 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
> if (cmd->data)
> flags |= SDHCI_CMD_DATA;
>
> +#ifdef CONFIG_MMC_SDHCI_MRST_SDIO1
> + if (host->quirks & SDHCI_QUIRK_MRST_RESTRICTION) {
> + u16 clk;
> +
> + clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
> +
> + clk |= SDHCI_CLOCK_CARD_EN;
> + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
> + }
> +#endif
> +
> sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND);
> }
>
Huh? Is this some kind of multiplexed nonsense?
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index fa87b8b..50be698 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -227,6 +227,8 @@ struct sdhci_host {
> #define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19)
> /* Controller has to be forced to use block size of 2048 bytes */
> #define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20)
> +/* Controller of Moorestown specific restriction */
> +#define SDHCI_QUIRK_MRST_RESTRICTION (1<<21)
>
No. Quirks should be defined in a way that allows reuse.
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by the
Swedish government. Make sure your server uses encryption
for SMTP traffic and consider using PGP for end-to-end
encryption.
Attachment:
signature.asc
Description: PGP signature