For your first question, the interface to the driver is not through char or block, it is through the sysfs. A file will be created in the sysfs and when you access this file the read and write functions will be called. read/write functions are registered with the sysfs like this:
sysfs_bin_attr_init(&at24->bin);
at24->bin.attr.name = "eeprom";
at24->bin.attr.mode = chip.flags & AT24_FLAG_IRUGO ? S_IRUGO : S_IRUSR;
at24->bin.read = at24_bin_read;
at24->bin.size = chip.byte_len;
at24->bin.write = at24_bin_write;
at24->bin.attr.mode |= S_IWUSR;
err = sysfs_create_bin_file(&client->dev.kobj, &at24->bin);
A file with name 'eeprom' will be created in the sysfs.
byte_len will be size of eeprom in bytes and page_size will be page size in bytes for writes.
|