aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/atmel-mci.c11
-rw-r--r--include/linux/atmel-mci.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 0b9ddf8aed04..d9646e5ae2c8 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -560,6 +560,9 @@ atmci_of_init(struct platform_device *pdev)
560 pdata->slot[slot_id].detect_is_active_high = 560 pdata->slot[slot_id].detect_is_active_high =
561 of_property_read_bool(cnp, "cd-inverted"); 561 of_property_read_bool(cnp, "cd-inverted");
562 562
563 pdata->slot[slot_id].non_removable =
564 of_property_read_bool(cnp, "non-removable");
565
563 pdata->slot[slot_id].wp_pin = 566 pdata->slot[slot_id].wp_pin =
564 of_get_named_gpio(cnp, "wp-gpios", 0); 567 of_get_named_gpio(cnp, "wp-gpios", 0);
565 } 568 }
@@ -2206,8 +2209,12 @@ static int __init atmci_init_slot(struct atmel_mci *host,
2206 } 2209 }
2207 } 2210 }
2208 2211
2209 if (!gpio_is_valid(slot->detect_pin)) 2212 if (!gpio_is_valid(slot->detect_pin)) {
2210 mmc->caps |= MMC_CAP_NEEDS_POLL; 2213 if (slot_data->non_removable)
2214 mmc->caps |= MMC_CAP_NONREMOVABLE;
2215 else
2216 mmc->caps |= MMC_CAP_NEEDS_POLL;
2217 }
2211 2218
2212 if (gpio_is_valid(slot->wp_pin)) { 2219 if (gpio_is_valid(slot->wp_pin)) {
2213 if (devm_gpio_request(&host->pdev->dev, slot->wp_pin, 2220 if (devm_gpio_request(&host->pdev->dev, slot->wp_pin,
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h
index 91b77f8d495d..9177947bf032 100644
--- a/include/linux/atmel-mci.h
+++ b/include/linux/atmel-mci.h
@@ -11,6 +11,7 @@
11 * @detect_pin: GPIO pin wired to the card detect switch 11 * @detect_pin: GPIO pin wired to the card detect switch
12 * @wp_pin: GPIO pin wired to the write protect sensor 12 * @wp_pin: GPIO pin wired to the write protect sensor
13 * @detect_is_active_high: The state of the detect pin when it is active 13 * @detect_is_active_high: The state of the detect pin when it is active
14 * @non_removable: The slot is not removable, only detect once
14 * 15 *
15 * If a given slot is not present on the board, @bus_width should be 16 * If a given slot is not present on the board, @bus_width should be
16 * set to 0. The other fields are ignored in this case. 17 * set to 0. The other fields are ignored in this case.
@@ -26,6 +27,7 @@ struct mci_slot_pdata {
26 int detect_pin; 27 int detect_pin;
27 int wp_pin; 28 int wp_pin;
28 bool detect_is_active_high; 29 bool detect_is_active_high;
30 bool non_removable;
29}; 31};
30 32
31/** 33/**