All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] mmc: add more device ids
@ 2013-04-26  8:27 Adrian Hunter
  2013-04-26  8:27 ` [PATCH 1/3] mmc: sdhci-acpi: fix initial runtime pm status Adrian Hunter
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Adrian Hunter @ 2013-04-26  8:27 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Adrian Hunter

Hi

Here is a minor fix and some more device ids for sdhci-acpi and sdhci-pci.

Please queue for 3.10 if possible.

Adrian Hunter (3):
      mmc: sdhci-acpi: fix initial runtime pm status
      mmc: sdhci-acpi: add more device ids
      mmc: sdhci-pci: add more device ids

 drivers/mmc/host/sdhci-acpi.c | 69 +++++++++++++++++++++++++++++++++++++------
 drivers/mmc/host/sdhci-pci.c  | 54 +++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 9 deletions(-)

Regards
Adrian


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

* [PATCH 1/3] mmc: sdhci-acpi: fix initial runtime pm status
  2013-04-26  8:27 [PATCH 0/3] mmc: add more device ids Adrian Hunter
@ 2013-04-26  8:27 ` Adrian Hunter
  2013-04-26  8:27 ` [PATCH 2/3] mmc: sdhci-acpi: add more device ids Adrian Hunter
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2013-04-26  8:27 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Adrian Hunter

Initial runtime pm status is active.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci-acpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 7bcf74b..1da5f29 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -202,6 +202,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 		goto err_free;
 
 	if (c->use_runtime_pm) {
+		pm_runtime_set_active(dev);
 		pm_suspend_ignore_children(dev, 1);
 		pm_runtime_set_autosuspend_delay(dev, 50);
 		pm_runtime_use_autosuspend(dev);
-- 
1.7.11.7


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

* [PATCH 2/3] mmc: sdhci-acpi: add more device ids
  2013-04-26  8:27 [PATCH 0/3] mmc: add more device ids Adrian Hunter
  2013-04-26  8:27 ` [PATCH 1/3] mmc: sdhci-acpi: fix initial runtime pm status Adrian Hunter
@ 2013-04-26  8:27 ` Adrian Hunter
  2013-04-26  8:27 ` [PATCH 3/3] mmc: sdhci-pci: " Adrian Hunter
  2013-05-26 17:51 ` [PATCH 0/3] mmc: " Chris Ball
  3 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2013-04-26  8:27 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Adrian Hunter

Add three more ACPI HIDs.  Also, as some devices must be
further distinguished by ACPI UID, slot information is now
associated with HID and UID.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/host/sdhci-acpi.c | 68 +++++++++++++++++++++++++++++++++++++------
 1 file changed, 59 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 1da5f29..706d9cb 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -87,6 +87,12 @@ static const struct sdhci_ops sdhci_acpi_ops_dflt = {
 	.enable_dma = sdhci_acpi_enable_dma,
 };
 
+static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = {
+	.caps    = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
+	.caps2   = MMC_CAP2_HC_ERASE_SZ,
+	.flags   = SDHCI_ACPI_RUNTIME_PM,
+};
+
 static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = {
 	.quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON,
 	.caps    = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD,
@@ -94,23 +100,67 @@ static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = {
 	.pm_caps = MMC_PM_KEEP_POWER,
 };
 
+static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sd = {
+};
+
+struct sdhci_acpi_uid_slot {
+	const char *hid;
+	const char *uid;
+	const struct sdhci_acpi_slot *slot;
+};
+
+static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = {
+	{ "80860F14" , "1" , &sdhci_acpi_slot_int_emmc },
+	{ "80860F14" , "3" , &sdhci_acpi_slot_int_sd   },
+	{ "INT33BB"  , "2" , &sdhci_acpi_slot_int_sdio },
+	{ "INT33C6"  , NULL, &sdhci_acpi_slot_int_sdio },
+	{ "PNP0D40"  },
+	{ },
+};
+
 static const struct acpi_device_id sdhci_acpi_ids[] = {
-	{ "INT33C6", (kernel_ulong_t)&sdhci_acpi_slot_int_sdio },
-	{ "PNP0D40" },
+	{ "80860F14" },
+	{ "INT33BB"  },
+	{ "INT33C6"  },
+	{ "PNP0D40"  },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids);
 
-static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid)
+static const struct sdhci_acpi_slot *sdhci_acpi_get_slot_by_ids(const char *hid,
+								const char *uid)
 {
-	const struct acpi_device_id *id;
-
-	for (id = sdhci_acpi_ids; id->id[0]; id++)
-		if (!strcmp(id->id, hid))
-			return (const struct sdhci_acpi_slot *)id->driver_data;
+	const struct sdhci_acpi_uid_slot *u;
+
+	for (u = sdhci_acpi_uids; u->hid; u++) {
+		if (strcmp(u->hid, hid))
+			continue;
+		if (!u->uid)
+			return u->slot;
+		if (uid && !strcmp(u->uid, uid))
+			return u->slot;
+	}
 	return NULL;
 }
 
+static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(acpi_handle handle,
+							 const char *hid)
+{
+	const struct sdhci_acpi_slot *slot;
+	struct acpi_device_info *info;
+	const char *uid = NULL;
+	acpi_status status;
+
+	status = acpi_get_object_info(handle, &info);
+	if (!ACPI_FAILURE(status) && (info->valid & ACPI_VALID_UID))
+		uid = info->unique_id.string;
+
+	slot = sdhci_acpi_get_slot_by_ids(hid, uid);
+
+	kfree(info);
+	return slot;
+}
+
 static int sdhci_acpi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -148,7 +198,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 
 	c = sdhci_priv(host);
 	c->host = host;
-	c->slot = sdhci_acpi_get_slot(hid);
+	c->slot = sdhci_acpi_get_slot(handle, hid);
 	c->pdev = pdev;
 	c->use_runtime_pm = sdhci_acpi_flag(c, SDHCI_ACPI_RUNTIME_PM);
 
-- 
1.7.11.7


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

* [PATCH 3/3] mmc: sdhci-pci: add more device ids
  2013-04-26  8:27 [PATCH 0/3] mmc: add more device ids Adrian Hunter
  2013-04-26  8:27 ` [PATCH 1/3] mmc: sdhci-acpi: fix initial runtime pm status Adrian Hunter
  2013-04-26  8:27 ` [PATCH 2/3] mmc: sdhci-acpi: add more device ids Adrian Hunter
@ 2013-04-26  8:27 ` Adrian Hunter
  2013-05-26 17:51 ` [PATCH 0/3] mmc: " Chris Ball
  3 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2013-04-26  8:27 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Adrian Hunter

Add three more PCI device ids.

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

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 0012d3f..701d06d 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -33,6 +33,9 @@
  */
 #define PCI_DEVICE_ID_INTEL_PCH_SDIO0	0x8809
 #define PCI_DEVICE_ID_INTEL_PCH_SDIO1	0x880a
+#define PCI_DEVICE_ID_INTEL_BYT_EMMC	0x0f14
+#define PCI_DEVICE_ID_INTEL_BYT_SDIO	0x0f15
+#define PCI_DEVICE_ID_INTEL_BYT_SD	0x0f16
 
 /*
  * PCI registers
@@ -304,6 +307,33 @@ static const struct sdhci_pci_fixes sdhci_intel_pch_sdio = {
 	.probe_slot	= pch_hc_probe_slot,
 };
 
+static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
+{
+	slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE;
+	slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ;
+	return 0;
+}
+
+static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
+{
+	slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE;
+	return 0;
+}
+
+static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = {
+	.allow_runtime_pm = true,
+	.probe_slot	= byt_emmc_probe_slot,
+};
+
+static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = {
+	.quirks2	= SDHCI_QUIRK2_HOST_OFF_CARD_ON,
+	.allow_runtime_pm = true,
+	.probe_slot	= byt_sdio_probe_slot,
+};
+
+static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
+};
+
 /* O2Micro extra registers */
 #define O2_SD_LOCK_WP		0xD3
 #define O2_SD_MULTI_VCC3V	0xEE
@@ -856,6 +886,30 @@ static const struct pci_device_id pci_ids[] = {
 	},
 
 	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BYT_EMMC,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_emmc,
+	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BYT_SDIO,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_sdio,
+	},
+
+	{
+		.vendor		= PCI_VENDOR_ID_INTEL,
+		.device		= PCI_DEVICE_ID_INTEL_BYT_SD,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (kernel_ulong_t)&sdhci_intel_byt_sd,
+	},
+
+	{
 		.vendor		= PCI_VENDOR_ID_O2,
 		.device		= PCI_DEVICE_ID_O2_8120,
 		.subvendor	= PCI_ANY_ID,
-- 
1.7.11.7


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

* Re: [PATCH 0/3] mmc: add more device ids
  2013-04-26  8:27 [PATCH 0/3] mmc: add more device ids Adrian Hunter
                   ` (2 preceding siblings ...)
  2013-04-26  8:27 ` [PATCH 3/3] mmc: sdhci-pci: " Adrian Hunter
@ 2013-05-26 17:51 ` Chris Ball
  3 siblings, 0 replies; 5+ messages in thread
From: Chris Ball @ 2013-05-26 17:51 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-mmc

Hi Adrian,

On Fri, Apr 26 2013, Adrian Hunter wrote:
> Here is a minor fix and some more device ids for sdhci-acpi and sdhci-pci.
>
> Please queue for 3.10 if possible.
>
> Adrian Hunter (3):
>       mmc: sdhci-acpi: fix initial runtime pm status
>       mmc: sdhci-acpi: add more device ids
>       mmc: sdhci-pci: add more device ids
>
>  drivers/mmc/host/sdhci-acpi.c | 69 +++++++++++++++++++++++++++++++++++++------
>  drivers/mmc/host/sdhci-pci.c  | 54 +++++++++++++++++++++++++++++++++
>  2 files changed, 114 insertions(+), 9 deletions(-)

Thanks, pushed to mmc-next for 3.10.

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

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

end of thread, other threads:[~2013-05-26 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26  8:27 [PATCH 0/3] mmc: add more device ids Adrian Hunter
2013-04-26  8:27 ` [PATCH 1/3] mmc: sdhci-acpi: fix initial runtime pm status Adrian Hunter
2013-04-26  8:27 ` [PATCH 2/3] mmc: sdhci-acpi: add more device ids Adrian Hunter
2013-04-26  8:27 ` [PATCH 3/3] mmc: sdhci-pci: " Adrian Hunter
2013-05-26 17:51 ` [PATCH 0/3] mmc: " Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.