diff mbox series

[V4,06/10] mmc: cqhci: allow hosts to update dcmd cmd desc

Message ID 1553402727-23130-6-git-send-email-skomatineni@nvidia.com
State Accepted
Headers show
Series [V4,01/10] mmc: tegra: fix ddr signaling for non-ddr modes | expand

Commit Message

Sowjanya Komatineni March 24, 2019, 4:45 a.m. UTC
This patch adds update_dcmd_desc interface to cqhci_host_ops to
allow hosts to update any of the DCMD task descriptor attributes
and parameters.

Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Ritesh Harjani <riteshh@codeaurora.org>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
---
 [V4]: Minor fix of missing declaration of mmc_request

 drivers/mmc/host/cqhci.c | 2 ++
 drivers/mmc/host/cqhci.h | 3 +++
 2 files changed, 5 insertions(+)

Comments

Adrian Hunter March 25, 2019, 10:39 a.m. UTC | #1
On 24/03/19 6:45 AM, Sowjanya Komatineni wrote:
> This patch adds update_dcmd_desc interface to cqhci_host_ops to
> allow hosts to update any of the DCMD task descriptor attributes
> and parameters.
> 
> Tested-by: Jon Hunter <jonathanh@nvidia.com>
> Reviewed-by: Ritesh Harjani <riteshh@codeaurora.org>
> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  [V4]: Minor fix of missing declaration of mmc_request
> 
>  drivers/mmc/host/cqhci.c | 2 ++
>  drivers/mmc/host/cqhci.h | 3 +++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c
> index a8af682a9182..d59cb0a51964 100644
> --- a/drivers/mmc/host/cqhci.c
> +++ b/drivers/mmc/host/cqhci.c
> @@ -537,6 +537,8 @@ static void cqhci_prep_dcmd_desc(struct mmc_host *mmc,
>  		 CQHCI_ACT(0x5) |
>  		 CQHCI_CMD_INDEX(mrq->cmd->opcode) |
>  		 CQHCI_CMD_TIMING(timing) | CQHCI_RESP_TYPE(resp_type));
> +	if (cq_host->ops->update_dcmd_desc)
> +		cq_host->ops->update_dcmd_desc(mmc, mrq, &data);
>  	*task_desc |= data;
>  	desc = (u8 *)task_desc;
>  	pr_debug("%s: cqhci: dcmd: cmd: %d timing: %d resp: %d\n",
> diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
> index 9e68286a07b4..928ec491eecf 100644
> --- a/drivers/mmc/host/cqhci.h
> +++ b/drivers/mmc/host/cqhci.h
> @@ -147,6 +147,7 @@
>  
>  struct cqhci_host_ops;
>  struct mmc_host;
> +struct mmc_request;
>  struct cqhci_slot;
>  
>  struct cqhci_host {
> @@ -210,6 +211,8 @@ struct cqhci_host_ops {
>  	u32 (*read_l)(struct cqhci_host *host, int reg);
>  	void (*enable)(struct mmc_host *mmc);
>  	void (*disable)(struct mmc_host *mmc, bool recovery);
> +	void (*update_dcmd_desc)(struct mmc_host *mmc, struct mmc_request *mrq,
> +				 u64 *data);
>  };
>  
>  static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg)
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/cqhci.c b/drivers/mmc/host/cqhci.c
index a8af682a9182..d59cb0a51964 100644
--- a/drivers/mmc/host/cqhci.c
+++ b/drivers/mmc/host/cqhci.c
@@ -537,6 +537,8 @@  static void cqhci_prep_dcmd_desc(struct mmc_host *mmc,
 		 CQHCI_ACT(0x5) |
 		 CQHCI_CMD_INDEX(mrq->cmd->opcode) |
 		 CQHCI_CMD_TIMING(timing) | CQHCI_RESP_TYPE(resp_type));
+	if (cq_host->ops->update_dcmd_desc)
+		cq_host->ops->update_dcmd_desc(mmc, mrq, &data);
 	*task_desc |= data;
 	desc = (u8 *)task_desc;
 	pr_debug("%s: cqhci: dcmd: cmd: %d timing: %d resp: %d\n",
diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
index 9e68286a07b4..928ec491eecf 100644
--- a/drivers/mmc/host/cqhci.h
+++ b/drivers/mmc/host/cqhci.h
@@ -147,6 +147,7 @@ 
 
 struct cqhci_host_ops;
 struct mmc_host;
+struct mmc_request;
 struct cqhci_slot;
 
 struct cqhci_host {
@@ -210,6 +211,8 @@  struct cqhci_host_ops {
 	u32 (*read_l)(struct cqhci_host *host, int reg);
 	void (*enable)(struct mmc_host *mmc);
 	void (*disable)(struct mmc_host *mmc, bool recovery);
+	void (*update_dcmd_desc)(struct mmc_host *mmc, struct mmc_request *mrq,
+				 u64 *data);
 };
 
 static inline void cqhci_writel(struct cqhci_host *host, u32 val, int reg)