1b7019ac5SIlia Mirkin /* SPDX-License-Identifier: MIT */ 2c39f472eSBen Skeggs #ifndef __NVKM_TIMER_PRIV_H__ 3c39f472eSBen Skeggs #define __NVKM_TIMER_PRIV_H__ 431649ecfSBen Skeggs #define nvkm_timer(p) container_of((p), struct nvkm_timer, subdev) 5c39f472eSBen Skeggs #include <subdev/timer.h> 631649ecfSBen Skeggs 7*9aad54d5SBen Skeggs int nvkm_timer_new_(const struct nvkm_timer_func *, struct nvkm_device *, enum nvkm_subdev_type, 8*9aad54d5SBen Skeggs int, struct nvkm_timer **); 931649ecfSBen Skeggs 1031649ecfSBen Skeggs struct nvkm_timer_func { 1131649ecfSBen Skeggs void (*init)(struct nvkm_timer *); 1231649ecfSBen Skeggs void (*intr)(struct nvkm_timer *); 1331649ecfSBen Skeggs u64 (*read)(struct nvkm_timer *); 1431649ecfSBen Skeggs void (*time)(struct nvkm_timer *, u64 time); 1531649ecfSBen Skeggs void (*alarm_init)(struct nvkm_timer *, u32 time); 1631649ecfSBen Skeggs void (*alarm_fini)(struct nvkm_timer *); 1731649ecfSBen Skeggs }; 1831649ecfSBen Skeggs 1931649ecfSBen Skeggs void nvkm_timer_alarm_trigger(struct nvkm_timer *); 2031649ecfSBen Skeggs 2131649ecfSBen Skeggs void nv04_timer_fini(struct nvkm_timer *); 2231649ecfSBen Skeggs void nv04_timer_intr(struct nvkm_timer *); 2331649ecfSBen Skeggs void nv04_timer_time(struct nvkm_timer *, u64); 2431649ecfSBen Skeggs u64 nv04_timer_read(struct nvkm_timer *); 2531649ecfSBen Skeggs void nv04_timer_alarm_init(struct nvkm_timer *, u32); 2631649ecfSBen Skeggs void nv04_timer_alarm_fini(struct nvkm_timer *); 27c39f472eSBen Skeggs #endif 28