aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c13
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c
index d43421400e9..e2b2aeb713d 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.c
+++ b/arch/arm/mach-omap2/mmc-twl4030.c
@@ -100,6 +100,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot)
100 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); 100 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
101} 101}
102 102
103static int twl_mmc_get_cover_state(struct device *dev, int slot)
104{
105 struct omap_mmc_platform_data *mmc = dev->platform_data;
106
107 /* NOTE: assumes card detect signal is active-low */
108 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
109}
110
103/* 111/*
104 * MMC Slot Initialization. 112 * MMC Slot Initialization.
105 */ 113 */
@@ -411,7 +419,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers)
411 419
412 mmc->slots[0].switch_pin = c->gpio_cd; 420 mmc->slots[0].switch_pin = c->gpio_cd;
413 mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd); 421 mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd);
414 mmc->slots[0].card_detect = twl_mmc_card_detect; 422 if (c->cover_only)
423 mmc->slots[0].get_cover_state = twl_mmc_get_cover_state;
424 else
425 mmc->slots[0].card_detect = twl_mmc_card_detect;
415 } else 426 } else
416 mmc->slots[0].switch_pin = -EINVAL; 427 mmc->slots[0].switch_pin = -EINVAL;
417 428
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h
index 21d35727f92..0aa168690ed 100644
--- a/arch/arm/mach-omap2/mmc-twl4030.h
+++ b/arch/arm/mach-omap2/mmc-twl4030.h
@@ -11,6 +11,7 @@ struct twl4030_hsmmc_info {
11 u8 wires; /* 1/4/8 wires */ 11 u8 wires; /* 1/4/8 wires */
12 bool transceiver; /* MMC-2 option */ 12 bool transceiver; /* MMC-2 option */
13 bool ext_clock; /* use external pin for input clock */ 13 bool ext_clock; /* use external pin for input clock */
14 bool cover_only; /* No card detect - just cover switch */
14 int gpio_cd; /* or -EINVAL */ 15 int gpio_cd; /* or -EINVAL */
15 int gpio_wp; /* or -EINVAL */ 16 int gpio_wp; /* or -EINVAL */
16 struct device *dev; /* returned: pointer to mmc adapter */ 17 struct device *dev; /* returned: pointer to mmc adapter */