xref: /linux/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 #ifndef __NVKM_I2C_PRIV_H__
2 #define __NVKM_I2C_PRIV_H__
3 #define nvkm_i2c(p) container_of((p), struct nvkm_i2c, subdev)
4 #include <subdev/i2c.h>
5 
6 int nvkm_i2c_new_(const struct nvkm_i2c_func *, struct nvkm_device *,
7 		  int index, struct nvkm_i2c **);
8 
9 struct nvkm_i2c_func {
10 	int (*pad_x_new)(struct nvkm_i2c *, int id, struct nvkm_i2c_pad **);
11 	int (*pad_s_new)(struct nvkm_i2c *, int id, struct nvkm_i2c_pad **);
12 
13 	/* number of native dp aux channels present */
14 	int aux;
15 
16 	/* read and ack pending interrupts, returning only data
17 	 * for ports that have not been masked off, while still
18 	 * performing the ack for anything that was pending.
19 	 */
20 	void (*aux_stat)(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
21 
22 	/* mask on/off interrupt types for a given set of auxch
23 	 */
24 	void (*aux_mask)(struct nvkm_i2c *, u32, u32, u32);
25 };
26 
27 void g94_aux_stat(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
28 void g94_aux_mask(struct nvkm_i2c *, u32, u32, u32);
29 
30 void gk104_aux_stat(struct nvkm_i2c *, u32 *, u32 *, u32 *, u32 *);
31 void gk104_aux_mask(struct nvkm_i2c *, u32, u32, u32);
32 #endif
33