3 #include <core/subdev.h>
4 #include <core/notify.h>
5 #include <subdev/pci.h>
16 nv_clk_src_hclkm2d3, /* NVAA */
17 nv_clk_src_hclkm4, /* NVAA */
18 nv_clk_src_cclk, /* NVAA */
25 nv_clk_src_mpllsrcref,
52 struct list_head head;
54 u32 domain[nv_clk_src_max];
58 struct list_head head;
59 struct list_head list; /* c-states */
60 struct nvkm_cstate base;
63 enum nvkm_pcie_speed pcie_speed;
69 u8 bios; /* 0xff for none */
70 #define NVKM_CLK_DOM_FLAG_CORE 0x01
77 const struct nvkm_clk_func *func;
78 struct nvkm_subdev subdev;
80 const struct nvkm_domain *domains;
81 struct nvkm_pstate bstate;
83 struct list_head states;
86 struct work_struct work;
87 wait_queue_head_t wait;
90 struct nvkm_notify pwrsrc_ntfy;
92 int pstate; /* current */
93 int ustate_ac; /* user-requested (-1 disabled, -2 perfmon) */
94 int ustate_dc; /* user-requested (-1 disabled, -2 perfmon) */
95 int astate; /* perfmon adjustment (base) */
96 int tstate; /* thermal adjustment (max-) */
97 int dstate; /* display adjustment (min+) */
101 /*XXX: die, these are here *only* to support the completely
102 * bat-shit insane what-was-nouveau_hw.c code
104 int (*pll_calc)(struct nvkm_clk *, struct nvbios_pll *, int clk,
105 struct nvkm_pll_vals *pv);
106 int (*pll_prog)(struct nvkm_clk *, u32 reg1, struct nvkm_pll_vals *pv);
109 int nvkm_clk_read(struct nvkm_clk *, enum nv_clk_src);
110 int nvkm_clk_ustate(struct nvkm_clk *, int req, int pwr);
111 int nvkm_clk_astate(struct nvkm_clk *, int req, int rel, bool wait);
112 int nvkm_clk_dstate(struct nvkm_clk *, int req, int rel);
113 int nvkm_clk_tstate(struct nvkm_clk *, int req, int rel);
115 int nv04_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
116 int nv40_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
117 int nv50_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
118 int g84_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
119 int mcp77_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
120 int gt215_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
121 int gf100_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
122 int gk104_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
123 int gk20a_clk_new(struct nvkm_device *, int, struct nvkm_clk **);