priv.h 954 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __NVKM_CLK_PRIV_H__
  3. #define __NVKM_CLK_PRIV_H__
  4. #define nvkm_clk(p) container_of((p), struct nvkm_clk, subdev)
  5. #include <subdev/clk.h>
  6. struct nvkm_clk_func {
  7. int (*init)(struct nvkm_clk *);
  8. void (*fini)(struct nvkm_clk *);
  9. int (*read)(struct nvkm_clk *, enum nv_clk_src);
  10. int (*calc)(struct nvkm_clk *, struct nvkm_cstate *);
  11. int (*prog)(struct nvkm_clk *);
  12. void (*tidy)(struct nvkm_clk *);
  13. struct nvkm_pstate *pstates;
  14. int nr_pstates;
  15. struct nvkm_domain domains[];
  16. };
  17. int nvkm_clk_ctor(const struct nvkm_clk_func *, struct nvkm_device *, int,
  18. bool allow_reclock, struct nvkm_clk *);
  19. int nvkm_clk_new_(const struct nvkm_clk_func *, struct nvkm_device *, int,
  20. bool allow_reclock, struct nvkm_clk **);
  21. int nv04_clk_pll_calc(struct nvkm_clk *, struct nvbios_pll *, int clk,
  22. struct nvkm_pll_vals *);
  23. int nv04_clk_pll_prog(struct nvkm_clk *, u32 reg1, struct nvkm_pll_vals *);
  24. #endif