[PATCH 2/6 Revised] SPI omap2_mcspi: Add max_clk_div field to mcspi platform config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The McSPI_CHxCONF.CLKD register field has different limits for
the OMAP3 then the OMAP24xx. New max_clk_div field added to
mcspi platform config structure to keep track of this.

Revised patch to not break multi-omap booting.

Signed-off-by: Scott Ellis <scott@xxxxxxxxxxxxxx>

 arch/arm/mach-omap2/devices.c           |   14 ++++++++++++++
 arch/arm/plat-omap/include/plat/mcspi.h |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d77..200f382 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -415,6 +415,11 @@ static inline void omap4_mcspi_fixup(void)
 	defined(CONFIG_ARCH_OMAP4)
 static inline void omap2_mcspi3_init(void)
 {
+	if (cpu_is_omap343x() || cpu_is_omap44xx())
+		omap2_mcspi3_config.max_clk_div = 0x0c;
+	else
+		omap2_mcspi3_config.max_clk_div = 0x0f;
+
 	platform_device_register(&omap2_mcspi3);
 }
 #else
@@ -426,6 +431,7 @@ static inline void omap2_mcspi3_init(void)
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static inline void omap2_mcspi4_init(void)
 {
+	omap2_mcspi4_config.max_clk_div = 0x0c;
 	platform_device_register(&omap2_mcspi4);
 }
 #else
@@ -439,6 +445,14 @@ static void omap_init_mcspi(void)
 	if (cpu_is_omap44xx())
 		omap4_mcspi_fixup();
 
+	if (cpu_is_omap343x() || cpu_is_omap44xx()) {
+		omap2_mcspi1_config.max_clk_div = 0x0c;
+		omap2_mcspi2_config.max_clk_div = 0x0c;
+	} else {
+		omap2_mcspi1_config.max_clk_div = 0x0f;
+		omap2_mcspi2_config.max_clk_div = 0x0f;
+	}
+
 	platform_device_register(&omap2_mcspi1);
 	platform_device_register(&omap2_mcspi2);
 
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h
index 1254e49..9fadddd 100644
--- a/arch/arm/plat-omap/include/plat/mcspi.h
+++ b/arch/arm/plat-omap/include/plat/mcspi.h
@@ -3,6 +3,7 @@
 
 struct omap2_mcspi_platform_config {
 	unsigned short	num_cs;
+	unsigned short	max_clk_div;
 };
 
 struct omap2_mcspi_device_config {


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux