linux/drivers/mmc/host
Marek Szyprowski 17866e14f3 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>
2010-08-11 08:59:05 -07:00
..
at91_mci.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
atmel-mci-regs.h atmel-mci: add MCI2 register definitions 2009-06-13 22:43:01 +02:00
atmel-mci.c mmc: atmel-mci: Add support for SDIO interrupts 2010-05-27 09:12:39 -07:00
au1xmmc.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
bfin_sdh.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
cb710-mmc.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
cb710-mmc.h mmc: Driver for CB710/720 memory card reader (MMC part) 2009-06-13 22:42:58 +02:00
davinci_mmc.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
imxmmc.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
imxmmc.h imxmmc: use readl/writel 2008-12-16 14:58:17 +01:00
jz4740_mmc.c MMC: Add support for the controller on JZ4740 SoCs. 2010-08-05 13:26:18 +01:00
Kconfig sdhci-pltfm: add support for CNS3xxx SoC devices 2010-08-11 08:59:03 -07:00
Makefile sdhci-pltfm: add support for CNS3xxx SoC devices 2010-08-11 08:59:03 -07:00
mmc_spi.c of: refactor of_modalias_node() and remove explicit match table. 2010-07-05 16:14:52 -06:00
mmci.c Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-08-03 14:31:24 -07:00
mmci.h ARM: 6245/1: mmci: enable hardware flow control on Ux500 variants 2010-07-29 15:40:32 +01:00
msm_sdcc.c drivers/mmc/host/msm-sdcc: remove dead config options 2010-08-11 08:59:04 -07:00
msm_sdcc.h drivers/mmc/host/msm-sdcc: remove dead config options 2010-08-11 08:59:04 -07:00
mvsdio.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
mvsdio.h mmc: SDIO driver for Marvell SoCs 2009-03-24 21:30:03 +01:00
mxcmmc.c mxcmmc: convert to pm_ops and enable/disable clock 2010-07-26 14:29:21 +02:00
of_mmc_spi.c of: Always use 'struct device.of_node' to get device node pointer. 2010-05-18 16:10:44 -06:00
omap_hsmmc.c omap hsmmc: fix processing of all dma interrupts as block completion 2010-08-11 08:59:04 -07:00
omap.c omap: remove BUG_ON for disabled interrupts 2010-06-04 15:21:45 -07:00
pxamci.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
pxamci.h [ARM] pxa: mmc: add 1st host controller support for pxa3xx 2008-01-26 15:07:53 +00:00
s3cmci.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
s3cmci.h s3cmci: DMA fixes 2009-10-01 16:11:15 -07:00
sdhci-cns3xxx.c sdhci-pltfm: add support for CNS3xxx SoC devices 2010-08-11 08:59:03 -07:00
sdhci-of-core.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
sdhci-of-esdhc.c sdhci: build fix: rename SDHCI I/O accessor functions 2010-05-27 09:12:40 -07:00
sdhci-of-hlwd.c sdhci: build fix: rename SDHCI I/O accessor functions 2010-05-27 09:12:40 -07:00
sdhci-of.h sdhci-of: add support for the wii sdhci controller 2009-12-17 15:45:32 -08:00
sdhci-pci.c mmc: make sdhci work with ricoh mmc controller 2010-08-11 08:59:03 -07:00
sdhci-pltfm.c sdhci-pltfm: add support for CNS3xxx SoC devices 2010-08-11 08:59:03 -07:00
sdhci-pltfm.h sdhci-pltfm: add support for CNS3xxx SoC devices 2010-08-11 08:59:03 -07:00
sdhci-s3c.c sdhci-s3c: add support for new card detection methods 2010-08-11 08:59:05 -07:00
sdhci-spear.c sdhci-spear: ST SPEAr based SDHCI controller glue 2010-05-27 09:12:40 -07:00
sdhci.c sdhci-s3c: add support for the non standard minimal clock value 2010-08-11 08:59:05 -07:00
sdhci.h sdhci-s3c: add support for new card detection methods 2010-08-11 08:59:05 -07:00
sdricoh_cs.c pcmcia: remove cs_types.h 2010-07-30 21:07:39 +02:00
sh_mmcif.c sh: prepare MMCIF driver header file 2010-05-31 13:11:41 +09:00
tifm_sd.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
tmio_mmc.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
tmio_mmc.h mmc: add DMA support to tmio_mmc driver, when used on SuperH 2010-05-22 16:51:18 +09:00
via-sdmmc.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
wbsd.c mmc: remove the "state" argument to mmc_suspend_host() 2010-05-27 09:12:40 -07:00
wbsd.h mmc: update header file paths 2007-07-26 01:53:31 +02:00