Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4c7fc8c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: sdhci: add post halt helper to support command queue hosts"

parents a6982988 fc61c3aa
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -298,12 +298,11 @@ static int cmdq_enable(struct mmc_host *mmc)
		err = cmdq_host_alloc_tdl(cq_host);
		if (err)
			goto out;
		cmdq_writel(cq_host, lower_32_bits(cq_host->desc_dma_base),
				CQTDLBA);
		cmdq_writel(cq_host, upper_32_bits(cq_host->desc_dma_base),
				CQTDLBAU);
	}

	cmdq_writel(cq_host, lower_32_bits(cq_host->desc_dma_base), CQTDLBA);
	cmdq_writel(cq_host, upper_32_bits(cq_host->desc_dma_base), CQTDLBAU);

	/*
	 * disable all vendor interrupts
	 * enable CMDQ interrupts
@@ -675,6 +674,8 @@ irqreturn_t cmdq_irq(struct mmc_host *mmc, int err)
	}

	if (status & CQIS_HAC) {
		if (cq_host->ops->post_cqe_halt)
			cq_host->ops->post_cqe_halt(mmc);
		/* halt is completed, wakeup waiting thread */
		complete(&cq_host->halt_comp);
	}
+1 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ struct cmdq_host_ops {
	int (*reset)(struct mmc_host *mmc);
	int (*crypto_cfg)(struct mmc_host *mmc, struct mmc_request *mrq,
				u32 slot);
	void (*post_cqe_halt)(struct mmc_host *mmc);
};

static inline void cmdq_writel(struct cmdq_host *host, u32 val, int reg)
+14 −0
Original line number Diff line number Diff line
@@ -3468,6 +3468,15 @@ static int sdhci_cmdq_crypto_cfg(struct mmc_host *mmc,

	return sdhci_crypto_cfg(host, mrq, slot);
}

static void sdhci_cmdq_post_cqe_halt(struct mmc_host *mmc)
{
	struct sdhci_host *host = mmc_priv(mmc);

	sdhci_writel(host, sdhci_readl(host, SDHCI_INT_ENABLE) |
			SDHCI_INT_RESPONSE, SDHCI_INT_ENABLE);
	sdhci_writel(host, SDHCI_INT_RESPONSE, SDHCI_INT_STATUS);
}
#else
static void sdhci_cmdq_clear_set_irqs(struct mmc_host *mmc, bool clear)
{
@@ -3504,6 +3513,10 @@ static int sdhci_cmdq_crypto_cfg(struct mmc_host *mmc,
{
	return 0;
}

static void sdhci_cmdq_post_cqe_halt(struct mmc_host *mmc)
{
}
#endif

static const struct cmdq_host_ops sdhci_cmdq_ops = {
@@ -3513,6 +3526,7 @@ static const struct cmdq_host_ops sdhci_cmdq_ops = {
	.set_block_size = sdhci_cmdq_set_block_size,
	.clear_set_dumpregs = sdhci_cmdq_clear_set_dumpregs,
	.crypto_cfg	= sdhci_cmdq_crypto_cfg,
	.post_cqe_halt = sdhci_cmdq_post_cqe_halt,
};

int sdhci_add_host(struct sdhci_host *host)