mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 18:00:53 +07:00
ARM: Fix Versatile/Realview/VExpress MMC card detection sense
The MMC card detection sense has become really confused with negations at various levels, leading to some platforms not detecting inserted cards. Fix this by converting everything to positive logic throughout, thereby getting rid of these negations. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
831e8047eb
commit
74bc80931c
@ -237,7 +237,7 @@ static unsigned int realview_mmc_status(struct device *dev)
|
||||
else
|
||||
mask = 2;
|
||||
|
||||
return !(readl(REALVIEW_SYSMCI) & mask);
|
||||
return readl(REALVIEW_SYSMCI) & mask;
|
||||
}
|
||||
|
||||
struct mmci_platform_data realview_mmc0_plat_data = {
|
||||
|
@ -241,7 +241,7 @@ static struct platform_device v2m_flash_device = {
|
||||
|
||||
static unsigned int v2m_mmci_status(struct device *dev)
|
||||
{
|
||||
return !(readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0));
|
||||
return readl(MMIO_P2V(V2M_SYS_MCI)) & (1 << 0);
|
||||
}
|
||||
|
||||
static struct mmci_platform_data v2m_mmci_data = {
|
||||
|
@ -539,9 +539,13 @@ static int mmci_get_cd(struct mmc_host *mmc)
|
||||
if (host->gpio_cd == -ENOSYS)
|
||||
status = host->plat->status(mmc_dev(host->mmc));
|
||||
else
|
||||
status = gpio_get_value(host->gpio_cd);
|
||||
status = !gpio_get_value(host->gpio_cd);
|
||||
|
||||
return !status;
|
||||
/*
|
||||
* Use positive logic throughout - status is zero for no card,
|
||||
* non-zero for card inserted.
|
||||
*/
|
||||
return status;
|
||||
}
|
||||
|
||||
static const struct mmc_host_ops mmci_ops = {
|
||||
|
Loading…
Reference in New Issue
Block a user