Lines Matching refs:map
23 int (*init)(struct pci_dev *dev, struct map_pci_info *map);
24 void (*exit)(struct pci_dev *dev, struct map_pci_info *map);
25 unsigned long (*translate)(struct map_pci_info *map, unsigned long ofs);
30 struct map_info map; member
32 void (*exit)(struct pci_dev *dev, struct map_pci_info *map);
33 unsigned long (*translate)(struct map_pci_info *map, unsigned long ofs);
39 struct map_pci_info *map = (struct map_pci_info *)_map; in mtd_pci_read8() local
41 val.x[0]= readb(map->base + map->translate(map, ofs)); in mtd_pci_read8()
47 struct map_pci_info *map = (struct map_pci_info *)_map; in mtd_pci_read32() local
49 val.x[0] = readl(map->base + map->translate(map, ofs)); in mtd_pci_read32()
55 struct map_pci_info *map = (struct map_pci_info *)_map; in mtd_pci_copyfrom() local
56 memcpy_fromio(to, map->base + map->translate(map, from), len); in mtd_pci_copyfrom()
61 struct map_pci_info *map = (struct map_pci_info *)_map; in mtd_pci_write8() local
62 writeb(val.x[0], map->base + map->translate(map, ofs)); in mtd_pci_write8()
67 struct map_pci_info *map = (struct map_pci_info *)_map; in mtd_pci_write32() local
68 writel(val.x[0], map->base + map->translate(map, ofs)); in mtd_pci_write32()
73 struct map_pci_info *map = (struct map_pci_info *)_map; in mtd_pci_copyto() local
74 memcpy_toio(map->base + map->translate(map, to), from, len); in mtd_pci_copyto()
88 intel_iq80310_init(struct pci_dev *dev, struct map_pci_info *map) in intel_iq80310_init() argument
92 map->map.bankwidth = 1; in intel_iq80310_init()
93 map->map.read = mtd_pci_read8; in intel_iq80310_init()
94 map->map.write = mtd_pci_write8; in intel_iq80310_init()
96 map->map.size = 0x00800000; in intel_iq80310_init()
97 map->base = ioremap(pci_resource_start(dev, 0), in intel_iq80310_init()
100 if (!map->base) in intel_iq80310_init()
110 map->map.map_priv_2 = win_base; in intel_iq80310_init()
116 intel_iq80310_exit(struct pci_dev *dev, struct map_pci_info *map) in intel_iq80310_exit() argument
118 if (map->base) in intel_iq80310_exit()
119 iounmap(map->base); in intel_iq80310_exit()
120 pci_write_config_dword(dev, 0x44, map->map.map_priv_2); in intel_iq80310_exit()
124 intel_iq80310_translate(struct map_pci_info *map, unsigned long ofs) in intel_iq80310_translate() argument
133 writel(0x00000008, map->base + 0x1558); in intel_iq80310_translate()
134 writel(0x00000000, map->base + 0x1550); in intel_iq80310_translate()
136 writel(0x00000007, map->base + 0x1558); in intel_iq80310_translate()
137 writel(0x00800000, map->base + 0x1550); in intel_iq80310_translate()
156 intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map) in intel_dc21285_init() argument
187 map->map.bankwidth = 4; in intel_dc21285_init()
188 map->map.read = mtd_pci_read32; in intel_dc21285_init()
189 map->map.write = mtd_pci_write32; in intel_dc21285_init()
190 map->map.size = len; in intel_dc21285_init()
191 map->base = ioremap(base, len); in intel_dc21285_init()
193 if (!map->base) in intel_dc21285_init()
200 intel_dc21285_exit(struct pci_dev *dev, struct map_pci_info *map) in intel_dc21285_exit() argument
202 if (map->base) in intel_dc21285_exit()
203 iounmap(map->base); in intel_dc21285_exit()
212 intel_dc21285_translate(struct map_pci_info *map, unsigned long ofs) in intel_dc21285_translate() argument
255 struct map_pci_info *map = NULL; in mtd_pci_probe() local
267 map = kmalloc(sizeof(*map), GFP_KERNEL); in mtd_pci_probe()
269 if (!map) in mtd_pci_probe()
272 map->map = mtd_pci_map; in mtd_pci_probe()
273 map->map.name = pci_name(dev); in mtd_pci_probe()
274 map->dev = dev; in mtd_pci_probe()
275 map->exit = info->exit; in mtd_pci_probe()
276 map->translate = info->translate; in mtd_pci_probe()
278 err = info->init(dev, map); in mtd_pci_probe()
282 mtd = do_map_probe(info->map_name, &map->map); in mtd_pci_probe()
295 if (map) { in mtd_pci_probe()
296 map->exit(dev, map); in mtd_pci_probe()
297 kfree(map); in mtd_pci_probe()
308 struct map_pci_info *map = mtd->priv; in mtd_pci_remove() local
312 map->exit(dev, map); in mtd_pci_remove()
313 kfree(map); in mtd_pci_remove()