diff mbox series

[U-Boot] mmc: synchronize the sequence with enum bus_mode in mmc.h

Message ID 20180130051016.18000-1-jh80.chung@samsung.com
State Accepted
Commit 1b313aa3e33de09db7b48de5d325fd22e73e1f47
Delegated to: Jaehoon Chung
Headers show
Series [U-Boot] mmc: synchronize the sequence with enum bus_mode in mmc.h | expand

Commit Message

Jaehoon Chung Jan. 30, 2018, 5:10 a.m. UTC
If some configs are disabled, number of freqs array will not assigned to
correct value with bus_mode.
Synchornize the ordering with enum bus_mode in mmc.h.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/mmc.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Jaehoon Chung Feb. 23, 2018, 7 a.m. UTC | #1
On 01/30/2018 02:10 PM, Jaehoon Chung wrote:
> If some configs are disabled, number of freqs array will not assigned to
> correct value with bus_mode.
> Synchornize the ordering with enum bus_mode in mmc.h.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>

Applied to u-boot-mmc.

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/mmc.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 255310a8e6..81b35bbf77 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -181,23 +181,18 @@ const char *mmc_mode_name(enum bus_mode mode)
>  static uint mmc_mode2freq(struct mmc *mmc, enum bus_mode mode)
>  {
>  	static const int freqs[] = {
> +	      [MMC_LEGACY]	= 25000000,
>  	      [SD_LEGACY]	= 25000000,
>  	      [MMC_HS]		= 26000000,
>  	      [SD_HS]		= 50000000,
> -#if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT)
> +	      [MMC_HS_52]	= 52000000,
> +	      [MMC_DDR_52]	= 52000000,
>  	      [UHS_SDR12]	= 25000000,
>  	      [UHS_SDR25]	= 50000000,
>  	      [UHS_SDR50]	= 100000000,
>  	      [UHS_DDR50]	= 50000000,
> -#ifdef MMC_SUPPORTS_TUNING
>  	      [UHS_SDR104]	= 208000000,
> -#endif
> -#endif
> -	      [MMC_HS_52]	= 52000000,
> -	      [MMC_DDR_52]	= 52000000,
> -#if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
>  	      [MMC_HS_200]	= 200000000,
> -#endif
>  	};
>  
>  	if (mode == MMC_LEGACY)
>
diff mbox series

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 255310a8e6..81b35bbf77 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -181,23 +181,18 @@  const char *mmc_mode_name(enum bus_mode mode)
 static uint mmc_mode2freq(struct mmc *mmc, enum bus_mode mode)
 {
 	static const int freqs[] = {
+	      [MMC_LEGACY]	= 25000000,
 	      [SD_LEGACY]	= 25000000,
 	      [MMC_HS]		= 26000000,
 	      [SD_HS]		= 50000000,
-#if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT)
+	      [MMC_HS_52]	= 52000000,
+	      [MMC_DDR_52]	= 52000000,
 	      [UHS_SDR12]	= 25000000,
 	      [UHS_SDR25]	= 50000000,
 	      [UHS_SDR50]	= 100000000,
 	      [UHS_DDR50]	= 50000000,
-#ifdef MMC_SUPPORTS_TUNING
 	      [UHS_SDR104]	= 208000000,
-#endif
-#endif
-	      [MMC_HS_52]	= 52000000,
-	      [MMC_DDR_52]	= 52000000,
-#if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
 	      [MMC_HS_200]	= 200000000,
-#endif
 	};
 
 	if (mode == MMC_LEGACY)