summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLin Fuzhen <fuzhen.lin@freescale.com>2012-05-04 14:14:43 +0800
committerLin Fuzhen <fuzhen.lin@freescale.com>2012-05-08 14:37:45 +0800
commite7743f109986f3ea17e17eff5792fd972799ef8d (patch)
treebe1ab6cddee2a6d5bcd67fd90dd1b16fa30e6399 /drivers
parent653eb4bfd5462804b0429754cabce2db20aaa46a (diff)
ENGR00182115 SDHCI: Disable SDHC LED related operation
For clk_enable implented on i.MX platform introduce spin lock, but in SDHCI driver, it will call the clk_enable in interrupt contex if enable LED class for SDHCI, it may cause the system crash. Delete the SDHCI_USE_LED_CLASS flag and add it to Kconfig, which can be restore if clock framework hasn't this limitation. Signed-off-by: Lin Fuzhen <fuzhen.lin@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/Kconfig6
-rwxr-xr-xdrivers/mmc/host/sdhci.c16
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 64aac7898334..d86cb895a112 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -579,3 +579,9 @@ config MMC_USHC
Note: These controllers only support SDIO cards and do not
support MMC or SD memory cards.
+config SDHCI_USE_LEDS_CLASS
+ tristate "Support LEDs indicators for SDHC HOST"
+ depends on MMC_SDHCI && LEDS_CLASS
+ help
+ This selects support for SDHCI HOST Controllers use LED Class
+ to control the status of LEDs
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 7c21ead42750..1aedbe436c25 100755
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -35,10 +35,6 @@
#define DBG(f, x...) \
pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x)
-#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
- defined(CONFIG_MMC_SDHCI_MODULE))
-#define SDHCI_USE_LEDS_CLASS
-#endif
#define MAX_TUNING_LOOP 40
@@ -282,7 +278,7 @@ static void sdhci_deactivate_led(struct sdhci_host *host)
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
}
-#ifdef SDHCI_USE_LEDS_CLASS
+#ifdef CONFIG_SDHCI_USE_LEDS_CLASS
static void sdhci_led_control(struct led_classdev *led,
enum led_brightness brightness)
{
@@ -1258,7 +1254,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
WARN_ON(host->mrq != NULL);
-#ifndef SDHCI_USE_LEDS_CLASS
+#ifndef CONFIG_SDHCI_USE_LEDS_CLASS
sdhci_activate_led(host);
#endif
@@ -2035,7 +2031,7 @@ static void sdhci_tasklet_finish(unsigned long param)
host->cmd = NULL;
host->data = NULL;
-#ifndef SDHCI_USE_LEDS_CLASS
+#ifndef CONFIG_SDHCI_USE_LEDS_CLASS
sdhci_deactivate_led(host);
#endif
@@ -2899,7 +2895,7 @@ int sdhci_add_host(struct sdhci_host *host)
sdhci_dumpregs(host);
#endif
-#ifdef SDHCI_USE_LEDS_CLASS
+#ifdef CONFIG_SDHCI_USE_LEDS_CLASS
snprintf(host->led_name, sizeof(host->led_name),
"%s::", mmc_hostname(mmc));
host->led.name = host->led_name;
@@ -2925,7 +2921,7 @@ int sdhci_add_host(struct sdhci_host *host)
sdhci_disable_clk(host, CLK_TIMEOUT);
return 0;
-#ifdef SDHCI_USE_LEDS_CLASS
+#ifdef CONFIG_SDHCI_USE_LEDS_CLASS
reset:
sdhci_reset(host, SDHCI_RESET_ALL);
free_irq(host->irq, host);
@@ -2966,7 +2962,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
mmc_remove_host(host->mmc);
-#ifdef SDHCI_USE_LEDS_CLASS
+#ifdef CONFIG_SDHCI_USE_LEDS_CLASS
led_classdev_unregister(&host->led);
#endif