14 #include <linux/kernel.h>
15 #include <linux/module.h>
21 #include <linux/slab.h>
23 #define DRIVER_NAME "latch-addr-flash"
46 spin_lock(&info->
lock);
49 datum = inline_map_read(map, info->
win_mask & ofs);
51 spin_unlock(&info->
lock);
62 spin_lock(&info->
lock);
65 inline_map_write(map, datum, info->
win_mask & ofs);
67 spin_unlock(&info->
lock);
70 static void lf_copy_from(
struct map_info *map,
void *to,
82 spin_lock(&info->
lock);
87 spin_unlock(&info->
lock);
95 static char *rom_probe_types[] = {
"cfi_probe",
NULL };
102 info = platform_get_drvdata(dev);
105 platform_set_drvdata(dev,
NULL);
107 latch_addr_data = dev->
dev.platform_data;
122 if (latch_addr_data->
done)
123 latch_addr_data->
done(latch_addr_data->
data);
138 latch_addr_data = dev->
dev.platform_data;
139 if (latch_addr_data ==
NULL)
142 pr_notice(
"latch-addr platform flash device: %#llx byte "
143 "window at %#.8llx\n",
144 (
unsigned long long)win_size, (
unsigned long long)win_base);
148 if (latch_addr_data->
init) {
149 err = latch_addr_data->
init(latch_addr_data->
data, chipsel);
160 platform_set_drvdata(dev, info);
164 dev_err(&dev->
dev,
"Could not reserve memory region\n");
170 info->
map.size = latch_addr_data->
size;
171 info->
map.bankwidth = latch_addr_data->
width;
175 if (!info->
map.virt) {
180 info->
map.map_priv_1 = (
unsigned long)info;
182 info->
map.read = lf_read;
183 info->
map.copy_from = lf_copy_from;
184 info->
map.write = lf_write;
191 for (probe_type = rom_probe_types; !info->
mtd && *probe_type;
203 latch_addr_data->
parts,
214 if (latch_addr_data->
done)
215 latch_addr_data->
done(latch_addr_data->
data);
220 .probe = latch_addr_flash_probe,
231 "address lines being set board specifically");