Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 356bc5e8 authored by Pavan Anamula's avatar Pavan Anamula Committed by Gerrit - the friendly Code Review server
Browse files

mmc: sdhci: Add new quirk for broken SDHCI LED control



Some controllers may not have any LED control to indicate
its status. Use this quirk for such controllers to avoid
registering any LED device with LED class and also to
avoid exposing sysfs nodes which doesn't actually control
any LED.

Change-Id: I7e8f1b8d2d735685ede87df4bb7fb32ad0a10246
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
Signed-off-by: default avatarPavan Anamula <pavana@codeaurora.org>
parent 43d6be80
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -1755,6 +1755,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
	WARN_ON(host->mrq != NULL);

#ifndef SDHCI_USE_LEDS_CLASS
	if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_LED_CONTROL))
		sdhci_activate_led(host);
#endif

@@ -2714,6 +2715,7 @@ static void sdhci_tasklet_finish(unsigned long param)
	host->auto_cmd_err_sts = 0;

#ifndef SDHCI_USE_LEDS_CLASS
	if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_LED_CONTROL))
		sdhci_deactivate_led(host);
#endif

@@ -4181,6 +4183,7 @@ int sdhci_add_host(struct sdhci_host *host)
#endif

#ifdef SDHCI_USE_LEDS_CLASS
	if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_LED_CONTROL)) {
		snprintf(host->led_name, sizeof(host->led_name),
			"%s::", mmc_hostname(mmc));
		host->led.name = host->led_name;
@@ -4194,6 +4197,7 @@ int sdhci_add_host(struct sdhci_host *host)
			       mmc_hostname(mmc), ret);
			goto reset;
		}
	}
#endif

	mmiowb();
@@ -4289,6 +4293,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
	mmc_remove_host(host->mmc);

#ifdef SDHCI_USE_LEDS_CLASS
	if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_LED_CONTROL))
		led_classdev_unregister(&host->led);
#endif

+2 −0
Original line number Diff line number Diff line
@@ -185,6 +185,8 @@ struct sdhci_host {
#define SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400		(1<<20)
/* Use reset workaround in case sdhci reset timeouts */
#define SDHCI_QUIRK2_USE_RESET_WORKAROUND		(1<<21)
/* Some controllers doesn't have have any LED control */
#define SDHCI_QUIRK2_BROKEN_LED_CONTROL			(1<<22)

	int irq;		/* Device IRQ */
	void __iomem *ioaddr;	/* Mapped address */