Merge tag 'trace-v5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[sfrench/cifs-2.6.git] / arch / arm / mach-davinci / board-da850-evm.c
index e1a949b47306d2eaf93a14b76e0ac720373e1c10..44bca048dfd0d5d75b65954d5a178308f036469c 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/kernel.h>
 #include <linux/leds.h>
 #include <linux/i2c.h>
-#include <linux/platform_data/at24.h>
 #include <linux/platform_data/pca953x.h>
 #include <linux/input.h>
 #include <linux/input/tps6507x-ts.h>
@@ -28,6 +27,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/nvmem-provider.h>
 #include <linux/mtd/physmap.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/gpio-davinci.h>
@@ -100,6 +100,31 @@ static struct mtd_partition da850evm_spiflash_part[] = {
        },
 };
 
+static struct nvmem_cell_info da850evm_nvmem_cells[] = {
+       {
+               .name           = "macaddr",
+               .offset         = 0x0,
+               .bytes          = ETH_ALEN,
+       }
+};
+
+static struct nvmem_cell_table da850evm_nvmem_cell_table = {
+       /*
+        * The nvmem name differs from the partition name because of the
+        * internal works of the nvmem framework.
+        */
+       .nvmem_name     = "MAC-Address0",
+       .cells          = da850evm_nvmem_cells,
+       .ncells         = ARRAY_SIZE(da850evm_nvmem_cells),
+};
+
+static struct nvmem_cell_lookup da850evm_nvmem_cell_lookup = {
+       .nvmem_name     = "MAC-Address0",
+       .cell_name      = "macaddr",
+       .dev_id         = "davinci_emac.1",
+       .con_id         = "mac-address",
+};
+
 static struct flash_platform_data da850evm_spiflash_data = {
        .name           = "m25p80",
        .parts          = da850evm_spiflash_part,
@@ -780,9 +805,9 @@ static struct gpiod_lookup_table mmc_gpios_table = {
        .dev_id = "da830-mmc.0",
        .table = {
                /* gpio chip 2 contains gpio range 64-95 */
-               GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd",
+               GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_CD_PIN, "cd",
                            GPIO_ACTIVE_LOW),
-               GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_WP_PIN, "wp",
+               GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_WP_PIN, "wp",
                            GPIO_ACTIVE_HIGH),
        },
 };
@@ -1395,6 +1420,9 @@ static __init void da850_evm_init(void)
 
        davinci_serial_init(da8xx_serial_device);
 
+       nvmem_add_cell_table(&da850evm_nvmem_cell_table);
+       nvmem_add_cell_lookups(&da850evm_nvmem_cell_lookup, 1);
+
        i2c_register_board_info(1, da850_evm_i2c_devices,
                        ARRAY_SIZE(da850_evm_i2c_devices));