Commit 0090fa60 authored by Kevin Hilman's avatar Kevin Hilman

eeprom: undo at24 interface changes

Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 83b74c75
......@@ -53,7 +53,6 @@
struct at24_data {
struct at24_platform_data chip;
struct at24_iface iface;
bool use_smbus;
/*
......@@ -264,6 +263,13 @@ static ssize_t at24_bin_read(struct kobject *kobj, struct bin_attribute *attr,
}
/*
* REVISIT: export at24_bin{read,write}() to let other kernel code use
* eeprom data. For example, it might hold a board's Ethernet address, or
* board-specific calibration data generated on the manufacturing floor.
*/
/*
* Note that if the hardware write-protect pin is pulled high, the whole
* chip is normally write protected. But there are plenty of product
......@@ -380,30 +386,6 @@ static ssize_t at24_bin_write(struct kobject *kobj, struct bin_attribute *attr,
/*-------------------------------------------------------------------------*/
/*
* This lets other kernel code access the eeprom data. For example, it
* might hold a board's Ethernet address, or board-specific calibration
* data generated on the manufacturing floor.
*/
static ssize_t at24_iface_read(struct at24_iface *iface, char *buf,
off_t offset, size_t count)
{
struct at24_data *at24 = container_of(iface, struct at24_data, iface);
return at24_eeprom_read(at24, buf, offset, count);
}
static ssize_t at24_iface_write(struct at24_iface *iface, char *buf,
off_t offset, size_t count)
{
struct at24_data *at24 = container_of(iface, struct at24_data, iface);
return at24_eeprom_write(at24, buf, offset, count);
}
/*-------------------------------------------------------------------------*/
static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
struct at24_platform_data chip;
......@@ -431,9 +413,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
* is recommended anyhow.
*/
chip.page_size = 1;
chip.setup = NULL;
chip.context = NULL;
}
if (!is_power_of_2(chip.byte_len))
......@@ -470,9 +449,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
goto err_out;
}
at24->iface.read = at24_iface_read;
at24->iface.write = at24_iface_write;
mutex_init(&at24->lock);
at24->use_smbus = use_smbus;
at24->chip = chip;
......@@ -544,10 +520,6 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
at24->write_max,
use_smbus ? ", use_smbus" : "");
/* export data to kernel code */
if (chip.setup)
chip.setup(&at24->iface, chip.context);
return 0;
err_clients:
......
......@@ -15,13 +15,6 @@
* is bigger than what the chip actually supports!
*/
struct at24_iface {
ssize_t (*read)(struct at24_iface *, char *buf, off_t offset,
size_t count);
ssize_t (*write)(struct at24_iface *, char *buf, off_t offset,
size_t count);
};
struct at24_platform_data {
u32 byte_len; /* size (sum of all addr) */
u16 page_size; /* for writes */
......@@ -30,9 +23,6 @@ struct at24_platform_data {
#define AT24_FLAG_READONLY 0x40 /* sysfs-entry will be read-only */
#define AT24_FLAG_IRUGO 0x20 /* sysfs-entry will be world-readable */
#define AT24_FLAG_TAKE8ADDR 0x10 /* take always 8 addresses (24c00) */
int (*setup)(struct at24_iface *, void *context);
void *context;
};
#endif /* _LINUX_AT24_H */
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