mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-11 23:27:42 +07:00
mmc: sdhci: Add quirk to disable LED control
Host controllers may not have a LED signal line, whereas the register updates to control the non-existent LED can be relatively time consuming. Add a quirk to disable LED control. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
c8073e5285
commit
bd29f58bc0
@ -349,6 +349,9 @@ static void __sdhci_led_activate(struct sdhci_host *host)
|
|||||||
{
|
{
|
||||||
u8 ctrl;
|
u8 ctrl;
|
||||||
|
|
||||||
|
if (host->quirks & SDHCI_QUIRK_NO_LED)
|
||||||
|
return;
|
||||||
|
|
||||||
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
|
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
|
||||||
ctrl |= SDHCI_CTRL_LED;
|
ctrl |= SDHCI_CTRL_LED;
|
||||||
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
|
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
|
||||||
@ -358,6 +361,9 @@ static void __sdhci_led_deactivate(struct sdhci_host *host)
|
|||||||
{
|
{
|
||||||
u8 ctrl;
|
u8 ctrl;
|
||||||
|
|
||||||
|
if (host->quirks & SDHCI_QUIRK_NO_LED)
|
||||||
|
return;
|
||||||
|
|
||||||
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
|
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
|
||||||
ctrl &= ~SDHCI_CTRL_LED;
|
ctrl &= ~SDHCI_CTRL_LED;
|
||||||
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
|
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
|
||||||
@ -387,6 +393,9 @@ static int sdhci_led_register(struct sdhci_host *host)
|
|||||||
{
|
{
|
||||||
struct mmc_host *mmc = host->mmc;
|
struct mmc_host *mmc = host->mmc;
|
||||||
|
|
||||||
|
if (host->quirks & SDHCI_QUIRK_NO_LED)
|
||||||
|
return 0;
|
||||||
|
|
||||||
snprintf(host->led_name, sizeof(host->led_name),
|
snprintf(host->led_name, sizeof(host->led_name),
|
||||||
"%s::", mmc_hostname(mmc));
|
"%s::", mmc_hostname(mmc));
|
||||||
|
|
||||||
@ -400,6 +409,9 @@ static int sdhci_led_register(struct sdhci_host *host)
|
|||||||
|
|
||||||
static void sdhci_led_unregister(struct sdhci_host *host)
|
static void sdhci_led_unregister(struct sdhci_host *host)
|
||||||
{
|
{
|
||||||
|
if (host->quirks & SDHCI_QUIRK_NO_LED)
|
||||||
|
return;
|
||||||
|
|
||||||
led_classdev_unregister(&host->led);
|
led_classdev_unregister(&host->led);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,6 +408,8 @@ struct sdhci_host {
|
|||||||
#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16)
|
#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16)
|
||||||
/* Controller does not like fast PIO transfers */
|
/* Controller does not like fast PIO transfers */
|
||||||
#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18)
|
#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18)
|
||||||
|
/* Controller does not have a LED */
|
||||||
|
#define SDHCI_QUIRK_NO_LED (1<<19)
|
||||||
/* Controller has to be forced to use block size of 2048 bytes */
|
/* Controller has to be forced to use block size of 2048 bytes */
|
||||||
#define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20)
|
#define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20)
|
||||||
/* Controller cannot do multi-block transfers */
|
/* Controller cannot do multi-block transfers */
|
||||||
|
Loading…
Reference in New Issue
Block a user