aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2018-06-19 23:12:57 +0300
committerMichael Bestas <mkbestas@lineageos.org>2018-06-19 23:12:57 +0300
commitde6dac6df6807f901bac8e29de24a6a7981aea2d (patch)
treea70d6303c33a857e730b5d920bfe7dc1047999dc /drivers/mmc
parented9b46f6268d2abcbb9079bf44261e3b6e8c424f (diff)
parent44ff472b917252c55c8e96ce7e0612aed13269cb (diff)
Merge tag 'LA.UM.6.6.r1-08900-89xx.0' of kernel/msm-3.18 into lineage-15.1-caf-8996
Conflicts: net/sctp/socket.c Change-Id: I90c45f914ac4d11bbeee3722ede5ea55e52898e1
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/core.c12
-rw-r--r--drivers/mmc/core/quirks.c10
-rw-r--r--drivers/mmc/core/sd.c5
-rw-r--r--drivers/mmc/core/sdio.c3
4 files changed, 27 insertions, 3 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index b4ad723b4e36..7cceec44d2d8 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -3002,6 +3002,13 @@ static void _mmc_detect_change(struct mmc_host *host, unsigned long delay,
pm_wakeup_event(mmc_dev(host), 5000);
host->detect_change = 1;
+ /*
+ * Change in cd_gpio state, so make sure detection part is
+ * not overided because of manual resume.
+ */
+ if (cd_irq && mmc_bus_manual_resume(host))
+ host->ignore_bus_resume_flags = true;
+
mmc_schedule_delayed_work(&host->detect, delay);
}
@@ -3923,6 +3930,8 @@ void mmc_rescan(struct work_struct *work)
host->bus_ops->detect(host);
host->detect_change = 0;
+ if (host->ignore_bus_resume_flags)
+ host->ignore_bus_resume_flags = false;
/*
* Let mmc_bus_put() free the bus/bus_ops if we've found that
@@ -4184,7 +4193,8 @@ int mmc_pm_notify(struct notifier_block *notify_block,
spin_lock_irqsave(&host->lock, flags);
host->rescan_disable = 0;
- if (mmc_bus_manual_resume(host)) {
+ if (mmc_bus_manual_resume(host) &&
+ !host->ignore_bus_resume_flags) {
spin_unlock_irqrestore(&host->lock, flags);
break;
}
diff --git a/drivers/mmc/core/quirks.c b/drivers/mmc/core/quirks.c
index 071adc101158..1b4e40c0aff6 100644
--- a/drivers/mmc/core/quirks.c
+++ b/drivers/mmc/core/quirks.c
@@ -79,6 +79,13 @@
#define SDIO_DEVICE_ID_QCA9377 0x701
#endif
+#ifndef SDIO_VENDOR_ID_QCA9379
+#define SDIO_VENDOR_ID_QCA9379 0x271
+#endif
+
+#ifndef SDIO_DEVICE_ID_QCA9379
+#define SDIO_DEVICE_ID_QCA9379 0x801
+#endif
/*
* This hook just adds a quirk for all sdio devices
@@ -131,6 +138,9 @@ static const struct mmc_fixup mmc_fixup_methods[] = {
SDIO_FIXUP(SDIO_VENDOR_ID_QCA9377, SDIO_DEVICE_ID_QCA9377,
add_quirk, MMC_QUIRK_QCA9377_SETTINGS),
+
+ SDIO_FIXUP(SDIO_VENDOR_ID_QCA9379, SDIO_DEVICE_ID_QCA9379,
+ add_quirk, MMC_QUIRK_QCA9379_SETTINGS),
END_FIXUP
};
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index a29c4b2c8e97..b58bf6d1f505 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1234,7 +1234,10 @@ static int mmc_sd_suspend(struct mmc_host *host)
if (!err) {
pm_runtime_disable(&host->card->dev);
pm_runtime_set_suspended(&host->card->dev);
- }
+ /* if suspend fails, force mmc_detect_change during resume */
+ } else if (mmc_bus_manual_resume(host))
+ host->ignore_bus_resume_flags = true;
+
MMC_TRACE(host, "%s: Exit err: %d\n", __func__, err);
return err;
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 5651cf63f8bd..65425a41a84f 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -228,7 +228,8 @@ static void sdio_enable_vendor_specific_settings(struct mmc_card *card)
u8 settings;
if (mmc_enable_qca6574_settings(card) ||
- mmc_enable_qca9377_settings(card)) {
+ mmc_enable_qca9377_settings(card) ||
+ mmc_enable_qca9379_settings(card)) {
ret = mmc_io_rw_direct(card, 1, 0, 0xF2, 0x0F, NULL);
if (ret) {
pr_crit("%s: failed to write to fn 0xf2 %d\n",