Home | History | Annotate | Line # | Download | only in nvif
driver.h revision 1.5.6.2
      1 /*	$NetBSD: driver.h,v 1.5.6.2 2019/06/10 22:08:14 christos 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, bus_addr_t addr, void __iomem *ptr,
     24 	    u32 size);
     25 #else
     26 	void __iomem *(*map)(void *priv, u64 handle, u32 size);
     27 	void (*unmap)(void *priv, void __iomem *ptr, u32 size);
     28 #endif
     29 	bool keep;
     30 };
     31 
     32 #ifdef __NetBSD__
     33 #  undef	__iomem
     34 #endif
     35 
     36 extern const struct nvif_driver nvif_driver_nvkm;
     37 extern const struct nvif_driver nvif_driver_drm;
     38 extern const struct nvif_driver nvif_driver_lib;
     39 extern const struct nvif_driver nvif_driver_null;
     40 
     41 #endif
     42