aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2016-11-02 00:54:39 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2016-11-02 00:54:39 +0000
commit2b96b955e97636d7d778d3fabb0ac527334c1fa9 (patch)
tree2bfe78b32f257f085e69f2654d6665a8df149f5a /sys/dev
parent3d9df07abf9fb808aa0e4f96a9581330fd336509 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sdhci/sdhci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c
index e625d4f11f32..9ea85adba555 100644
--- a/sys/dev/sdhci/sdhci.c
+++ b/sys/dev/sdhci/sdhci.c
@@ -1309,7 +1309,7 @@ sdhci_acmd_irq(struct sdhci_slot *slot)
void
sdhci_generic_intr(struct sdhci_slot *slot)
{
- uint32_t intmask;
+ uint32_t intmask, present;
SDHCI_LOCK(slot);
/* Read slot interrupt status. */
@@ -1323,6 +1323,13 @@ sdhci_generic_intr(struct sdhci_slot *slot)
/* Handle card presence interrupts. */
if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) {
+ present = RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT;
+ slot->intmask &=
+ ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE);
+ slot->intmask |= present ? SDHCI_INT_CARD_REMOVE :
+ SDHCI_INT_CARD_INSERT;
+ WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
+ WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
WR4(slot, SDHCI_INT_STATUS, intmask &
(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE));