linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/6] SPI omap2_mcspi: Add max_clk_div field to mcspi platform config
@ 2010-03-12 15:21 Scott Ellis
  2010-03-12 17:21 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Ellis @ 2010-03-12 15:21 UTC (permalink / raw)
  To: linux-arm-kernel

The McSPI_CHxCONF.CLKD register field has different limits for the
OMAP3 then the OMAP24xx. As per recommendation from the linux-omap
list, added a field for max_clk_div to the platform data for use in 
omap2_mcspi.c.

Used in a subsequent patch. 

Signed-off-by: Scott Ellis <scott@jumpnowtek.com>

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

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 23e4d77..d4ad126 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -302,6 +302,11 @@ static inline void omap_init_sti(void) {}
 
 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
 	.num_cs		= 4,
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
+	.max_clk_div	= 0x0c,
+#else
+	.max_clk_div	= 0x0f,
+#endif
 };
 
 static struct resource omap2_mcspi1_resources[] = {
@@ -324,6 +329,11 @@ static struct platform_device omap2_mcspi1 = {
 
 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
 	.num_cs		= 2,
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
+	.max_clk_div	= 0x0c,
+#else
+	.max_clk_div	= 0x0f,
+#endif
 };
 
 static struct resource omap2_mcspi2_resources[] = {
@@ -348,6 +358,11 @@ static struct platform_device omap2_mcspi2 = {
 	defined(CONFIG_ARCH_OMAP4)
 static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
 	.num_cs		= 2,
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
+	.max_clk_div	= 0x0c,
+#else
+	.max_clk_div	= 0x0f,
+#endif
 };
 
 static struct resource omap2_mcspi3_resources[] = {
@@ -372,6 +387,7 @@ static struct platform_device omap2_mcspi3 = {
 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
 	.num_cs		= 1,
+	.max_clk_div	= 0x0c,
 };
 
 static struct resource omap2_mcspi4_resources[] = {
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 {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/6] SPI omap2_mcspi: Add max_clk_div field to mcspi platform config
  2010-03-12 15:21 [PATCH 2/6] SPI omap2_mcspi: Add max_clk_div field to mcspi platform config Scott Ellis
@ 2010-03-12 17:21 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2010-03-12 17:21 UTC (permalink / raw)
  To: linux-arm-kernel

* Scott Ellis <scott@jumpnowtek.com> [100312 07:20]:
> The McSPI_CHxCONF.CLKD register field has different limits for the
> OMAP3 then the OMAP24xx. As per recommendation from the linux-omap
> list, added a field for max_clk_div to the platform data for use in 
> omap2_mcspi.c.
> 
> Used in a subsequent patch. 
> 
> Signed-off-by: Scott Ellis <scott@jumpnowtek.com>
> 
>  arch/arm/mach-omap2/devices.c           |   16 ++++++++++++++++
>  arch/arm/plat-omap/include/plat/mcspi.h |    1 +
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 23e4d77..d4ad126 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -302,6 +302,11 @@ static inline void omap_init_sti(void) {}
>  
>  static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
>  	.num_cs		= 4,
> +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
> +	.max_clk_div	= 0x0c,
> +#else
> +	.max_clk_div	= 0x0f,
> +#endif
>  };
>  

Can't do ifdef else like this. It will break multi-omap booting on
omap2 + 3 + 4. In the platform init just set the values once with
cpu_is_omapXXXX() instead.

Regards,

Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-12 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-12 15:21 [PATCH 2/6] SPI omap2_mcspi: Add max_clk_div field to mcspi platform config Scott Ellis
2010-03-12 17:21 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).