diff mbox

[v2,6/6] DaVinci: DM646x: Adding support for SPI in DM646x EVM

Message ID 1251326737-13928-1-git-send-email-s-paulraj@ti.com (mailing list archive)
State Superseded
Headers show

Commit Message

s-paulraj@ti.com Aug. 26, 2009, 10:45 p.m. UTC
From: Sandeep Paulraj <s-paulraj@ti.com>

This patch adds support for SPI 0 that is connected to
EEPROM on the DM646x EVM.

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
 arch/arm/mach-davinci/board-dm646x-evm.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 434253e..0f99180 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -34,6 +34,9 @@ 
 #include <linux/i2c/pcf857x.h>
 #include <linux/etherdevice.h>
 #include <media/tvp514x.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/eeprom.h>
+
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -636,6 +639,24 @@  static void __init davinci_map_io(void)
 	dm646x_init();
 }
 
+static struct spi_eeprom at25640a = {
+	.byte_len	= SZ_64K / 2,
+	.name		= "at25640a",
+	.page_size	= 64,
+	.flags		= EE_ADDR2,
+};
+
+static struct spi_board_info dm646x_evm_spi_info[] __initconst = {
+	{
+		.modalias	= "at25",
+		.platform_data	= &at25640a,
+		.max_speed_hz	= 10 * 1000 * 1000,	/* at 3v3 */
+		.bus_num	= 0,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_0,
+	},
+};
+
 static __init void evm_init(void)
 {
 	struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -651,6 +672,8 @@  static __init void evm_init(void)
 	soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK;
 	soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY;
 	evm_init_video();
+
+	dm646x_init_spi0(dm646x_evm_spi_info, ARRAY_SIZE(dm646x_evm_spi_info));
 }
 
 static __init void davinci_dm646x_evm_irq_init(void)