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()
67 return -ENOMEM; in pxa2xx_flash_probe()
69 info->map.cached = ioremap_cache(info->map.phys, info->map.size); in pxa2xx_flash_probe()
70 if (!info->map.cached) in pxa2xx_flash_probe()
72 info->map.name); in pxa2xx_flash_probe()
73 info->map.inval_cache = pxa2xx_map_inval_cache; in pxa2xx_flash_probe()
74 simple_map_init(&info->map); in pxa2xx_flash_probe()
78 " (%d-bit bankwidth)\n", in pxa2xx_flash_probe()
79 info->map.name, (unsigned long)info->map.phys, in pxa2xx_flash_probe()
80 info->map.bankwidth * 8); in pxa2xx_flash_probe()
82 info->mtd = do_map_probe(flash->map_name, &info->map); in pxa2xx_flash_probe()
84 if (!info->mtd) { in pxa2xx_flash_probe()
85 iounmap((void *)info->map.virt); in pxa2xx_flash_probe()
86 if (info->map.cached) in pxa2xx_flash_probe()
87 iounmap(info->map.cached); in pxa2xx_flash_probe()
88 return -EIO; in pxa2xx_flash_probe()
90 info->mtd->dev.parent = &pdev->dev; in pxa2xx_flash_probe()
92 mtd_device_parse_register(info->mtd, probes, NULL, flash->parts, in pxa2xx_flash_probe()
93 flash->nr_parts); in pxa2xx_flash_probe()
103 mtd_device_unregister(info->mtd); in pxa2xx_flash_remove()
105 map_destroy(info->mtd); in pxa2xx_flash_remove()
106 iounmap(info->map.virt); in pxa2xx_flash_remove()
107 if (info->map.cached) in pxa2xx_flash_remove()
108 iounmap(info->map.cached); in pxa2xx_flash_remove()
118 if (info && mtd_suspend(info->mtd) == 0) in pxa2xx_flash_shutdown()
119 mtd_resume(info->mtd); in pxa2xx_flash_shutdown()
127 .name = "pxa2xx-flash",
138 MODULE_DESCRIPTION("MTD map driver for Intel XScale PXA2xx");