diff options
author | Ludovic Barre <ludovic.barre@st.com> | 2019-03-27 05:05:28 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2019-04-15 05:55:54 -0400 |
commit | 0732ea75de09f0816f0604e46116ca111bc309d6 (patch) | |
tree | 12bdc52c45f6b98969102f84a80434650faf6658 | |
parent | e5a34b0c1071e6b6b6cfca4c6887c39cd403dd77 (diff) |
mmc: mmci: add get_datactrl_cfg callback and helper functions
This patch adds get_datactrl_cfg callback in mmci_host_ops
to allow to get datactrl configuration specific at variant.
Common helper function is defined and could be call by variant.
Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/mmci.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 6bde28c9b302..35c91d0059b9 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
@@ -362,6 +362,7 @@ struct mmci_host_ops { | |||
362 | bool next); | 362 | bool next); |
363 | void (*unprep_data)(struct mmci_host *host, struct mmc_data *data, | 363 | void (*unprep_data)(struct mmci_host *host, struct mmc_data *data, |
364 | int err); | 364 | int err); |
365 | u32 (*get_datactrl_cfg)(struct mmci_host *host); | ||
365 | void (*get_next_data)(struct mmci_host *host, struct mmc_data *data); | 366 | void (*get_next_data)(struct mmci_host *host, struct mmc_data *data); |
366 | int (*dma_setup)(struct mmci_host *host); | 367 | int (*dma_setup)(struct mmci_host *host); |
367 | void (*dma_release)(struct mmci_host *host); | 368 | void (*dma_release)(struct mmci_host *host); |
@@ -429,6 +430,11 @@ struct mmci_host { | |||
429 | void mmci_write_clkreg(struct mmci_host *host, u32 clk); | 430 | void mmci_write_clkreg(struct mmci_host *host, u32 clk); |
430 | void mmci_write_pwrreg(struct mmci_host *host, u32 pwr); | 431 | void mmci_write_pwrreg(struct mmci_host *host, u32 pwr); |
431 | 432 | ||
433 | static inline u32 mmci_dctrl_blksz(struct mmci_host *host) | ||
434 | { | ||
435 | return (ffs(host->data->blksz) - 1) << 4; | ||
436 | } | ||
437 | |||
432 | #ifdef CONFIG_DMA_ENGINE | 438 | #ifdef CONFIG_DMA_ENGINE |
433 | int mmci_dmae_prep_data(struct mmci_host *host, struct mmc_data *data, | 439 | int mmci_dmae_prep_data(struct mmci_host *host, struct mmc_data *data, |
434 | bool next); | 440 | bool next); |