]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: davinci: dm365-evm: use device properties for at24 eeprom
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 8 Jan 2019 09:15:30 +0000 (10:15 +0100)
committerSekhar Nori <nsekhar@ti.com>
Thu, 10 Jan 2019 08:27:59 +0000 (13:57 +0530)
We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/board-dm365-evm.c

index e3b0b701e3956fd88cfc29412ff2cec4828e1f12..f21dc8d3b28c1798d97da555c25d7ddd8310c049 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/i2c.h>
 #include <linux/io.h>
 #include <linux/clk.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/leds.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -225,18 +225,15 @@ static struct nvmem_cell_lookup davinci_nvmem_cell_lookup = {
        .con_id         = "mac-address",
 };
 
-static struct at24_platform_data eeprom_info = {
-       .byte_len       = (256*1024) / 8,
-       .page_size      = 64,
-       .flags          = AT24_FLAG_ADDR16,
-       .setup          = davinci_get_mac_addr,
-       .context        = (void *)0x7f00,
+static const struct property_entry eeprom_properties[] = {
+       PROPERTY_ENTRY_U32("pagesize", 64),
+       { }
 };
 
 static struct i2c_board_info i2c_info[] = {
        {
                I2C_BOARD_INFO("24c256", 0x50),
-               .platform_data  = &eeprom_info,
+               .properties = eeprom_properties,
        },
        {
                I2C_BOARD_INFO("tlv320aic3x", 0x18),