public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs
@ 2011-06-29 11:23 Adrian Hunter
  2011-06-29 11:23 ` [PATCH 1/2] mmc: sdhci-pci: add 8-bit bus width support for mrst hc0 Adrian Hunter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Adrian Hunter @ 2011-06-29 11:23 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Philip Rakity, Adrian Hunter

Hi

Just setting some MMC_CAP_8_BIT_DATA bits.


Adrian Hunter (1):
      mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs

Major Lee (1):
      mmc: sdhci-pci: add 8-bit bus width support for mrst hc0

 drivers/mmc/host/sdhci-pci.c |   54 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 49 insertions(+), 5 deletions(-)

Regards
Adrian Hunter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] mmc: sdhci-pci: add 8-bit bus width support for mrst hc0
  2011-06-29 11:23 [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs Adrian Hunter
@ 2011-06-29 11:23 ` Adrian Hunter
  2011-06-29 11:23 ` [PATCH 2/2] mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs Adrian Hunter
  2011-07-09 20:53 ` [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for " Chris Ball
  2 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2011-06-29 11:23 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Philip Rakity, Major Lee, Alan Cox, Dirk Brandewie

From: Major Lee <major_lee@wistron.com>

And hook platform_8bit_width to support 8-bit bus width.

Signed-off-by: Major Lee <major_lee@wistron.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
---
 drivers/mmc/host/sdhci-pci.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 936bbca..e1ae855 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -143,6 +143,12 @@ static const struct sdhci_pci_fixes sdhci_cafe = {
 			  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
 };
 
+static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot)
+{
+	slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA;
+	return 0;
+}
+
 /*
  * ADMA operation is disabled for Moorestown platform due to
  * hardware bugs.
@@ -159,6 +165,7 @@ static int mrst_hc_probe(struct sdhci_pci_chip *chip)
 
 static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = {
 	.quirks		= SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_NO_HISPD_BIT,
+	.probe_slot	= mrst_hc_probe_slot,
 };
 
 static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = {
@@ -789,8 +796,34 @@ static int sdhci_pci_enable_dma(struct sdhci_host *host)
 	return 0;
 }
 
+static int sdhci_pci_8bit_width(struct sdhci_host *host, int width)
+{
+	u8 ctrl;
+
+	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
+
+	switch (width) {
+	case MMC_BUS_WIDTH_8:
+		ctrl |= SDHCI_CTRL_8BITBUS;
+		ctrl &= ~SDHCI_CTRL_4BITBUS;
+		break;
+	case MMC_BUS_WIDTH_4:
+		ctrl |= SDHCI_CTRL_4BITBUS;
+		ctrl &= ~SDHCI_CTRL_8BITBUS;
+		break;
+	default:
+		ctrl &= ~(SDHCI_CTRL_8BITBUS | SDHCI_CTRL_4BITBUS);
+		break;
+	}
+
+	sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
+
+	return 0;
+}
+
 static struct sdhci_ops sdhci_pci_ops = {
 	.enable_dma	= sdhci_pci_enable_dma,
+	.platform_8bit_width	= sdhci_pci_8bit_width,
 };
 
 /*****************************************************************************\
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs
  2011-06-29 11:23 [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs Adrian Hunter
  2011-06-29 11:23 ` [PATCH 1/2] mmc: sdhci-pci: add 8-bit bus width support for mrst hc0 Adrian Hunter
@ 2011-06-29 11:23 ` Adrian Hunter
  2011-07-09 20:53 ` [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for " Chris Ball
  2 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2011-06-29 11:23 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Philip Rakity, Adrian Hunter

Unless MMC_CAP_8_BIT_DATA is set, the bus width defaults to 4.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci-pci.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index e1ae855..26c5286 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -163,6 +163,12 @@ static int mrst_hc_probe(struct sdhci_pci_chip *chip)
 	return 0;
 }
 
+static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot)
+{
+	slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA;
+	return 0;
+}
+
 static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = {
 	.quirks		= SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_NO_HISPD_BIT,
 	.probe_slot	= mrst_hc_probe_slot,
@@ -177,8 +183,13 @@ static const struct sdhci_pci_fixes sdhci_intel_mfd_sd = {
 	.quirks		= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
 };
 
-static const struct sdhci_pci_fixes sdhci_intel_mfd_emmc_sdio = {
+static const struct sdhci_pci_fixes sdhci_intel_mfd_sdio = {
+	.quirks		= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+};
+
+static const struct sdhci_pci_fixes sdhci_intel_mfd_emmc = {
 	.quirks		= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+	.probe_slot	= mfd_emmc_probe_slot,
 };
 
 /* O2Micro extra registers */
@@ -689,7 +700,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
 		.device		= PCI_DEVICE_ID_INTEL_MFD_SDIO1,
 		.subvendor	= PCI_ANY_ID,
 		.subdevice	= PCI_ANY_ID,
-		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_sdio,
 	},
 
 	{
@@ -697,7 +708,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
 		.device		= PCI_DEVICE_ID_INTEL_MFD_SDIO2,
 		.subvendor	= PCI_ANY_ID,
 		.subdevice	= PCI_ANY_ID,
-		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_sdio,
 	},
 
 	{
@@ -705,7 +716,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
 		.device		= PCI_DEVICE_ID_INTEL_MFD_EMMC0,
 		.subvendor	= PCI_ANY_ID,
 		.subdevice	= PCI_ANY_ID,
-		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_emmc,
 	},
 
 	{
@@ -713,7 +724,7 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
 		.device		= PCI_DEVICE_ID_INTEL_MFD_EMMC1,
 		.subvendor	= PCI_ANY_ID,
 		.subdevice	= PCI_ANY_ID,
-		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_emmc_sdio,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_mfd_emmc,
 	},
 
 	{
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs
  2011-06-29 11:23 [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs Adrian Hunter
  2011-06-29 11:23 ` [PATCH 1/2] mmc: sdhci-pci: add 8-bit bus width support for mrst hc0 Adrian Hunter
  2011-06-29 11:23 ` [PATCH 2/2] mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs Adrian Hunter
@ 2011-07-09 20:53 ` Chris Ball
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Ball @ 2011-07-09 20:53 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-mmc, Philip Rakity

Hi Adrian,

On Wed, Jun 29 2011, Adrian Hunter wrote:
> Just setting some MMC_CAP_8_BIT_DATA bits.
>
>
> Adrian Hunter (1):
>       mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs
>
> Major Lee (1):
>       mmc: sdhci-pci: add 8-bit bus width support for mrst hc0

Pushed to mmc-next for 3.1, thanks.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-09 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-29 11:23 [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for Medfield eMMCs Adrian Hunter
2011-06-29 11:23 ` [PATCH 1/2] mmc: sdhci-pci: add 8-bit bus width support for mrst hc0 Adrian Hunter
2011-06-29 11:23 ` [PATCH 2/2] mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs Adrian Hunter
2011-07-09 20:53 ` [PATCH 0/2] mmc: sdhci-pci: add 8-bit bus width support for " Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox