11 #include <linux/module.h>
12 #include <linux/i2c.h>
13 #include <linux/slab.h>
21 #define PISMO_NUM_CS 5
56 struct pismo_data *pismo = i2c_get_clientdata(client);
61 static unsigned int __devinit pismo_width_to_bytes(
unsigned int width)
103 res.
end = base + region->
size - 1;
136 .width = region->
width,
142 return pismo_add_device(pismo, i, region,
"physmap-flash",
143 &data,
sizeof(data));
150 .bankwidth = region->
width,
153 return pismo_add_device(pismo, i, region,
"mtd-ram",
154 &data,
sizeof(data));
165 region.
width = pismo_width_to_bytes(cs->
width);
169 if (region.
width == 0) {
170 dev_err(dev,
"cs%u: bad width: %02x, ignoring\n", i, cs->
width);
180 dev_info(dev,
"cs%u: %.32s: type %02x access %u00ps size %uK\n",
183 switch (region.
type) {
191 pismo_add_nor(pismo, i, ®ion);
195 pismo_add_sram(pismo, i, ®ion);
202 struct pismo_data *pismo = i2c_get_clientdata(client);
223 dev_err(&client->
dev,
"functionality mismatch\n");
236 i2c_set_clientdata(client, pismo);
238 ret = pismo_eeprom_read(client, &
eeprom, 0,
sizeof(
eeprom));
240 dev_err(&client->
dev,
"error reading EEPROM: %d\n", ret);
247 if (
eeprom.cs[i].type != 0xff)
248 pismo_add_one(pismo, i, &
eeprom.cs[i],
269 .probe = pismo_probe,
271 .id_table = pismo_id,
274 static int __init pismo_init(
void)
279 return i2c_add_driver(&pismo_driver);
283 static void __exit pismo_exit(
void)