summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/meson-gx-mmc.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2017-03-22 22:34:01 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2017-04-24 21:41:47 +0200
commita744c6fe13beef87cd541f1dcaffe97f2af0c908 (patch)
tree5e7aa4ca4bfa85c44fd63183975b072afeb0fbc3 /drivers/mmc/host/meson-gx-mmc.c
parentmmc: meson-gx: improve setting data->bytes_xfered (diff)
downloadlinux-a744c6fe13beef87cd541f1dcaffe97f2af0c908.tar.xz
linux-a744c6fe13beef87cd541f1dcaffe97f2af0c908.zip
mmc: meson-gx: simplify setting timeout configuration parameters
We don't need variable cmd_cfg_timeout, so remove it and simplify the code a little. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Diffstat (limited to 'drivers/mmc/host/meson-gx-mmc.c')
-rw-r--r--drivers/mmc/host/meson-gx-mmc.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 87303404a7df..b917765c3815 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -426,7 +426,7 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
struct meson_host *host = mmc_priv(mmc);
struct mmc_data *data = cmd->data;
u32 cfg, cmd_cfg = 0, cmd_data = 0;
- u8 blk_len, cmd_cfg_timeout;
+ u8 blk_len;
unsigned int xfer_bytes = 0;
/* Setup descriptors */
@@ -454,6 +454,9 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
/* data? */
if (data) {
cmd_cfg |= CMD_CFG_DATA_IO;
+ cmd_cfg |= ilog2(SD_EMMC_CMD_TIMEOUT_DATA) <<
+ CMD_CFG_TIMEOUT_SHIFT;
+
if (data->blocks > 1) {
cmd_cfg |= CMD_CFG_BLOCK_MODE;
cmd_cfg |= (data->blocks & CMD_CFG_LENGTH_MASK) <<
@@ -488,13 +491,9 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
}
cmd_data = host->bounce_dma_addr & CMD_DATA_MASK;
-
- cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT_DATA);
} else {
- cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT);
+ cmd_cfg |= ilog2(SD_EMMC_CMD_TIMEOUT) << CMD_CFG_TIMEOUT_SHIFT;
}
- cmd_cfg |= (cmd_cfg_timeout & CMD_CFG_TIMEOUT_MASK) <<
- CMD_CFG_TIMEOUT_SHIFT;
host->cmd = cmd;