Searched refs:memregion (Results 1 - 9 of 9) sorted by relevance

/linux-4.1.27/drivers/staging/unisys/visorutil/
H A Dmemregion_direct.c24 #include "memregion.h"
26 #define MYDRVNAME "memregion"
28 struct memregion { struct
36 static BOOL mapit(struct memregion *memregion);
37 static void unmapit(struct memregion *memregion);
39 struct memregion * visor_memregion_create()
42 struct memregion *rc = NULL; visor_memregion_create()
43 struct memregion *memregion; visor_memregion_create() local
45 memregion = kzalloc(sizeof(*memregion), GFP_KERNEL | __GFP_NORETRY); visor_memregion_create()
46 if (memregion == NULL) visor_memregion_create()
49 memregion->physaddr = physaddr; visor_memregion_create()
50 memregion->nbytes = nbytes; visor_memregion_create()
51 memregion->overlapped = FALSE; visor_memregion_create()
52 if (!mapit(memregion)) { visor_memregion_create()
56 rc = memregion; visor_memregion_create()
59 visor_memregion_destroy(memregion); visor_memregion_create()
60 memregion = NULL; visor_memregion_create()
66 struct memregion * visor_memregion_create_overlapped()
67 visor_memregion_create_overlapped(struct memregion *parent, ulong offset, visor_memregion_create_overlapped()
70 struct memregion *memregion = NULL; visor_memregion_create_overlapped() local
82 memregion = kzalloc(sizeof(*memregion), GFP_KERNEL|__GFP_NORETRY); visor_memregion_create_overlapped()
83 if (memregion == NULL) visor_memregion_create_overlapped()
86 memregion->physaddr = parent->physaddr + offset; visor_memregion_create_overlapped()
87 memregion->nbytes = nbytes; visor_memregion_create_overlapped()
88 memregion->mapped = ((u8 __iomem *)(parent->mapped)) + offset; visor_memregion_create_overlapped()
89 memregion->requested = FALSE; visor_memregion_create_overlapped()
90 memregion->overlapped = TRUE; visor_memregion_create_overlapped()
91 return memregion; visor_memregion_create_overlapped()
96 mapit(struct memregion *memregion) mapit() argument
98 ulong physaddr = (ulong)(memregion->physaddr); mapit()
99 ulong nbytes = memregion->nbytes; mapit()
101 memregion->requested = FALSE; mapit()
103 memregion->requested = TRUE; mapit()
104 memregion->mapped = ioremap_cache(physaddr, nbytes); mapit()
105 if (!memregion->mapped) mapit()
111 unmapit(struct memregion *memregion) unmapit() argument
113 if (memregion->mapped != NULL) { unmapit()
114 iounmap(memregion->mapped); unmapit()
115 memregion->mapped = NULL; unmapit()
117 if (memregion->requested) { unmapit()
118 release_mem_region((ulong)(memregion->physaddr), unmapit()
119 memregion->nbytes); unmapit()
120 memregion->requested = FALSE; unmapit()
125 visor_memregion_get_physaddr(struct memregion *memregion) visor_memregion_get_physaddr() argument
127 return memregion->physaddr; visor_memregion_get_physaddr()
132 visor_memregion_get_nbytes(struct memregion *memregion) visor_memregion_get_nbytes() argument
134 return memregion->nbytes; visor_memregion_get_nbytes()
139 visor_memregion_get_pointer(struct memregion *memregion) visor_memregion_get_pointer() argument
141 return memregion->mapped; visor_memregion_get_pointer()
146 visor_memregion_resize(struct memregion *memregion, ulong newsize) visor_memregion_resize() argument
148 if (newsize == memregion->nbytes) visor_memregion_resize()
150 if (memregion->overlapped) visor_memregion_resize()
154 memregion->nbytes = newsize; visor_memregion_resize()
156 unmapit(memregion); visor_memregion_resize()
157 memregion->nbytes = newsize; visor_memregion_resize()
158 if (!mapit(memregion)) visor_memregion_resize()
167 struct memregion *memregion, ulong offset, memregion_readwrite()
170 if (offset + nbytes > memregion->nbytes) memregion_readwrite()
174 memcpy_toio(memregion->mapped + offset, local, nbytes); memregion_readwrite()
176 memcpy_fromio(local, memregion->mapped + offset, nbytes); memregion_readwrite()
182 visor_memregion_read(struct memregion *memregion, ulong offset, void *dest, visor_memregion_read() argument
185 return memregion_readwrite(FALSE, memregion, offset, dest, nbytes); visor_memregion_read()
190 visor_memregion_write(struct memregion *memregion, ulong offset, void *src, visor_memregion_write() argument
193 return memregion_readwrite(TRUE, memregion, offset, src, nbytes); visor_memregion_write()
198 visor_memregion_destroy(struct memregion *memregion) visor_memregion_destroy() argument
200 if (memregion == NULL) visor_memregion_destroy()
202 if (!memregion->overlapped) visor_memregion_destroy()
203 unmapit(memregion); visor_memregion_destroy()
204 kfree(memregion); visor_memregion_destroy()
166 memregion_readwrite(BOOL is_write, struct memregion *memregion, ulong offset, void *local, ulong nbytes) memregion_readwrite() argument
H A Dmemregion.h0 /* memregion.h
23 /* struct memregion is an opaque structure to users.
26 struct memregion;
28 struct memregion *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes);
29 struct memregion *visor_memregion_create_overlapped(struct memregion *parent,
31 int visor_memregion_resize(struct memregion *memregion, ulong newsize);
32 int visor_memregion_read(struct memregion *memregion,
34 int visor_memregion_write(struct memregion *memregion,
36 void visor_memregion_destroy(struct memregion *memregion);
37 HOSTADDRESS visor_memregion_get_physaddr(struct memregion *memregion);
38 ulong visor_memregion_get_nbytes(struct memregion *memregion);
39 void memregion_dump(struct memregion *memregion, char *s,
41 void __iomem *visor_memregion_get_pointer(struct memregion *memregion);
/linux-4.1.27/drivers/staging/unisys/visorchannel/
H A Dvisorchannel_funcs.c21 * data is accessed using the memregion abstraction. (memregion has both
32 struct memregion *memregion; /* from visor_memregion_create() */ member in struct:visorchannel
65 p->memregion = NULL; visorchannel_create_guts()
72 p->memregion = visorchannel_create_guts()
76 p->memregion = visorchannel_create_guts()
77 visor_memregion_create_overlapped(parent->memregion, visorchannel_create_guts()
79 if (!p->memregion) { visorchannel_create_guts()
83 if (visor_memregion_read(p->memregion, 0, &p->chan_hdr, visorchannel_create_guts()
94 if (visor_memregion_resize(p->memregion, channel_bytes) < 0) { visorchannel_create_guts()
155 if (channel->memregion) { visorchannel_destroy()
156 visor_memregion_destroy(channel->memregion); visorchannel_destroy()
157 channel->memregion = NULL; visorchannel_destroy()
166 return visor_memregion_get_physaddr(channel->memregion); visorchannel_get_physaddr()
213 struct memregion * visorchannel_get_memregion()
216 return channel->memregion; visorchannel_get_memregion()
224 int rc = visor_memregion_read(channel->memregion, offset, visorchannel_read()
242 return visor_memregion_write(channel->memregion, offset, local, nbytes); visorchannel_write()
265 x = visor_memregion_write(channel->memregion, offset + written, visorchannel_clear()
310 (visor_memregion_write(channel->memregion, \
327 if (visor_memregion_read(channel->memregion, sig_read_header()
347 if (visor_memregion_write(channel->memregion, sig_do_data()
353 if (visor_memregion_read(channel->memregion, signal_data_offset, sig_do_data()
452 visor_memregion_write(channel->memregion, signalinsert_inner()
557 struct memregion *memregion = NULL; visorchannel_debug() local
565 memregion = channel->memregion; visorchannel_debug()
566 if (!memregion) visorchannel_debug()
569 addr = visor_memregion_get_physaddr(memregion); visorchannel_debug()
570 nbytes_region = visor_memregion_get_nbytes(memregion); visorchannel_debug()
H A Dglobals.h22 #include "memregion.h"
H A Dvisorchannel.h23 #include "memregion.h"
68 struct memregion *visorchannel_get_memregion(struct visorchannel *channel);
/linux-4.1.27/sound/soc/tegra/
H A Dtegra20_spdif.c268 struct resource *mem, *memregion, *dmareq; tegra20_spdif_platform_probe() local
302 memregion = devm_request_mem_region(&pdev->dev, mem->start, tegra20_spdif_platform_probe()
304 if (!memregion) { tegra20_spdif_platform_probe()
H A Dtegra20_i2s.c342 struct resource *mem, *memregion; tegra20_i2s_platform_probe() local
371 memregion = devm_request_mem_region(&pdev->dev, mem->start, tegra20_i2s_platform_probe()
373 if (!memregion) { tegra20_i2s_platform_probe()
H A Dtegra30_i2s.c382 struct resource *mem, *memregion; tegra30_i2s_platform_probe() local
428 memregion = devm_request_mem_region(&pdev->dev, mem->start, tegra30_i2s_platform_probe()
430 if (!memregion) { tegra30_i2s_platform_probe()
/linux-4.1.27/drivers/staging/unisys/visorchipset/
H A Dparser.c19 #include "memregion.h"
50 struct memregion *rgn = NULL; parser_init_guts()

Completed in 200 milliseconds