diff options
| author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-08-08 06:38:32 -0400 |
|---|---|---|
| committer | Chris Ball <cjb@laptop.org> | 2013-08-24 23:45:22 -0400 |
| commit | bf287a90ceedf86e3313ba0dcff606ac5399b39a (patch) | |
| tree | a3337495e68fde2270c406574774a283c0b4e002 /include/linux/spi | |
| parent | 214fc309d1387e822d606a33a10e31cacfe83520 (diff) | |
mmc: mmc_spi: Support CD/RO GPIOs
Add support for passing CD/RO GPIO numbers directly to the mmc_spi
driver instead of relying solely on board code callbacks to retrieve the
CD/RO signals values. The driver will enable debouncing on the card
detect GPIO if the cd_debounce field is set to a non-zero value.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/spi')
| -rw-r--r-- | include/linux/spi/mmc_spi.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/spi/mmc_spi.h b/include/linux/spi/mmc_spi.h index 32be8dbdf191..87cdb35bedda 100644 --- a/include/linux/spi/mmc_spi.h +++ b/include/linux/spi/mmc_spi.h | |||
| @@ -7,6 +7,11 @@ | |||
| 7 | struct device; | 7 | struct device; |
| 8 | struct mmc_host; | 8 | struct mmc_host; |
| 9 | 9 | ||
| 10 | #define MMC_SPI_USE_CD_GPIO (1 << 0) | ||
| 11 | #define MMC_SPI_USE_RO_GPIO (1 << 1) | ||
| 12 | #define MMC_SPI_CD_GPIO_ACTIVE_LOW (1 << 2) | ||
| 13 | #define MMC_SPI_RO_GPIO_ACTIVE_LOW (1 << 3) | ||
| 14 | |||
| 10 | /* Put this in platform_data of a device being used to manage an MMC/SD | 15 | /* Put this in platform_data of a device being used to manage an MMC/SD |
| 11 | * card slot. (Modeled after PXA mmc glue; see that for usage examples.) | 16 | * card slot. (Modeled after PXA mmc glue; see that for usage examples.) |
| 12 | * | 17 | * |
| @@ -30,8 +35,19 @@ struct mmc_spi_platform_data { | |||
| 30 | */ | 35 | */ |
| 31 | int (*get_cd)(struct device *); | 36 | int (*get_cd)(struct device *); |
| 32 | 37 | ||
| 38 | /* | ||
| 39 | * Card Detect and Read Only GPIOs. To enable debouncing on the card | ||
| 40 | * detect GPIO, set the cd_debounce to the debounce time in | ||
| 41 | * microseconds. | ||
| 42 | */ | ||
| 43 | unsigned int flags; | ||
| 44 | unsigned int cd_gpio; | ||
| 45 | unsigned int cd_debounce; | ||
| 46 | unsigned int ro_gpio; | ||
| 47 | |||
| 33 | /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */ | 48 | /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */ |
| 34 | unsigned long caps; | 49 | unsigned long caps; |
| 50 | unsigned long caps2; | ||
| 35 | 51 | ||
| 36 | /* how long to debounce card detect, in msecs */ | 52 | /* how long to debounce card detect, in msecs */ |
| 37 | u16 detect_delay; | 53 | u16 detect_delay; |
