@@ -98,6 +98,7 @@ static unsigned write_timeout = 25;
9898module_param (write_timeout , uint , 0 );
9999MODULE_PARM_DESC (write_timeout , "Time (in ms) to try writes (default 25)" );
100100
101+ static struct kobject * eeprom_kobj ;
101102#define AT24_SIZE_BYTELEN 5
102103#define AT24_SIZE_FLAGS 8
103104
@@ -293,6 +294,13 @@ static ssize_t at24_bin_read(struct file *filp, struct kobject *kobj,
293294 return at24_read (at24 , buf , off , count );
294295}
295296
297+ void at24_read_eeprom (char * buf , loff_t off , size_t count )
298+ {
299+ struct at24_data * at24 ;
300+
301+ at24 = dev_get_drvdata (container_of (eeprom_kobj , struct device , kobj ));
302+ at24_read (at24 , buf , off , count );
303+ }
296304
297305/*
298306 * Note that if the hardware write-protect pin is pulled high, the whole
@@ -631,6 +639,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
631639 if (err )
632640 goto err_clients ;
633641
642+ eeprom_kobj = & client -> dev .kobj ;
634643 i2c_set_clientdata (client , at24 );
635644
636645 dev_info (& client -> dev , "%zu byte %s EEPROM, %s, %u bytes/write\n" ,
0 commit comments