* Re: [Question] What does SDHCI_QUIRK_BROKEN_CARD_DETECTION stands for? [not found] ` <87r4k17toq.fsf@octavius.laptop.org> @ 2013-02-27 14:33 ` Kevin Liu 2013-02-27 14:36 ` Chris Ball 0 siblings, 1 reply; 3+ messages in thread From: Kevin Liu @ 2013-02-27 14:33 UTC (permalink / raw) To: Chris Ball; +Cc: linux-mmc 2013/2/27 Chris Ball <cjb@laptop.org>: > Hi, > > The CC: list seems excessively long here. > > On Wed, Feb 27 2013, Kevin Liu wrote: >> Who can help to answer below question? >> Which statement is true if quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION is selected? >> 1. The host controller Present State Register[18] (offset 0x24) can >> reflect card status (present or not) but can't trigger interrupt when >> card insert/remove. >> 2. The host controller Present State Register[18] can't reflect card >> status at all and can't trigger card insert/remove interrupt either. >> But have other way out of host controller to detect card like slot >> gpio. >> 3. The host controller Present State Register[18] can't reflect card >> status at all, can't trigger card insert/remove interrupt, and don't >> have the other ways to detect card like slot gpio. So have to use >> polling to know card present status. > > (3) > > The best documentation for this is probably the DT bindings file: > > Card detection: > If no property below is supplied, host native card detect is used. > Only one of the properties in this section should be supplied: > - broken-cd: There is no card detection available; polling must be used. > - cd-gpios: Specify GPIOs for card detection, see gpio binding > - non-removable: non-removable slot (like eMMC); assume always present. > > (SDHCI_QUIRK_BROKEN_CARD_DETECTION maps to broken-cd) > Chris, Thanks for quick answer! Then if broken-cd/SDHCI_QUIRK_BROKEN_CARD_DETECTION is selected, can I use host controller Present State Register[18] (offset 0x24) to know card status (present or not)? Kevin > - Chris. > -- > Chris Ball <cjb@laptop.org> <http://printf.net/> > One Laptop Per Child ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Question] What does SDHCI_QUIRK_BROKEN_CARD_DETECTION stands for? 2013-02-27 14:33 ` [Question] What does SDHCI_QUIRK_BROKEN_CARD_DETECTION stands for? Kevin Liu @ 2013-02-27 14:36 ` Chris Ball 2013-02-27 14:58 ` Kevin Liu 0 siblings, 1 reply; 3+ messages in thread From: Chris Ball @ 2013-02-27 14:36 UTC (permalink / raw) To: Kevin Liu; +Cc: linux-mmc Hi, On Wed, Feb 27 2013, Kevin Liu wrote: > Thanks for quick answer! > Then if broken-cd/SDHCI_QUIRK_BROKEN_CARD_DETECTION is selected, can I > use host controller Present State Register[18] (offset 0x24) to know > card status (present or not)? sdhci.c: present = mmc_gpio_get_cd(host->mmc); if (present < 0) { /* If polling, assume that the card is always present. */ if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) present = 1; else present = sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT; } - Chris. -- Chris Ball <cjb@laptop.org> <http://printf.net/> One Laptop Per Child ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Question] What does SDHCI_QUIRK_BROKEN_CARD_DETECTION stands for? 2013-02-27 14:36 ` Chris Ball @ 2013-02-27 14:58 ` Kevin Liu 0 siblings, 0 replies; 3+ messages in thread From: Kevin Liu @ 2013-02-27 14:58 UTC (permalink / raw) To: Chris Ball; +Cc: linux-mmc 2013/2/27 Chris Ball <cjb@laptop.org>: > Hi, > > On Wed, Feb 27 2013, Kevin Liu wrote: >> Thanks for quick answer! >> Then if broken-cd/SDHCI_QUIRK_BROKEN_CARD_DETECTION is selected, can I >> use host controller Present State Register[18] (offset 0x24) to know >> card status (present or not)? > > sdhci.c: > > present = mmc_gpio_get_cd(host->mmc); > if (present < 0) { > /* If polling, assume that the card is always present. */ > if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) > present = 1; > else > present = sdhci_readl(host, SDHCI_PRESENT_STATE) & > SDHCI_CARD_PRESENT; > } > I just want to confirm this code:) Then when SDHCI_QUIRK_BROKEN_CARD_DETECTION is selected, read register SDHCI_PRESENT_STATE is _not_ reliable. I'm clear now. Thanks Kevin ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-27 14:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CADz5_gKreSB9BvTgBBcjjOOEDMRc2q1s-9VNHfb_+x+9gdADLw@mail.gmail.com>
[not found] ` <87r4k17toq.fsf@octavius.laptop.org>
2013-02-27 14:33 ` [Question] What does SDHCI_QUIRK_BROKEN_CARD_DETECTION stands for? Kevin Liu
2013-02-27 14:36 ` Chris Ball
2013-02-27 14:58 ` Kevin Liu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox