1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_CHID_H__
3 #define __NVKM_CHID_H__
4 #include <core/event.h>
5 
6 struct nvkm_chid {
7 	struct kref kref;
8 	int nr;
9 	u32 mask;
10 
11 	struct nvkm_event event;
12 
13 	void **data;
14 
15 	spinlock_t lock;
16 	unsigned long used[];
17 };
18 
19 int nvkm_chid_new(const struct nvkm_event_func *, struct nvkm_subdev *,
20 		  int nr, int first, int count, struct nvkm_chid **pchid);
21 struct nvkm_chid *nvkm_chid_ref(struct nvkm_chid *);
22 void nvkm_chid_unref(struct nvkm_chid **);
23 int nvkm_chid_get(struct nvkm_chid *, void *data);
24 void nvkm_chid_put(struct nvkm_chid *, int id, spinlock_t *data_lock);
25 #endif
26