]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add support for non-removable media, and a quirk to use polling to detect
authorian <ian@FreeBSD.org>
Mon, 9 Jan 2017 01:15:18 +0000 (01:15 +0000)
committerian <ian@FreeBSD.org>
Mon, 9 Jan 2017 01:15:18 +0000 (01:15 +0000)
commit5f2606cc8e0a734ec919d111f2f632e109e769ad
treee18b603860bae0abfc4d0a72b1f9d98bf2e4abde
parent9e0a154b0fd5fa9010238ac9497ec59f84167c92
Add support for non-removable media, and a quirk to use polling to detect
card insert/remove events on controllers that don't implement the insert
and remove interrupts.

Bridge drivers can set a new slot option, SDHCI_NON_REMOVABLE, to indicate
non-removable media (such as eMMC).  The sdhci driver will not enable
insert/remove interrupts, and sdhci_generic_get_card_present() will always
return true.

Bridge drivers can set a new quirk, SDHCI_QUIRK_POLL_CARD_PRESENT, and the
sdhci driver will not enable insert/remove interrupts, and instead will use
a callout to poll the card-present status at 5 Hz.

For bridge drivers that get notified of card insert/remove via gpio
interrupts, there is a new sdhci_handle_card_present() function they can
call from the gpio interrupt handler to inform the sdhci code of the event.

In addition to adding these new features, the existing code to debounce card
insertions was updated to use taskqueue_enqueue_timeout() instead of
scheduling a callout to do the taskqueue_enqueue().  There is also now a
comment explaining that insertion-debounce is what's going on -- it took me
a long time to realize that's what the old sdhci_card_delay() routine was
really doing.  There is no functional difference between the old and new
debounce code (I hope!).
sys/dev/sdhci/sdhci.c
sys/dev/sdhci/sdhci.h