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

mmc: sdhci-spear: remove support for power gpio

None of this code is currently used: there are no definitions of
struct sdhci_plat_data in arch/arm, neither are there any DT properties
which use card_power_gpio/power_active_high/power_always_enb. In any
case, slot power control should be rigged up via vmmc and the regulator
subsystem in the DT case.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Chris Ball <chris@printf.net>

authored by

Russell King and committed by
Chris Ball
42c1add9 475d9e3e

-40
-32
drivers/mmc/host/sdhci-spear.c
··· 56 56 gpio_irq_type = val ? IRQF_TRIGGER_LOW : IRQF_TRIGGER_HIGH; 57 57 irq_set_irq_type(irq, gpio_irq_type); 58 58 59 - if (sdhci->data->card_power_gpio >= 0) { 60 - if (!sdhci->data->power_always_enb) { 61 - /* if card inserted, give power, otherwise remove it */ 62 - val = sdhci->data->power_active_high ? !val : val ; 63 - gpio_set_value(sdhci->data->card_power_gpio, val); 64 - } 65 - } 66 - 67 59 /* inform sdhci driver about card insertion/removal */ 68 60 tasklet_schedule(&host->card_tasklet); 69 61 ··· 170 178 */ 171 179 if (!sdhci->data) 172 180 return 0; 173 - 174 - if (sdhci->data->card_power_gpio >= 0) { 175 - int val = 0; 176 - 177 - ret = devm_gpio_request(&pdev->dev, 178 - sdhci->data->card_power_gpio, "sdhci"); 179 - if (ret < 0) { 180 - dev_dbg(&pdev->dev, "gpio request fail: %d\n", 181 - sdhci->data->card_power_gpio); 182 - goto set_drvdata; 183 - } 184 - 185 - if (sdhci->data->power_always_enb) 186 - val = sdhci->data->power_active_high; 187 - else 188 - val = !sdhci->data->power_active_high; 189 - 190 - ret = gpio_direction_output(sdhci->data->card_power_gpio, val); 191 - if (ret) { 192 - dev_dbg(&pdev->dev, "gpio set direction fail: %d\n", 193 - sdhci->data->card_power_gpio); 194 - goto set_drvdata; 195 - } 196 - } 197 181 198 182 if (sdhci->data->card_int_gpio >= 0) { 199 183 ret = devm_gpio_request(&pdev->dev, sdhci->data->card_int_gpio,
-8
include/linux/mmc/sdhci-spear.h
··· 18 18 /* 19 19 * struct sdhci_plat_data: spear sdhci platform data structure 20 20 * 21 - * @card_power_gpio: gpio pin for enabling/disabling power to sdhci socket 22 - * @power_active_high: if set, enable power to sdhci socket by setting 23 - * card_power_gpio 24 - * @power_always_enb: If set, then enable power on probe, otherwise enable only 25 - * on card insertion and disable on card removal. 26 21 * card_int_gpio: gpio pin used for card detection 27 22 */ 28 23 struct sdhci_plat_data { 29 - int card_power_gpio; 30 - int power_active_high; 31 - int power_always_enb; 32 24 int card_int_gpio; 33 25 }; 34 26