mmc: sdhci-msm: add support for command-queue
Adds support for command-queue (CQ). MSM driver supports CQ in the hardware. The controller can send commands to the card and read statuses from the device. This patch adds support for the same. Change-Id: I1b19a2ce4c124c96dc6c3852d8f58ad076851f4b Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
This commit is contained in:
parent
c4dd8dad71
commit
11bb322287
1 changed files with 24 additions and 0 deletions
|
@ -41,6 +41,7 @@
|
|||
|
||||
#include "sdhci-msm.h"
|
||||
#include "sdhci-msm-ice.h"
|
||||
#include "cmdq_hci.h"
|
||||
|
||||
#define CORE_POWER 0x0
|
||||
#define CORE_SW_RST (1 << 7)
|
||||
|
@ -2841,6 +2842,28 @@ static void sdhci_set_default_hw_caps(struct sdhci_msm_host *msm_host,
|
|||
msm_host->caps_0 = caps;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MMC_CQ_HCI
|
||||
static void sdhci_msm_cmdq_init(struct sdhci_host *host,
|
||||
struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
struct sdhci_msm_host *msm_host = pltfm_host->priv;
|
||||
|
||||
host->cq_host = cmdq_pltfm_init(pdev);
|
||||
if (IS_ERR(host->cq_host))
|
||||
dev_dbg(&pdev->dev, "cmdq-pltfm init: failed: %ld\n",
|
||||
PTR_ERR(host->cq_host));
|
||||
else
|
||||
msm_host->mmc->caps2 |= MMC_CAP2_CMD_QUEUE;
|
||||
}
|
||||
#else
|
||||
static void sdhci_msm_cmdq_init(struct sdhci_host *host,
|
||||
struct platform_device *pdev)
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
static int sdhci_msm_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_host *host;
|
||||
|
@ -3218,6 +3241,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
|
|||
dev_err(&pdev->dev, "%s: Failed to set dma mask\n", __func__);
|
||||
}
|
||||
|
||||
sdhci_msm_cmdq_init(host, pdev);
|
||||
ret = sdhci_add_host(host);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Add host failed (%d)\n", ret);
|
||||
|
|
Loading…
Add table
Reference in a new issue