driver.h revision 1.4 1 /* $NetBSD: driver.h,v 1.4 2018/08/27 07:35:56 riastradh Exp $ */
2
3 #ifndef __NVIF_DRIVER_H__
4 #define __NVIF_DRIVER_H__
5
6 #ifdef __NetBSD__
7 # define __nvif_iomem volatile
8 # define __iomem __nvif_iomem
9 #endif
10
11 struct nvif_driver {
12 const char *name;
13 int (*init)(const char *name, u64 device, const char *cfg,
14 const char *dbg, void **priv);
15 void (*fini)(void *priv);
16 int (*suspend)(void *priv);
17 int (*resume)(void *priv);
18 int (*ioctl)(void *priv, bool super, void *data, u32 size, void **hack);
19 #ifdef __NetBSD__
20 int (*map)(void *priv, bus_space_tag_t tag, u64 handle, u32 size,
21 bus_space_handle_t *handlep, void __iomem **ptrp);
22 void (*unmap)(void *priv, bus_space_tag_t tag,
23 bus_space_handle_t handle, u32 size);
24 #else
25 void __iomem *(*map)(void *priv, u64 handle, u32 size);
26 void (*unmap)(void *priv, void __iomem *ptr, u32 size);
27 #endif
28 bool keep;
29 };
30
31 #ifdef __NetBSD__
32 # undef __iomem
33 #endif
34
35 extern const struct nvif_driver nvif_driver_nvkm;
36 extern const struct nvif_driver nvif_driver_drm;
37 extern const struct nvif_driver nvif_driver_lib;
38 extern const struct nvif_driver nvif_driver_null;
39
40 #endif
41