Lines Matching +full:data +full:- +full:width

1 // SPDX-License-Identifier: GPL-2.0-only
3 * PISMO memory driver - http://www.pismoworld.org/
15 #include <linux/mtd/plat-ram.h>
22 u8 width; member
39 u8 width; member
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()
58 static unsigned int pismo_width_to_bytes(unsigned int width) in pismo_width_to_bytes() argument
60 width &= 15; in pismo_width_to_bytes()
61 if (width > 2) in pismo_width_to_bytes()
63 return 1 << width; in pismo_width_to_bytes()
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()
133 struct physmap_flash_data data = { in pismo_add_nor() local
134 .width = region->width, in pismo_add_nor()
137 if (pismo->vpp) in pismo_add_nor()
138 data.set_vpp = pismo_set_vpp; in pismo_add_nor()
140 return pismo_add_device(pismo, i, region, "physmap-flash", in pismo_add_nor()
141 &data, sizeof(data)); in pismo_add_nor()
147 struct platdata_mtd_ram data = { in pismo_add_sram() local
148 .bankwidth = region->width, in pismo_add_sram()
151 return pismo_add_device(pismo, i, region, "mtd-ram", in pismo_add_sram()
152 &data, sizeof(data)); 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()
167 if (region.width == 0) { 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()
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()