diff mbox

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

Message ID 1268587548.30878.11.camel@quad (mailing list archive)
State Rejected
Headers show

Commit Message

Scott Ellis March 14, 2010, 5:25 p.m. UTC
None
diff mbox

Patch

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 {