xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h (revision 2ba9268dd603d23e17643437b2246acb6844953b)
1 #ifndef __NVKM_DEVINIT_PRIV_H__
2 #define __NVKM_DEVINIT_PRIV_H__
3 #include <subdev/devinit.h>
4 
5 struct nvkm_devinit_impl {
6 	struct nvkm_oclass base;
7 	void (*meminit)(struct nvkm_devinit *);
8 	int  (*pll_set)(struct nvkm_devinit *, u32 type, u32 freq);
9 	u64  (*disable)(struct nvkm_devinit *);
10 	u32  (*mmio)(struct nvkm_devinit *, u32);
11 	int  (*post)(struct nvkm_subdev *, bool);
12 };
13 
14 #define nvkm_devinit_create(p,e,o,d)                                        \
15 	nvkm_devinit_create_((p), (e), (o), sizeof(**d), (void **)d)
16 #define nvkm_devinit_destroy(p) ({                                          \
17 	struct nvkm_devinit *d = (p);                                       \
18 	_nvkm_devinit_dtor(nv_object(d));                                   \
19 })
20 #define nvkm_devinit_init(p) ({                                             \
21 	struct nvkm_devinit *d = (p);                                       \
22 	_nvkm_devinit_init(nv_object(d));                                   \
23 })
24 #define nvkm_devinit_fini(p,s) ({                                           \
25 	struct nvkm_devinit *d = (p);                                       \
26 	_nvkm_devinit_fini(nv_object(d), (s));                              \
27 })
28 
29 int nvkm_devinit_create_(struct nvkm_object *, struct nvkm_object *,
30 			    struct nvkm_oclass *, int, void **);
31 void _nvkm_devinit_dtor(struct nvkm_object *);
32 int _nvkm_devinit_init(struct nvkm_object *);
33 int _nvkm_devinit_fini(struct nvkm_object *, bool suspend);
34 #endif
35