From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Eric Biggers <ebiggers@google.com>,
Raul E Rangel <rrangel@chromium.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org
Subject: [PATCH v1 2/6] mmc: sdhci-pci: Read card detect from ACPI for Intel Merrifield
Date: Tue, 5 Oct 2021 13:24:26 +0300 [thread overview]
Message-ID: <20211005102430.63716-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20211005102430.63716-1-andriy.shevchenko@linux.intel.com>
Intel Merrifield platform had been converted to use ACPI enumeration.
However, the driver missed an update to retrieve card detect GPIO.
Fix it here.
Unfortunately we can't rely on CD GPIO state because there are two
different PCB designs in the wild that are using an opposite card
detection sense and there is no way to distinguish those platforms,
that's why ignore CD GPIO completely and use it only as an card plug
or unplug event.
Fixes: 4590d98f5a4f ("sfi: Remove framework for deprecated firmware")
BugLink: https://github.com/edison-fw/meta-intel-edison/issues/135
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mmc/host/sdhci-pci-core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index be19785227fe..70ab0a7a3de8 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -1341,6 +1341,14 @@ static int intel_mrfld_mmc_probe_slot(struct sdhci_pci_slot *slot)
MMC_CAP_1_8V_DDR;
break;
case INTEL_MRFLD_SD:
+ slot->cd_idx = 0;
+ /*
+ * There are two PCB designs of SD card slot with the opposite
+ * card detection sense. Quirk this out by ignoring GPIO state
+ * completely.
+ */
+ slot->host->quirks2 |= SDHCI_QUIRK_CARD_DETECTION_IF_GPIO_LOW |
+ SDHCI_QUIRK_CARD_DETECTION_IF_GPIO_HIGH;
slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
break;
case INTEL_MRFLD_SDIO:
--
2.33.0
next prev parent reply other threads:[~2021-10-05 10:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 10:24 [PATCH v1 0/6] mmc: sdhci-pci: Add some CD GPIO related quirks Andy Shevchenko
2021-10-05 10:24 ` [PATCH v1 1/6] mmc: sdhci: Introduce couple of quirks to ignore particular state of CD GPIO Andy Shevchenko
2021-10-08 9:38 ` Adrian Hunter
2021-10-05 10:24 ` Andy Shevchenko [this message]
2021-10-05 10:24 ` [PATCH v1 3/6] mmc: sdhci: Replace bxt_get_cd() with SDHCI_QUIRK_CARD_DETECTION_IF_GPIO_HIGH Andy Shevchenko
2021-10-05 10:24 ` [PATCH v1 4/6] mmc: sdhci-pci: Remove dead code (struct sdhci_pci_data et al) Andy Shevchenko
2021-10-08 9:42 ` Adrian Hunter
2021-10-05 10:24 ` [PATCH v1 5/6] mmc: sdhci-pci: Remove dead code (cd_gpio, cd_irq " Andy Shevchenko
2021-10-08 9:45 ` Adrian Hunter
2021-10-05 10:24 ` [PATCH v1 6/6] mmc: sdhci-pci: Remove dead code (rst_n_gpio " Andy Shevchenko
2021-10-08 9:45 ` Adrian Hunter
2021-10-07 16:42 ` [PATCH v1 0/6] mmc: sdhci-pci: Add some CD GPIO related quirks Andy Shevchenko
2021-10-07 18:03 ` Adrian Hunter
2021-10-12 20:37 ` Andy Shevchenko
2021-10-07 21:39 ` Raul Rangel
2021-10-12 20:41 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211005102430.63716-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=adrian.hunter@intel.com \
--cc=ebiggers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=rrangel@chromium.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox