aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.h
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2010-08-10 21:01:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:05 -0400
commit17866e14f3a4f219e94f1374ece7226479418ff8 (patch)
tree4e1a618f9dbcdc982bac4289eec30a87c764c33c /drivers/mmc/host/sdhci.h
parenta1d5646005af1247d6ae78434bb4db15b07a07b2 (diff)
sdhci-s3c: add support for new card detection methods
On some Samsung SoCs not all SDHCI controllers have card detect (CD) line. For some embedded designs it is not even needed, because ususally the device (like SDIO flash memory or wifi controller) is permanently wired to the controller. There are also systems which have a card detect line connected to some of the external interrupt lines or the presence of the card depends on some other actions (like enabling a power regulator). This patch adds support for all these cases. The following card detection methods are possible: 1. internal sdhci host card detect line 2. external event 3. external gpio interrupt 4. no card detect line, controller will poll for the card 5. no card detect line, card is permanently wired to the controller (once detected host won't poll it any more) By default, all existing code would use method #1, what is compatible with the previous version of the driver. In case of external event, two callbacks must be provided in platdata: ext_cd_init and ext_cd_cleanup. Both of them get a callback to a function that notifies the s3c-sdhci host contoller as their argument. That callback function should be called from the even dispatcher to let host notice the card insertion/removal. In case of external gpio interrupt, a gpio pin number must be provided in platdata (ext_cd_gpio parameter), as well as the information about the polarity of that gpio pin (ext_cd_gpio_invert). By default (ext_cd_gpio_invert == 0) gpio value 0 means 'card has been removed', but this can be changed to 'card has been removed' when ext_cd_gpio_invert == 1. This patch adds all required changes to sdhci-s3c driver. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.h')
-rw-r--r--drivers/mmc/host/sdhci.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 030de492880e..c98315c197ed 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -412,6 +412,7 @@ static inline void *sdhci_priv(struct sdhci_host *host)
412 return (void *)host->private; 412 return (void *)host->private;
413} 413}
414 414
415extern void sdhci_card_detect(struct sdhci_host *host);
415extern int sdhci_add_host(struct sdhci_host *host); 416extern int sdhci_add_host(struct sdhci_host *host);
416extern void sdhci_remove_host(struct sdhci_host *host, int dead); 417extern void sdhci_remove_host(struct sdhci_host *host, int dead);
417 418