aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/chips/map_ram.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c
index afb43d5e1782..c3939dd230c6 100644
--- a/drivers/mtd/chips/map_ram.c
+++ b/drivers/mtd/chips/map_ram.c
@@ -22,6 +22,9 @@ static void mapram_nop (struct mtd_info *);
22static struct mtd_info *map_ram_probe(struct map_info *map); 22static struct mtd_info *map_ram_probe(struct map_info *map);
23static unsigned long mapram_unmapped_area(struct mtd_info *, unsigned long, 23static unsigned long mapram_unmapped_area(struct mtd_info *, unsigned long,
24 unsigned long, unsigned long); 24 unsigned long, unsigned long);
25static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len,
26 size_t *retlen, void **virt, resource_size_t *phys);
27static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len);
25 28
26 29
27static struct mtd_chip_driver mapram_chipdrv = { 30static struct mtd_chip_driver mapram_chipdrv = {
@@ -69,7 +72,9 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
69 mtd->_read = mapram_read; 72 mtd->_read = mapram_read;
70 mtd->_write = mapram_write; 73 mtd->_write = mapram_write;
71 mtd->_panic_write = mapram_write; 74 mtd->_panic_write = mapram_write;
75 mtd->_point = mapram_point;
72 mtd->_sync = mapram_nop; 76 mtd->_sync = mapram_nop;
77 mtd->_unpoint = mapram_unpoint;
73 mtd->flags = MTD_CAP_RAM; 78 mtd->flags = MTD_CAP_RAM;
74 mtd->writesize = 1; 79 mtd->writesize = 1;
75 80
@@ -96,6 +101,25 @@ static unsigned long mapram_unmapped_area(struct mtd_info *mtd,
96 return (unsigned long) map->virt + offset; 101 return (unsigned long) map->virt + offset;
97} 102}
98 103
104static int mapram_point(struct mtd_info *mtd, loff_t from, size_t len,
105 size_t *retlen, void **virt, resource_size_t *phys)
106{
107 struct map_info *map = mtd->priv;
108
109 if (!map->virt)
110 return -EINVAL;
111 *virt = map->virt + from;
112 if (phys)
113 *phys = map->phys + from;
114 *retlen = len;
115 return 0;
116}
117
118static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
119{
120 return 0;
121}
122
99static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) 123static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
100{ 124{
101 struct map_info *map = mtd->priv; 125 struct map_info *map = mtd->priv;