From 81b794fbc49fd9aef6cc0bfebd4ac899c836d270 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Mon, 23 Mar 2009 18:23:48 -0700 Subject: [PATCH] --- yaml --- r: 137496 b: refs/heads/master c: 8d75e98b5880f8f02be68ddc3cc4e3d433630d7b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-omap2/mmc-twl4030.c | 13 ++++++++++++- trunk/arch/arm/mach-omap2/mmc-twl4030.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 15f91d9f3464..54ef5f15f846 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 034ae7b41720a26cadd4b2f02bf0b23e79240344 +refs/heads/master: 8d75e98b5880f8f02be68ddc3cc4e3d433630d7b diff --git a/trunk/arch/arm/mach-omap2/mmc-twl4030.c b/trunk/arch/arm/mach-omap2/mmc-twl4030.c index d43421400e9d..e2b2aeb713d8 100644 --- a/trunk/arch/arm/mach-omap2/mmc-twl4030.c +++ b/trunk/arch/arm/mach-omap2/mmc-twl4030.c @@ -100,6 +100,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot) return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); } +static int twl_mmc_get_cover_state(struct device *dev, int slot) +{ + struct omap_mmc_platform_data *mmc = dev->platform_data; + + /* NOTE: assumes card detect signal is active-low */ + return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); +} + /* * MMC Slot Initialization. */ @@ -411,7 +419,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) mmc->slots[0].switch_pin = c->gpio_cd; mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd); - mmc->slots[0].card_detect = twl_mmc_card_detect; + if (c->cover_only) + mmc->slots[0].get_cover_state = twl_mmc_get_cover_state; + else + mmc->slots[0].card_detect = twl_mmc_card_detect; } else mmc->slots[0].switch_pin = -EINVAL; diff --git a/trunk/arch/arm/mach-omap2/mmc-twl4030.h b/trunk/arch/arm/mach-omap2/mmc-twl4030.h index 21d35727f921..0aa168690ed0 100644 --- a/trunk/arch/arm/mach-omap2/mmc-twl4030.h +++ b/trunk/arch/arm/mach-omap2/mmc-twl4030.h @@ -11,6 +11,7 @@ struct twl4030_hsmmc_info { u8 wires; /* 1/4/8 wires */ bool transceiver; /* MMC-2 option */ bool ext_clock; /* use external pin for input clock */ + bool cover_only; /* No card detect - just cover switch */ int gpio_cd; /* or -EINVAL */ int gpio_wp; /* or -EINVAL */ struct device *dev; /* returned: pointer to mmc adapter */