0018-mmc-skip-select_mode_and_width-for-MMC-SPI-host.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 9d81a06f0812021d13f5ff1aed7b37f04ea36f1b Mon Sep 17 00:00:00 2001
  2. From: Anup Patel <anup.patel@wdc.com>
  3. Date: Thu, 27 Jun 2019 13:08:09 +0530
  4. Subject: [PATCH 18/21] mmc: skip select_mode_and_width for MMC SPI host
  5. The MMC mode and width are fixed for MMC SPI host hence we skip
  6. sd_select_mode_and_width() and mmc_select_mode_and_width() for
  7. MMC SPI host.
  8. Signed-off-by: Anup Patel <anup.patel@wdc.com>
  9. Upstream-Status: Submitted
  10. ---
  11. drivers/mmc/mmc.c | 14 ++++++++++++++
  12. 1 file changed, 14 insertions(+)
  13. diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
  14. index 456c1b4cc9..95008c72c3 100644
  15. --- a/drivers/mmc/mmc.c
  16. +++ b/drivers/mmc/mmc.c
  17. @@ -1672,6 +1672,13 @@ static int sd_select_mode_and_width(struct mmc *mmc, uint card_caps)
  18. mmc_dump_capabilities("host", mmc->host_caps);
  19. #endif
  20. + if (mmc_host_is_spi(mmc)) {
  21. + mmc_set_bus_width(mmc, 1);
  22. + mmc_select_mode(mmc, SD_LEGACY);
  23. + mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE);
  24. + return 0;
  25. + }
  26. +
  27. /* Restrict card's capabilities by what the host can do */
  28. caps = card_caps & mmc->host_caps;
  29. @@ -1934,6 +1941,13 @@ static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps)
  30. mmc_dump_capabilities("host", mmc->host_caps);
  31. #endif
  32. + if (mmc_host_is_spi(mmc)) {
  33. + mmc_set_bus_width(mmc, 1);
  34. + mmc_select_mode(mmc, MMC_LEGACY);
  35. + mmc_set_clock(mmc, mmc->tran_speed, MMC_CLK_ENABLE);
  36. + return 0;
  37. + }
  38. +
  39. /* Restrict card's capabilities by what the host can do */
  40. card_caps &= mmc->host_caps;
  41. --
  42. 2.22.0