diff options
author | Ludovic Barre <ludovic.barre@st.com> | 2019-03-27 05:05:29 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2019-04-15 05:55:54 -0400 |
commit | b3fb9d64b497b890f7b779a9f0b40b5cc269ea18 (patch) | |
tree | 2f9e93962dbec2e9f17846927a134a71aa2e3735 | |
parent | 0732ea75de09f0816f0604e46116ca111bc309d6 (diff) |
mmc: mmci: define get_dctrl_cfg for legacy variant
This patch defines get_dctrl_cfg callback for legacy variants
whatever DMA_ENGINE configuration.
Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
[Ulf: Fixed a build error]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/mmci.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 9e6a2c1aecd6..231ad5d85f22 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -46,11 +46,8 @@ | |||
46 | 46 | ||
47 | #define DRIVER_NAME "mmci-pl18x" | 47 | #define DRIVER_NAME "mmci-pl18x" |
48 | 48 | ||
49 | #ifdef CONFIG_DMA_ENGINE | ||
50 | static void mmci_variant_init(struct mmci_host *host); | 49 | static void mmci_variant_init(struct mmci_host *host); |
51 | #else | 50 | static void ux500v2_variant_init(struct mmci_host *host); |
52 | static inline void mmci_variant_init(struct mmci_host *host) {} | ||
53 | #endif | ||
54 | 51 | ||
55 | static unsigned int fmax = 515633; | 52 | static unsigned int fmax = 515633; |
56 | 53 | ||
@@ -231,7 +228,7 @@ static struct variant_data variant_ux500v2 = { | |||
231 | .irq_pio_mask = MCI_IRQ_PIO_MASK, | 228 | .irq_pio_mask = MCI_IRQ_PIO_MASK, |
232 | .start_err = MCI_STARTBITERR, | 229 | .start_err = MCI_STARTBITERR, |
233 | .opendrain = MCI_OD, | 230 | .opendrain = MCI_OD, |
234 | .init = mmci_variant_init, | 231 | .init = ux500v2_variant_init, |
235 | }; | 232 | }; |
236 | 233 | ||
237 | static struct variant_data variant_stm32 = { | 234 | static struct variant_data variant_stm32 = { |
@@ -617,6 +614,16 @@ static void mmci_init_sg(struct mmci_host *host, struct mmc_data *data) | |||
617 | sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags); | 614 | sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags); |
618 | } | 615 | } |
619 | 616 | ||
617 | static u32 mmci_get_dctrl_cfg(struct mmci_host *host) | ||
618 | { | ||
619 | return MCI_DPSM_ENABLE | mmci_dctrl_blksz(host); | ||
620 | } | ||
621 | |||
622 | static u32 ux500v2_get_dctrl_cfg(struct mmci_host *host) | ||
623 | { | ||
624 | return MCI_DPSM_ENABLE | (host->data->blksz << 16); | ||
625 | } | ||
626 | |||
620 | /* | 627 | /* |
621 | * All the DMA operation mode stuff goes inside this ifdef. | 628 | * All the DMA operation mode stuff goes inside this ifdef. |
622 | * This assumes that you have a generic DMA device interface, | 629 | * This assumes that you have a generic DMA device interface, |
@@ -941,6 +948,7 @@ void mmci_dmae_unprep_data(struct mmci_host *host, | |||
941 | static struct mmci_host_ops mmci_variant_ops = { | 948 | static struct mmci_host_ops mmci_variant_ops = { |
942 | .prep_data = mmci_dmae_prep_data, | 949 | .prep_data = mmci_dmae_prep_data, |
943 | .unprep_data = mmci_dmae_unprep_data, | 950 | .unprep_data = mmci_dmae_unprep_data, |
951 | .get_datactrl_cfg = mmci_get_dctrl_cfg, | ||
944 | .get_next_data = mmci_dmae_get_next_data, | 952 | .get_next_data = mmci_dmae_get_next_data, |
945 | .dma_setup = mmci_dmae_setup, | 953 | .dma_setup = mmci_dmae_setup, |
946 | .dma_release = mmci_dmae_release, | 954 | .dma_release = mmci_dmae_release, |
@@ -948,12 +956,22 @@ static struct mmci_host_ops mmci_variant_ops = { | |||
948 | .dma_finalize = mmci_dmae_finalize, | 956 | .dma_finalize = mmci_dmae_finalize, |
949 | .dma_error = mmci_dmae_error, | 957 | .dma_error = mmci_dmae_error, |
950 | }; | 958 | }; |
959 | #else | ||
960 | static struct mmci_host_ops mmci_variant_ops = { | ||
961 | .get_datactrl_cfg = mmci_get_dctrl_cfg, | ||
962 | }; | ||
963 | #endif | ||
951 | 964 | ||
952 | void mmci_variant_init(struct mmci_host *host) | 965 | void mmci_variant_init(struct mmci_host *host) |
953 | { | 966 | { |
954 | host->ops = &mmci_variant_ops; | 967 | host->ops = &mmci_variant_ops; |
955 | } | 968 | } |
956 | #endif | 969 | |
970 | void ux500v2_variant_init(struct mmci_host *host) | ||
971 | { | ||
972 | host->ops = &mmci_variant_ops; | ||
973 | host->ops->get_datactrl_cfg = ux500v2_get_dctrl_cfg; | ||
974 | } | ||
957 | 975 | ||
958 | static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq) | 976 | static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq) |
959 | { | 977 | { |