6 #include <linux/module.h>
7 #include <linux/types.h>
9 #include <linux/kernel.h>
11 #include <linux/errno.h>
12 #include <linux/slab.h>
22 #include <mach/hardware.h>
23 #include <asm/sizes.h>
40 static int sa1100_vpp_refcnt;
41 static void sa1100_set_vpp(
struct map_info *
map,
int on)
48 if (++sa1100_vpp_refcnt == 1)
49 subdev->
plat->set_vpp(1);
51 if (--sa1100_vpp_refcnt == 0)
52 subdev->
plat->set_vpp(0);
54 spin_unlock_irqrestore(&sa1100_vpp_lock, flags);
73 size = res->
end - phys + 1;
82 "0x%08lx, assuming CS0\n", phys);
98 if (subdev->
plat->set_vpp)
99 subdev->
map.set_vpp = sa1100_set_vpp;
104 if (!subdev->
map.virt) {
122 printk(
KERN_INFO "SA1100 flash: CFI device at 0x%08lx, %uMiB, %d-bit\n",
123 phys, (
unsigned)(subdev->
mtd->size >> 20),
124 subdev->
map.bankwidth * 8);
129 sa1100_destroy_subdev(subdev);
145 sa1100_destroy_subdev(&info->
subdev[i]);
190 for (i = 0; i <
nr; i++) {
198 subdev->
map.name = subdev->
name;
202 ret = sa1100_probe_subdev(subdev, res);
230 cdev[i] = info->
subdev[i].mtd;
242 sa1100_destroy(info, plat);
247 static const char *part_probes[] = {
"cmdlinepart",
"RedBoot",
NULL };
258 info = sa1100_setup_mtd(pdev, plat);
270 platform_set_drvdata(pdev, info);
279 struct sa_info *info = platform_get_drvdata(pdev);
282 platform_set_drvdata(pdev,
NULL);
283 sa1100_destroy(info, plat);
289 .probe = sa1100_mtd_probe,
290 .remove =
__exit_p(sa1100_mtd_remove),
292 .name =
"sa1100-mtd",