提交 6a7836ba 编写于 作者: B Bartosz Golaszewski 提交者: Shawn Guo

ARM: imx: pca100: use device properties for at24 eeprom

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. Specify the exact model instead of the "at24"
wildcard and drop the byte_len/size property, as the model name already
implies the EEPROM's size.
Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
Acked-by: NSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: NShawn Guo <shawnguo@kernel.org>
上级 452fd3b8
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/platform_data/at24.h> #include <linux/property.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/eeprom.h> #include <linux/spi/eeprom.h>
...@@ -168,16 +168,15 @@ static const struct imxi2c_platform_data pca100_i2c1_data __initconst = { ...@@ -168,16 +168,15 @@ static const struct imxi2c_platform_data pca100_i2c1_data __initconst = {
.bitrate = 100000, .bitrate = 100000,
}; };
static struct at24_platform_data board_eeprom = { static const struct property_entry board_eeprom_properties[] = {
.byte_len = 4096, PROPERTY_ENTRY_U32("pagesize", 32),
.page_size = 32, { }
.flags = AT24_FLAG_ADDR16,
}; };
static struct i2c_board_info pca100_i2c_devices[] = { static struct i2c_board_info pca100_i2c_devices[] = {
{ {
I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ I2C_BOARD_INFO("24c32", 0x52), /* E0=0, E1=1, E2=0 */
.platform_data = &board_eeprom, .properties = board_eeprom_properties,
}, { }, {
I2C_BOARD_INFO("pcf8563", 0x51), I2C_BOARD_INFO("pcf8563", 0x51),
}, { }, {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册