aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2014-06-02 05:09:39 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-07-09 05:25:56 -0400
commitae7b0061f61e7c96884f4080b4e28544a0cedd76 (patch)
tree1d833f673c19bd69cf0370532c5bf05f5cc514c5
parente8740644ab5f906e131596d7580701b2ca855210 (diff)
mmc: mmci: Add support to data commands via variant structure.
On some SOCs like Qcom there are explicit bits in the command register to specify if its a data transfer command or not. So this patch adds support to such bits in variant data, giving more flexibility to the driver. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/mmci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 5228c5de334d..0a8cdac1f59c 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -59,6 +59,7 @@ static unsigned int fmax = 515633;
59 * is asserted (likewise for RX) 59 * is asserted (likewise for RX)
60 * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY 60 * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY
61 * is asserted (likewise for RX) 61 * is asserted (likewise for RX)
62 * @data_cmd_enable: enable value for data commands.
62 * @sdio: variant supports SDIO 63 * @sdio: variant supports SDIO
63 * @st_clkdiv: true if using a ST-specific clock divider algorithm 64 * @st_clkdiv: true if using a ST-specific clock divider algorithm
64 * @datactrl_mask_ddrmode: ddr mode mask in datactrl register. 65 * @datactrl_mask_ddrmode: ddr mode mask in datactrl register.
@@ -79,6 +80,7 @@ struct variant_data {
79 unsigned int datalength_bits; 80 unsigned int datalength_bits;
80 unsigned int fifosize; 81 unsigned int fifosize;
81 unsigned int fifohalfsize; 82 unsigned int fifohalfsize;
83 unsigned int data_cmd_enable;
82 unsigned int datactrl_mask_ddrmode; 84 unsigned int datactrl_mask_ddrmode;
83 bool sdio; 85 bool sdio;
84 bool st_clkdiv; 86 bool st_clkdiv;
@@ -841,6 +843,9 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c)
841 if (/*interrupt*/0) 843 if (/*interrupt*/0)
842 c |= MCI_CPSM_INTERRUPT; 844 c |= MCI_CPSM_INTERRUPT;
843 845
846 if (mmc_cmd_type(cmd) == MMC_CMD_ADTC)
847 c |= host->variant->data_cmd_enable;
848
844 host->cmd = cmd; 849 host->cmd = cmd;
845 850
846 writel(cmd->arg, base + MMCIARGUMENT); 851 writel(cmd->arg, base + MMCIARGUMENT);