]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/board-sam9260ek.c
[ARM] 5257/2: [AT91] Use SZ_ definitions and MTDPART_OFS_NXTBLK instead of hex-values
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / board-sam9260ek.c
index daf93a5880689b0ce03f214ca0e5401e9de4884c..e22433d5dfb63cd407427983aaacf946eb36fcac 100644 (file)
@@ -27,8 +27,8 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/at73c213.h>
 #include <linux/clk.h>
+#include <linux/i2c/at24.h>
 
-#include <asm/hardware.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/irq.h>
@@ -37,8 +37,9 @@
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
+#include <mach/hardware.h>
+#include <mach/board.h>
+#include <mach/gpio.h>
 
 #include "generic.h"
 
@@ -163,11 +164,11 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
        {
                .name   = "Partition 1",
                .offset = 0,
-               .size   = 256 * 1024,
+               .size   = SZ_256K,
        },
        {
                .name   = "Partition 2",
-               .offset = 256 * 1024,
+               .offset = MTDPART_OFS_NXTBLK,
                .size   = MTDPART_SIZ_FULL,
        },
 };
@@ -222,6 +223,23 @@ static struct gpio_led ek_leds[] = {
        }
 };
 
+/*
+ * I2C devices
+ */
+static struct at24_platform_data at24c512 = {
+       .byte_len       = SZ_512K / 8,
+       .page_size      = 128,
+       .flags          = AT24_FLAG_ADDR16,
+};
+
+static struct i2c_board_info __initdata ek_i2c_devices[] = {
+       {
+               I2C_BOARD_INFO("24c512", 0x50),
+               .platform_data = &at24c512,
+       },
+       /* more devices can be added using expansion connectors */
+};
+
 static void __init ek_board_init(void)
 {
        /* Serial */
@@ -239,7 +257,7 @@ static void __init ek_board_init(void)
        /* MMC */
        at91_add_device_mmc(0, &ek_mmc_data);
        /* I2C */
-       at91_add_device_i2c(NULL, 0);
+       at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
        /* SSC (to AT73C213) */
        at73c213_set_clk(&at73c213_data);
        at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);