xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_DEVINIT_PRIV_H__
3 #define __NVKM_DEVINIT_PRIV_H__
4 #define nvkm_devinit(p) container_of((p), struct nvkm_devinit, subdev)
5 #include <subdev/devinit.h>
6 
7 int r535_devinit_new(const struct nvkm_devinit_func *,
8 		     struct nvkm_device *, enum nvkm_subdev_type, int, struct nvkm_devinit **);
9 
10 struct nvkm_devinit_func {
11 	void *(*dtor)(struct nvkm_devinit *);
12 	void (*preinit)(struct nvkm_devinit *);
13 	void (*init)(struct nvkm_devinit *);
14 	int  (*post)(struct nvkm_devinit *, bool post);
15 	u32  (*mmio)(struct nvkm_devinit *, u32);
16 	void (*meminit)(struct nvkm_devinit *);
17 	int  (*pll_set)(struct nvkm_devinit *, u32 type, u32 freq);
18 	void (*disable)(struct nvkm_devinit *);
19 };
20 
21 void nvkm_devinit_ctor(const struct nvkm_devinit_func *, struct nvkm_device *,
22 		       enum nvkm_subdev_type, int inst, struct nvkm_devinit *);
23 u64 nvkm_devinit_disable(struct nvkm_devinit *);
24 
25 int nv04_devinit_post(struct nvkm_devinit *, bool);
26 int tu102_devinit_post(struct nvkm_devinit *, bool);
27 #endif
28