[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1598520783-25250-2-git-send-email-chun-hung.wu@mediatek.com>
Date: Thu, 27 Aug 2020 17:33:02 +0800
From: Chun-Hung Wu <chun-hung.wu@...iatek.com>
To: <mirq-linux@...e.qmqm.pl>, Jonathan Hunter <jonathanh@...dia.com>,
Al Cooper <alcooperx@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Florian Fainelli <f.fainelli@...il.com>,
<bcm-kernel-feedback-list@...adcom.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Michal Simek <michal.simek@...inx.com>,
Thierry Reding <thierry.reding@...il.com>,
Chaotian Jing <chaotian.jing@...iatek.com>,
Mao Yong <yong.mao@...iatek.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Matthias Brugger <matthias.bgg@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Pavel Machek <pavel@....cz>,
Kate Stewart <kstewart@...uxfoundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Pan Bian <bianpan2016@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Allison Randal <allison@...utok.net>,
Mathieu Malaterre <malat@...ian.org>,
Asutosh Das <asutoshd@...eaurora.org>,
Ritesh Harjani <riteshh@...eaurora.org>,
Stanley Chu <stanley.chu@...iatek.com>,
Kuohong Wang <kuohong.wang@...iatek.com>
CC: <kernel-team@...roid.com>, <linux-kernel@...r.kernel.org>,
<linux-mmc@...r.kernel.org>, <linux-mediatek@...ts.infradead.org>,
<devicetree@...r.kernel.org>, <wsd_upstream@...iatek.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-arm-msm@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
Chun-Hung Wu <chun-hung.wu@...iatek.com>
Subject: [PATCH v1 1/2] mmc: cqhci: add new cqhci_host_ops pre_enable() and post_disable()
Add pre_enable() and post_disable() for cqhci_host_ops.
Add hook functions before cqhci enable and
after cqhci disable for platforms need them.
Signed-off-by: Chun-Hung Wu <chun-hung.wu@...iatek.com>
---
drivers/mmc/host/cqhci.c | 6 ++++++
drivers/mmc/host/cqhci.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c
index cfa87df..697fe40 100644
--- a/drivers/mmc/host/cqhci.c
+++ b/drivers/mmc/host/cqhci.c
@@ -376,6 +376,9 @@ static void cqhci_off(struct mmc_host *mmc)
else
pr_debug("%s: cqhci: CQE off\n", mmc_hostname(mmc));
+ if (cq_host->ops->post_disable)
+ cq_host->ops->post_disable(mmc);
+
mmc->cqe_on = false;
}
@@ -580,6 +583,9 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
__cqhci_enable(cq_host);
if (!mmc->cqe_on) {
+ if (cq_host->ops->pre_enable)
+ cq_host->ops->pre_enable(mmc);
+
cqhci_writel(cq_host, 0, CQHCI_CTL);
mmc->cqe_on = true;
pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
index 4377001..89bf6ad 100644
--- a/drivers/mmc/host/cqhci.h
+++ b/drivers/mmc/host/cqhci.h
@@ -206,6 +206,8 @@ struct cqhci_host_ops {
void (*disable)(struct mmc_host *mmc, bool recovery);
void (*update_dcmd_desc)(struct mmc_host *mmc, struct mmc_request *mrq,
u64 *data);
+ void (*pre_enable)(struct mmc_host *mmc);
+ void (*post_disable)(struct mmc_host *mmc);
};
static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg)
--
1.7.9.5
Powered by blists - more mailing lists