Lines Matching +full:mtd +full:- +full:ram

1 // SPDX-License-Identifier: GPL-2.0-only
3 * PISMO memory driver - http://www.pismoworld.org/
14 #include <linux/mtd/physmap.h>
15 #include <linux/mtd/plat-ram.h>
16 #include <linux/mtd/pismo.h>
52 struct i2c_client *client = to_i2c_client(pdev->dev.parent); in pismo_set_vpp()
55 pismo->vpp(pismo->vpp_data, on); in pismo_set_vpp()
72 .addr = client->addr, in pismo_eeprom_read()
76 .addr = client->addr, in pismo_eeprom_read()
83 ret = i2c_transfer(client->adapter, msg, ARRAY_SIZE(msg)); in pismo_eeprom_read()
85 return ret == ARRAY_SIZE(msg) ? size : -EIO; in pismo_eeprom_read()
94 phys_addr_t base = region->base; in pismo_add_device()
98 return -ENXIO; in pismo_add_device()
101 res.end = base + region->size - 1; in pismo_add_device()
106 return -ENOMEM; in pismo_add_device()
107 dev->dev.parent = &pismo->client->dev; in pismo_add_device()
122 pismo->dev[i] = dev; in pismo_add_device()
134 .width = region->width, in pismo_add_nor()
137 if (pismo->vpp) in pismo_add_nor()
140 return pismo_add_device(pismo, i, region, "physmap-flash", in pismo_add_nor()
148 .bankwidth = region->width, in pismo_add_sram()
151 return pismo_add_device(pismo, i, region, "mtd-ram", in pismo_add_sram()
158 struct device *dev = &pismo->client->dev; in pismo_add_one()
162 region.type = cs->type; in pismo_add_one()
163 region.width = pismo_width_to_bytes(cs->width); in pismo_add_one()
164 region.access = le16_to_cpu(cs->access); in pismo_add_one()
165 region.size = le32_to_cpu(cs->size); in pismo_add_one()
168 dev_err(dev, "cs%u: bad width: %02x, ignoring\n", i, cs->width); in pismo_add_one()
179 i, cs->device, region.type, region.access, region.size / 1024); in pismo_add_one()
192 /* static RAM */ in pismo_add_one()
203 for (i = 0; i < ARRAY_SIZE(pismo->dev); i++) in pismo_remove()
204 platform_device_unregister(pismo->dev[i]); in pismo_remove()
211 struct pismo_pdata *pdata = client->dev.platform_data; in pismo_probe()
216 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { in pismo_probe()
217 dev_err(&client->dev, "functionality mismatch\n"); in pismo_probe()
218 return -EIO; in pismo_probe()
223 return -ENOMEM; in pismo_probe()
225 pismo->client = client; in pismo_probe()
227 pismo->vpp = pdata->set_vpp; in pismo_probe()
228 pismo->vpp_data = pdata->vpp_data; in pismo_probe()
234 dev_err(&client->dev, "error reading EEPROM: %d\n", ret); in pismo_probe()
238 dev_info(&client->dev, "%.15s board found\n", eeprom.board); in pismo_probe()
243 pdata->cs_addrs[i]); in pismo_probe()