1/* $NetBSD: priv.h,v 1.3 2021/12/18 23:45:42 riastradh Exp $ */ 2 3/* SPDX-License-Identifier: MIT */ 4#ifndef __NVKM_TIMER_PRIV_H__ 5#define __NVKM_TIMER_PRIV_H__ 6#define nvkm_timer(p) container_of((p), struct nvkm_timer, subdev) 7#include <subdev/timer.h> 8 9int nvkm_timer_new_(const struct nvkm_timer_func *, struct nvkm_device *, 10 int index, struct nvkm_timer **); 11 12struct nvkm_timer_func { 13 void (*init)(struct nvkm_timer *); 14 void (*intr)(struct nvkm_timer *); 15 u64 (*read)(struct nvkm_timer *); 16 void (*time)(struct nvkm_timer *, u64 time); 17 void (*alarm_init)(struct nvkm_timer *, u32 time); 18 void (*alarm_fini)(struct nvkm_timer *); 19}; 20 21void nvkm_timer_alarm_trigger(struct nvkm_timer *); 22 23void nv04_timer_fini(struct nvkm_timer *); 24void nv04_timer_intr(struct nvkm_timer *); 25void nv04_timer_time(struct nvkm_timer *, u64); 26u64 nv04_timer_read(struct nvkm_timer *); 27void nv04_timer_alarm_init(struct nvkm_timer *, u32); 28void nv04_timer_alarm_fini(struct nvkm_timer *); 29#endif 30