aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorAndreas Fenkart <afenkart@gmail.com>2015-03-20 10:53:54 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2015-03-27 07:19:37 -0400
commitb7a5646fa5d5d319b2b1a3db07f615e40b184205 (patch)
tree07a70f02f9bc0de9441ff098c13618ee19f8b353 /drivers/mmc/host
parent40433267331bc6b9d70d5cdd14bfa2c8e3e5f0ec (diff)
ARM: OMAP2: HSMMC: explicit fields to declare cover/card detect pin
board-rx51 has no card detect pin in the mmc slot, but can detect that the (cell-phone) cover has been removed and the card is accessible. The semantics between cover/card detect differ, the gpio on the slot informs you after the card has been removed, cover removal does not necessarily mean that the card has been removed. This means different code paths are necessary. To complete this we also want different fields in the platform data for cover and card detect. This separation is not pushed all the way down into struct omap2_hsmmc_info which is used to initialize the platform data. If we did that we had to go over all board files and set the new gpio_cod pin to -EINVAL. If we forget one board or some out-of-tree archicture forgets that the default '0' is used which is a valid pin number. Signed-off-by: Andreas Fenkart <afenkart@gmail.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 833143f81451..08d537797b13 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -427,15 +427,15 @@ static int omap_hsmmc_gpio_init(struct mmc_host *mmc,
427{ 427{
428 int ret; 428 int ret;
429 429
430 if (pdata->cover && gpio_is_valid(pdata->switch_pin)) { 430 if (gpio_is_valid(pdata->gpio_cod)) {
431 ret = mmc_gpio_request_cd(mmc, pdata->switch_pin, 0); 431 ret = mmc_gpio_request_cd(mmc, pdata->gpio_cod, 0);
432 if (ret) 432 if (ret)
433 return ret; 433 return ret;
434 434
435 host->get_cover_state = omap_hsmmc_get_cover_state; 435 host->get_cover_state = omap_hsmmc_get_cover_state;
436 mmc_gpio_set_cd_isr(mmc, omap_hsmmc_cover_irq); 436 mmc_gpio_set_cd_isr(mmc, omap_hsmmc_cover_irq);
437 } else if (!pdata->cover && gpio_is_valid(pdata->switch_pin)) { 437 } else if (gpio_is_valid(pdata->gpio_cd)) {
438 ret = mmc_gpio_request_cd(mmc, pdata->switch_pin, 0); 438 ret = mmc_gpio_request_cd(mmc, pdata->gpio_cd, 0);
439 if (ret) 439 if (ret)
440 return ret; 440 return ret;
441 441
@@ -1920,7 +1920,8 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
1920 if (of_find_property(np, "ti,dual-volt", NULL)) 1920 if (of_find_property(np, "ti,dual-volt", NULL))
1921 pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT; 1921 pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;
1922 1922
1923 pdata->switch_pin = -EINVAL; 1923 pdata->gpio_cd = -EINVAL;
1924 pdata->gpio_cod = -EINVAL;
1924 pdata->gpio_wp = -EINVAL; 1925 pdata->gpio_wp = -EINVAL;
1925 1926
1926 if (of_find_property(np, "ti,non-removable", NULL)) { 1927 if (of_find_property(np, "ti,non-removable", NULL)) {