[RFC PATCH 0/21] Totally remove SDHCI_QUIRK_BROKEN_CARD_DETECTION quirk
adrian.hunter at intel.com
Wed Jan 27 04:59:14 PST 2016
On 27/01/16 07:05, Shawn Lin wrote:
> Ulf wants to make sdhci into a library, but it's a huge task
> since any improvemts may touch too much platforms. But at least
> we should make some effort to push things torwards to this target.
> This patchset remove SDHCI_QUIRK_BROKEN_CARD_DETECTION from sdhci
> to gradually reduce quirk of sdhci.
> Firstly, SDHCI_QUIRK_BROKEN_CARD_DETECTION aims at claiming the slot is
> a "broken-cd" one, but "broken-cd" is not a quirk from my view.
> In addition, mmc core stack had already obtain "broken-cd" from dts via
> mmc_of_parse and pass MMC_CAP_NEEDS_POLL to mmc->caps. So we can reuse it
> instead of SDHCI_QUIRK_BROKEN_CARD_DETECTION.
That assumes there is no driver that wants to disable the card detect
interrupts and disable the use of the Present State register, but still use
a Card Detect GPIO and therefore not have MMC_CAP_NEEDS_POLL.
A way forward should provide for drivers do to things like that.
One way is to make selected existing functions into library functions and
provide callbacks for them. In this case do with sdhci_set_card_detection()
what Russell King did with sdhci_reset(). However Ulf is against new callbacks.
I would much prefer the structure for a SDHCI library be put in place, or at
least agreed to, before individual quirks are tackled.
In my view Ulf needs to explain how the SDHCI library is going to work,
particularly in the absence of new callbacks.
More information about the linux-rpi-kernel