* [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot()
@ 2016-08-29 9:33 Andy Shevchenko
2016-08-29 9:33 ` [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield Andy Shevchenko
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Andy Shevchenko @ 2016-08-29 9:33 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc, Adrian Hunter; +Cc: Andy Shevchenko
Refactor intel_mrfld_mmc_probe_slot() to use switch case. The change allows to
add a support for SD and SDIO interfaces without any pain.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mmc/host/sdhci-pci-core.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 93bb0ff..40f4fe8 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -422,14 +422,19 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
{
- if ((PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_0) &&
- (PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_1))
+ unsigned int func = PCI_FUNC(slot->chip->pdev->devfn);
+
+ switch (func) {
+ case INTEL_MRFLD_EMMC_0:
+ case INTEL_MRFLD_EMMC_1:
+ slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
+ MMC_CAP_8_BIT_DATA |
+ MMC_CAP_1_8V_DDR;
+ break;
+ default:
/* SD support is not ready yet */
return -ENODEV;
-
- slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
- MMC_CAP_1_8V_DDR;
-
+ }
return 0;
}
--
2.8.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield
2016-08-29 9:33 [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Andy Shevchenko
@ 2016-08-29 9:33 ` Andy Shevchenko
2016-09-01 13:20 ` Adrian Hunter
2016-09-01 14:18 ` Ulf Hansson
2016-08-29 9:33 ` [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield Andy Shevchenko
` (2 subsequent siblings)
3 siblings, 2 replies; 9+ messages in thread
From: Andy Shevchenko @ 2016-08-29 9:33 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc, Adrian Hunter; +Cc: Andy Shevchenko
Intel Merrifield is known to have an SDIO interface and on Intel Edison board a
WiFi card is wired to it.
Enable the interface here to allow WiFi card enumeration.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mmc/host/sdhci-pci-core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 40f4fe8..d38d701 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -419,6 +419,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
/* Define Host controllers for Intel Merrifield platform */
#define INTEL_MRFLD_EMMC_0 0
#define INTEL_MRFLD_EMMC_1 1
+#define INTEL_MRFLD_SDIO 3
static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
{
@@ -431,6 +432,10 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
MMC_CAP_8_BIT_DATA |
MMC_CAP_1_8V_DDR;
break;
+ case INTEL_MRFLD_SDIO:
+ slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
+ MMC_CAP_POWER_OFF_CARD;
+ break;
default:
/* SD support is not ready yet */
return -ENODEV;
--
2.8.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield
2016-08-29 9:33 [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Andy Shevchenko
2016-08-29 9:33 ` [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield Andy Shevchenko
@ 2016-08-29 9:33 ` Andy Shevchenko
2016-09-01 13:21 ` Adrian Hunter
2016-09-01 14:18 ` Ulf Hansson
2016-09-01 13:20 ` [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Adrian Hunter
2016-09-01 14:17 ` Ulf Hansson
3 siblings, 2 replies; 9+ messages in thread
From: Andy Shevchenko @ 2016-08-29 9:33 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc, Adrian Hunter; +Cc: Andy Shevchenko
Intel Merrifield provides an interface to an external SD card.
Enable it here.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mmc/host/sdhci-pci-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index d38d701..3833c5f 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -419,6 +419,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
/* Define Host controllers for Intel Merrifield platform */
#define INTEL_MRFLD_EMMC_0 0
#define INTEL_MRFLD_EMMC_1 1
+#define INTEL_MRFLD_SD 2
#define INTEL_MRFLD_SDIO 3
static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
@@ -432,12 +433,14 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
MMC_CAP_8_BIT_DATA |
MMC_CAP_1_8V_DDR;
break;
+ case INTEL_MRFLD_SD:
+ slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
+ break;
case INTEL_MRFLD_SDIO:
slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
MMC_CAP_POWER_OFF_CARD;
break;
default:
- /* SD support is not ready yet */
return -ENODEV;
}
return 0;
--
2.8.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot()
2016-08-29 9:33 [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Andy Shevchenko
2016-08-29 9:33 ` [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield Andy Shevchenko
2016-08-29 9:33 ` [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield Andy Shevchenko
@ 2016-09-01 13:20 ` Adrian Hunter
2016-09-01 14:17 ` Ulf Hansson
3 siblings, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2016-09-01 13:20 UTC (permalink / raw)
To: Andy Shevchenko, Ulf Hansson, linux-mmc
On 29/08/16 12:33, Andy Shevchenko wrote:
> Refactor intel_mrfld_mmc_probe_slot() to use switch case. The change allows to
> add a support for SD and SDIO interfaces without any pain.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-pci-core.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 93bb0ff..40f4fe8 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -422,14 +422,19 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
>
> static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> {
> - if ((PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_0) &&
> - (PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_1))
> + unsigned int func = PCI_FUNC(slot->chip->pdev->devfn);
> +
> + switch (func) {
> + case INTEL_MRFLD_EMMC_0:
> + case INTEL_MRFLD_EMMC_1:
> + slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
> + MMC_CAP_8_BIT_DATA |
> + MMC_CAP_1_8V_DDR;
> + break;
> + default:
> /* SD support is not ready yet */
> return -ENODEV;
> -
> - slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
> - MMC_CAP_1_8V_DDR;
> -
> + }
> return 0;
> }
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield
2016-08-29 9:33 ` [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield Andy Shevchenko
@ 2016-09-01 13:20 ` Adrian Hunter
2016-09-01 14:18 ` Ulf Hansson
1 sibling, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2016-09-01 13:20 UTC (permalink / raw)
To: Andy Shevchenko, Ulf Hansson, linux-mmc
On 29/08/16 12:33, Andy Shevchenko wrote:
> Intel Merrifield is known to have an SDIO interface and on Intel Edison board a
> WiFi card is wired to it.
>
> Enable the interface here to allow WiFi card enumeration.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-pci-core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 40f4fe8..d38d701 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -419,6 +419,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
> /* Define Host controllers for Intel Merrifield platform */
> #define INTEL_MRFLD_EMMC_0 0
> #define INTEL_MRFLD_EMMC_1 1
> +#define INTEL_MRFLD_SDIO 3
>
> static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> {
> @@ -431,6 +432,10 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> MMC_CAP_8_BIT_DATA |
> MMC_CAP_1_8V_DDR;
> break;
> + case INTEL_MRFLD_SDIO:
> + slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
> + MMC_CAP_POWER_OFF_CARD;
> + break;
> default:
> /* SD support is not ready yet */
> return -ENODEV;
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield
2016-08-29 9:33 ` [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield Andy Shevchenko
@ 2016-09-01 13:21 ` Adrian Hunter
2016-09-01 14:18 ` Ulf Hansson
1 sibling, 0 replies; 9+ messages in thread
From: Adrian Hunter @ 2016-09-01 13:21 UTC (permalink / raw)
To: Andy Shevchenko, Ulf Hansson, linux-mmc
On 29/08/16 12:33, Andy Shevchenko wrote:
> Intel Merrifield provides an interface to an external SD card.
> Enable it here.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-pci-core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index d38d701..3833c5f 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -419,6 +419,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
> /* Define Host controllers for Intel Merrifield platform */
> #define INTEL_MRFLD_EMMC_0 0
> #define INTEL_MRFLD_EMMC_1 1
> +#define INTEL_MRFLD_SD 2
> #define INTEL_MRFLD_SDIO 3
>
> static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> @@ -432,12 +433,14 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> MMC_CAP_8_BIT_DATA |
> MMC_CAP_1_8V_DDR;
> break;
> + case INTEL_MRFLD_SD:
> + slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
> + break;
> case INTEL_MRFLD_SDIO:
> slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
> MMC_CAP_POWER_OFF_CARD;
> break;
> default:
> - /* SD support is not ready yet */
> return -ENODEV;
> }
> return 0;
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot()
2016-08-29 9:33 [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Andy Shevchenko
` (2 preceding siblings ...)
2016-09-01 13:20 ` [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Adrian Hunter
@ 2016-09-01 14:17 ` Ulf Hansson
3 siblings, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2016-09-01 14:17 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-mmc, Adrian Hunter
On 29 August 2016 at 11:33, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Refactor intel_mrfld_mmc_probe_slot() to use switch case. The change allows to
> add a support for SD and SDIO interfaces without any pain.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/host/sdhci-pci-core.c | 17 +++++++++++------
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 93bb0ff..40f4fe8 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -422,14 +422,19 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
>
> static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> {
> - if ((PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_0) &&
> - (PCI_FUNC(slot->chip->pdev->devfn) != INTEL_MRFLD_EMMC_1))
> + unsigned int func = PCI_FUNC(slot->chip->pdev->devfn);
> +
> + switch (func) {
> + case INTEL_MRFLD_EMMC_0:
> + case INTEL_MRFLD_EMMC_1:
> + slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
> + MMC_CAP_8_BIT_DATA |
> + MMC_CAP_1_8V_DDR;
> + break;
> + default:
> /* SD support is not ready yet */
> return -ENODEV;
> -
> - slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
> - MMC_CAP_1_8V_DDR;
> -
> + }
> return 0;
> }
>
> --
> 2.8.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield
2016-08-29 9:33 ` [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield Andy Shevchenko
2016-09-01 13:20 ` Adrian Hunter
@ 2016-09-01 14:18 ` Ulf Hansson
1 sibling, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2016-09-01 14:18 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-mmc, Adrian Hunter
On 29 August 2016 at 11:33, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Intel Merrifield is known to have an SDIO interface and on Intel Edison board a
> WiFi card is wired to it.
>
> Enable the interface here to allow WiFi card enumeration.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/host/sdhci-pci-core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index 40f4fe8..d38d701 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -419,6 +419,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
> /* Define Host controllers for Intel Merrifield platform */
> #define INTEL_MRFLD_EMMC_0 0
> #define INTEL_MRFLD_EMMC_1 1
> +#define INTEL_MRFLD_SDIO 3
>
> static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> {
> @@ -431,6 +432,10 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> MMC_CAP_8_BIT_DATA |
> MMC_CAP_1_8V_DDR;
> break;
> + case INTEL_MRFLD_SDIO:
> + slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
> + MMC_CAP_POWER_OFF_CARD;
> + break;
> default:
> /* SD support is not ready yet */
> return -ENODEV;
> --
> 2.8.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield
2016-08-29 9:33 ` [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield Andy Shevchenko
2016-09-01 13:21 ` Adrian Hunter
@ 2016-09-01 14:18 ` Ulf Hansson
1 sibling, 0 replies; 9+ messages in thread
From: Ulf Hansson @ 2016-09-01 14:18 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-mmc, Adrian Hunter
On 29 August 2016 at 11:33, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> Intel Merrifield provides an interface to an external SD card.
> Enable it here.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/host/sdhci-pci-core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index d38d701..3833c5f 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -419,6 +419,7 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
> /* Define Host controllers for Intel Merrifield platform */
> #define INTEL_MRFLD_EMMC_0 0
> #define INTEL_MRFLD_EMMC_1 1
> +#define INTEL_MRFLD_SD 2
> #define INTEL_MRFLD_SDIO 3
>
> static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> @@ -432,12 +433,14 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
> MMC_CAP_8_BIT_DATA |
> MMC_CAP_1_8V_DDR;
> break;
> + case INTEL_MRFLD_SD:
> + slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
> + break;
> case INTEL_MRFLD_SDIO:
> slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE |
> MMC_CAP_POWER_OFF_CARD;
> break;
> default:
> - /* SD support is not ready yet */
> return -ENODEV;
> }
> return 0;
> --
> 2.8.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-09-01 14:25 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-29 9:33 [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Andy Shevchenko
2016-08-29 9:33 ` [PATCH v1 2/3] sdhci-pci: enable SDIO interface on Intel Merrifield Andy Shevchenko
2016-09-01 13:20 ` Adrian Hunter
2016-09-01 14:18 ` Ulf Hansson
2016-08-29 9:33 ` [PATCH v1 3/3] sdhci-pci: enable SD card interface on Merrifield Andy Shevchenko
2016-09-01 13:21 ` Adrian Hunter
2016-09-01 14:18 ` Ulf Hansson
2016-09-01 13:20 ` [PATCH v1 1/3] sdhci-pci: refactor intel_mrfld_mmc_probe_slot() Adrian Hunter
2016-09-01 14:17 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).