mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
mmc: Merge branch fixes into next
Merge the mmc fixes for v6.10-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.11. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
commit
8d46e04cc7
1 changed files with 14 additions and 11 deletions
|
|
@ -2515,26 +2515,29 @@ EXPORT_SYMBOL_GPL(sdhci_get_cd_nogpio);
|
|||
|
||||
static int sdhci_check_ro(struct sdhci_host *host)
|
||||
{
|
||||
unsigned long flags;
|
||||
bool allow_invert = false;
|
||||
int is_readonly;
|
||||
|
||||
spin_lock_irqsave(&host->lock, flags);
|
||||
|
||||
if (host->flags & SDHCI_DEVICE_DEAD)
|
||||
if (host->flags & SDHCI_DEVICE_DEAD) {
|
||||
is_readonly = 0;
|
||||
else if (host->ops->get_ro)
|
||||
} else if (host->ops->get_ro) {
|
||||
is_readonly = host->ops->get_ro(host);
|
||||
else if (mmc_can_gpio_ro(host->mmc))
|
||||
} else if (mmc_can_gpio_ro(host->mmc)) {
|
||||
is_readonly = mmc_gpio_get_ro(host->mmc);
|
||||
else
|
||||
/* Do not invert twice */
|
||||
allow_invert = !(host->mmc->caps2 & MMC_CAP2_RO_ACTIVE_HIGH);
|
||||
} else {
|
||||
is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE)
|
||||
& SDHCI_WRITE_PROTECT);
|
||||
allow_invert = true;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&host->lock, flags);
|
||||
if (is_readonly >= 0 &&
|
||||
allow_invert &&
|
||||
(host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT))
|
||||
is_readonly = !is_readonly;
|
||||
|
||||
/* This quirk needs to be replaced by a callback-function later */
|
||||
return host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT ?
|
||||
!is_readonly : is_readonly;
|
||||
return is_readonly;
|
||||
}
|
||||
|
||||
#define SAMPLE_COUNT 5
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue