From e9aea028119afd0858e77989dd1a4ecc21d30dc1 Mon Sep 17 00:00:00 2001
From: vauban353 <vauban353@gmail.com>
Date: Sun, 6 Aug 2023 11:13:27 +0100
Subject: [PATCH 7/8] MMC SPI: Hack to support non DMA capable SPI ctrl.

---
 drivers/mmc/host/mmc_spi.c | 6 +++++-
 drivers/spi/internals.h    | 3 +++
 drivers/spi/spi.c          | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index cc333ad67..fb45c7fa4 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -29,6 +29,9 @@
 
 #include <asm/unaligned.h>
 
+//<CJ>:
+#undef CONFIG_HAS_DMA
+//#define DEBUG 1
 
 /* NOTES:
  *
@@ -1375,7 +1378,8 @@ static int mmc_spi_probe(struct spi_device *spi)
 	 * that's the only reason not to use a few MHz for f_min (until
 	 * the upper layer reads the target frequency from the CSD).
 	 */
-	mmc->f_min = 400000;
+//<CJ>	mmc->f_min = 400000;
+	mmc->f_min = 5000000;
 	mmc->f_max = spi->max_speed_hz;
 
 	host = mmc_priv(mmc);
diff --git a/drivers/spi/internals.h b/drivers/spi/internals.h
index 4a28a8395..c49350240 100644
--- a/drivers/spi/internals.h
+++ b/drivers/spi/internals.h
@@ -12,6 +12,9 @@
 #ifndef __LINUX_SPI_INTERNALS_H
 #define __LINUX_SPI_INTERNALS_H
 
+//<CJ>:
+#undef CONFIG_HAS_DMA
+
 #include <linux/device.h>
 #include <linux/dma-direction.h>
 #include <linux/scatterlist.h>
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index a221478e5..e198049cc 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -42,6 +42,9 @@ EXPORT_TRACEPOINT_SYMBOL(spi_transfer_stop);
 
 #include "internals.h"
 
+//<CJ>:
+#undef CONFIG_HAS_DMA
+
 static DEFINE_IDR(spi_master_idr);
 
 static void spidev_release(struct device *dev)
-- 
2.39.2