diff mbox

DaVinci: DM646x: Enable SPI on the DM646x EVM

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

Commit Message

s-paulraj@ti.com July 15, 2009, 3:28 p.m. UTC
From: Sandeep Paulraj <s-paulraj@ti.com>

The patch initializes the EEPROM connected to
SPI on the DM646x EVM

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
 arch/arm/mach-davinci/board-dm646x-evm.c |   22 ++++++++++++++++++++++
 1 files changed, 22 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 575c6ca..6f2f383 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -33,6 +33,8 @@ 
 #include <linux/i2c/at24.h>
 #include <linux/i2c/pcf857x.h>
 #include <linux/etherdevice.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/eeprom.h>
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -265,6 +267,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_1,
+	},
+};
+
 static __init void evm_init(void)
 {
 	struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -276,6 +296,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;
+
+	dm646x_init_spi0(dm646x_evm_spi_info, ARRAY_SIZE(dm646x_evm_spi_info));
 }
 
 static __init void davinci_dm646x_evm_irq_init(void)