Commit dbc1ab9c authored by Divagar Mohandass's avatar Divagar Mohandass Committed by Wolfram Sang

eeprom: at24: add support to fetch eeprom device property "size"

Obtain the size of the EEPROM chip from DT if the "size" property is
specified for the device.
Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarDivagar Mohandass <divagar.mohandass@intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent f2f5afd3
......@@ -570,6 +570,10 @@ static void at24_get_pdata(struct device *dev, struct at24_platform_data *chip)
if (device_property_present(dev, "read-only"))
chip->flags |= AT24_FLAG_READONLY;
err = device_property_read_u32(dev, "size", &val);
if (!err)
chip->byte_len = val;
err = device_property_read_u32(dev, "pagesize", &val);
if (!err) {
chip->page_size = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment