提交 dbc1ab9c 编写于 作者: D Divagar Mohandass 提交者: 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: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: NDivagar Mohandass <divagar.mohandass@intel.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册