Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;