Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: host: atmel-mci: Add support for non-removable slots

Add support for non-removable slots which have no card detection GPIO
and which should not be polled for a card change.

Signed-off-by: Timo Kokkonen <timo.kokkonen@offcode.fi>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Timo Kokkonen and committed by
Ulf Hansson
76d55564 0654bb3c

+11 -2
+9 -2
drivers/mmc/host/atmel-mci.c
··· 560 560 pdata->slot[slot_id].detect_is_active_high = 561 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 566 pdata->slot[slot_id].wp_pin = 564 567 of_get_named_gpio(cnp, "wp-gpios", 0); 565 568 } ··· 2209 2206 } 2210 2207 } 2211 2208 2212 - if (!gpio_is_valid(slot->detect_pin)) 2213 - mmc->caps |= MMC_CAP_NEEDS_POLL; 2209 + if (!gpio_is_valid(slot->detect_pin)) { 2210 + if (slot_data->non_removable) 2211 + mmc->caps |= MMC_CAP_NONREMOVABLE; 2212 + else 2213 + mmc->caps |= MMC_CAP_NEEDS_POLL; 2214 + } 2214 2215 2215 2216 if (gpio_is_valid(slot->wp_pin)) { 2216 2217 if (devm_gpio_request(&host->pdev->dev, slot->wp_pin,
+2
include/linux/atmel-mci.h
··· 11 11 * @detect_pin: GPIO pin wired to the card detect switch 12 12 * @wp_pin: GPIO pin wired to the write protect sensor 13 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 16 * If a given slot is not present on the board, @bus_width should be 16 17 * set to 0. The other fields are ignored in this case. ··· 27 26 int detect_pin; 28 27 int wp_pin; 29 28 bool detect_is_active_high; 29 + bool non_removable; 30 30 }; 31 31 32 32 /**