summaryrefslogtreecommitdiff
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorSujit Reddy Thumma <sthumma@codeaurora.org>2013-06-03 09:54:32 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-27 10:28:40 -0700
commitb7fc1448ada0b061f94ccc341a54a44085e254c5 (patch)
tree7da6886980f8b9c04ec21ea529c08b811d2b03d5 /drivers/mmc/host
parent165bd22b550bdf0353299045c562fd675bc4a8b7 (diff)
mmc: sdhci-msm: Initialize card-detect polarity
Enable MMC_CAP2_CD_ACTIVE_HIGH capability if the card-detect gpio polarity is active high. Change-Id: I80e869dd7ecb6e24e81d1cc73ef8101c44110873 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/sdhci-msm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 572f14676170..d36221fb30fa 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1090,6 +1090,7 @@ static struct sdhci_msm_pltfm_data *sdhci_msm_populate_pdata(struct device *dev)
int len, i;
int clk_table_len;
u32 *clk_table = NULL;
+ enum of_gpio_flags flags = OF_GPIO_ACTIVE_LOW;
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
@@ -1097,7 +1098,9 @@ static struct sdhci_msm_pltfm_data *sdhci_msm_populate_pdata(struct device *dev)
goto out;
}
- pdata->status_gpio = of_get_named_gpio_flags(np, "cd-gpios", 0, 0);
+ pdata->status_gpio = of_get_named_gpio_flags(np, "cd-gpios", 0, &flags);
+ if (gpio_is_valid(pdata->status_gpio) & !(flags & OF_GPIO_ACTIVE_LOW))
+ pdata->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
of_property_read_u32(np, "qcom,bus-width", &bus_width);
if (bus_width == 8)