Lines Matching +full:mtd +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0-only
14 #include <linux/mtd/mtd.h>
15 #include <linux/mtd/map.h>
16 #include <linux/mtd/partitions.h>
26 unsigned long start = (unsigned long)map->cached + from; in pxa2xx_map_inval_cache()
29 start &= ~(CACHELINESIZE - 1); in pxa2xx_map_inval_cache()
38 struct mtd_info *mtd; member
46 struct flash_platform_data *flash = dev_get_platdata(&pdev->dev); in pxa2xx_flash_probe()
52 return -ENODEV; in pxa2xx_flash_probe()
56 return -ENOMEM; in pxa2xx_flash_probe()
58 info->map.name = flash->name; in pxa2xx_flash_probe()
59 info->map.bankwidth = flash->width; in pxa2xx_flash_probe()
60 info->map.phys = res->start; in pxa2xx_flash_probe()
61 info->map.size = resource_size(res); in pxa2xx_flash_probe()
63 info->map.virt = ioremap(info->map.phys, info->map.size); in pxa2xx_flash_probe()
64 if (!info->map.virt) { in pxa2xx_flash_probe()
66 info->map.name); in pxa2xx_flash_probe()
68 return -ENOMEM; in pxa2xx_flash_probe()
70 info->map.cached = ioremap_cache(info->map.phys, info->map.size); in pxa2xx_flash_probe()
71 if (!info->map.cached) in pxa2xx_flash_probe()
73 info->map.name); in pxa2xx_flash_probe()
74 info->map.inval_cache = pxa2xx_map_inval_cache; in pxa2xx_flash_probe()
75 simple_map_init(&info->map); in pxa2xx_flash_probe()
79 " (%d-bit bankwidth)\n", in pxa2xx_flash_probe()
80 info->map.name, (unsigned long)info->map.phys, in pxa2xx_flash_probe()
81 info->map.bankwidth * 8); in pxa2xx_flash_probe()
83 info->mtd = do_map_probe(flash->map_name, &info->map); in pxa2xx_flash_probe()
85 if (!info->mtd) { in pxa2xx_flash_probe()
86 iounmap((void *)info->map.virt); in pxa2xx_flash_probe()
87 if (info->map.cached) in pxa2xx_flash_probe()
88 iounmap(info->map.cached); in pxa2xx_flash_probe()
90 return -EIO; in pxa2xx_flash_probe()
92 info->mtd->dev.parent = &pdev->dev; in pxa2xx_flash_probe()
94 mtd_device_parse_register(info->mtd, probes, NULL, flash->parts, in pxa2xx_flash_probe()
95 flash->nr_parts); in pxa2xx_flash_probe()
105 mtd_device_unregister(info->mtd); in pxa2xx_flash_remove()
107 map_destroy(info->mtd); in pxa2xx_flash_remove()
108 iounmap(info->map.virt); in pxa2xx_flash_remove()
109 if (info->map.cached) in pxa2xx_flash_remove()
110 iounmap(info->map.cached); in pxa2xx_flash_remove()
119 if (info && mtd_suspend(info->mtd) == 0) in pxa2xx_flash_shutdown()
120 mtd_resume(info->mtd); in pxa2xx_flash_shutdown()
128 .name = "pxa2xx-flash",
139 MODULE_DESCRIPTION("MTD map driver for Intel XScale PXA2xx");