1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVIF_CONN_H__
3 #define __NVIF_CONN_H__
4 #include <nvif/object.h>
5 #include <nvif/event.h>
6 struct nvif_disp;
7 
8 struct nvif_conn {
9 	struct nvif_object object;
10 };
11 
12 int nvif_conn_ctor(struct nvif_disp *, const char *name, int id, struct nvif_conn *);
13 void nvif_conn_dtor(struct nvif_conn *);
14 
15 static inline int
nvif_conn_id(struct nvif_conn * conn)16 nvif_conn_id(struct nvif_conn *conn)
17 {
18 	return conn->object.handle;
19 }
20 
21 #define NVIF_CONN_HPD_STATUS_UNSUPPORTED 0 /* negative if query fails */
22 #define NVIF_CONN_HPD_STATUS_NOT_PRESENT 1
23 #define NVIF_CONN_HPD_STATUS_PRESENT     2
24 int nvif_conn_hpd_status(struct nvif_conn *);
25 
26 int nvif_conn_event_ctor(struct nvif_conn *, const char *name, nvif_event_func, u8 types,
27 			 struct nvif_event *);
28 #endif
29