aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Paulraj <s-paulraj@ti.com>2010-02-01 09:51:45 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2010-03-01 13:20:24 -0500
commit5f19daa16ffca55db5b0253eba2bd0f71ee7f7f4 (patch)
treebc1c899b166e57b132af35a3cf94be5c511ef70c
parenta3e13e89d6658042fdfd50a7bf7564e81e6ce689 (diff)
DaVinci DM365: Adding support for SPI EEPROM
The DM365 Spectrum Digital EVM comes with an EEPROM connected to SPI0. This patch adds support for the SPI EEPROM. Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 38e9033d2e86..d15beceb632e 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -24,6 +24,8 @@
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/mtd/nand.h> 25#include <linux/mtd/nand.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/spi/spi.h>
28#include <linux/spi/eeprom.h>
27 29
28#include <asm/mach-types.h> 30#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -571,6 +573,24 @@ static void __init dm365_evm_map_io(void)
571 dm365_init(); 573 dm365_init();
572} 574}
573 575
576static struct spi_eeprom at25640 = {
577 .byte_len = SZ_64K / 8,
578 .name = "at25640",
579 .page_size = 32,
580 .flags = EE_ADDR2,
581};
582
583static struct spi_board_info dm365_evm_spi_info[] __initconst = {
584 {
585 .modalias = "at25",
586 .platform_data = &at25640,
587 .max_speed_hz = 10 * 1000 * 1000,
588 .bus_num = 0,
589 .chip_select = 0,
590 .mode = SPI_MODE_0,
591 },
592};
593
574static __init void dm365_evm_init(void) 594static __init void dm365_evm_init(void)
575{ 595{
576 evm_init_i2c(); 596 evm_init_i2c();
@@ -587,6 +607,9 @@ static __init void dm365_evm_init(void)
587 dm365_init_asp(&dm365_evm_snd_data); 607 dm365_init_asp(&dm365_evm_snd_data);
588 dm365_init_rtc(); 608 dm365_init_rtc();
589 dm365_init_ks(&dm365evm_ks_data); 609 dm365_init_ks(&dm365evm_ks_data);
610
611 dm365_init_spi0(BIT(0), dm365_evm_spi_info,
612 ARRAY_SIZE(dm365_evm_spi_info));
590} 613}
591 614
592static __init void dm365_evm_irq_init(void) 615static __init void dm365_evm_irq_init(void)