1 #ifndef __NVKM_I2C_AUX_H__ 2 #define __NVKM_I2C_AUX_H__ 3 #include "pad.h" 4 5 struct nvkm_i2c_aux_func { 6 bool address_only; 7 int (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type, 8 u32 addr, u8 *data, u8 *size); 9 int (*lnk_ctl)(struct nvkm_i2c_aux *, int link_nr, int link_bw, 10 bool enhanced_framing); 11 }; 12 13 int nvkm_i2c_aux_ctor(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *, 14 int id, struct nvkm_i2c_aux *); 15 int nvkm_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *, 16 int id, struct nvkm_i2c_aux **); 17 void nvkm_i2c_aux_del(struct nvkm_i2c_aux **); 18 int nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *, bool retry, u8 type, 19 u32 addr, u8 *data, u8 *size); 20 21 int g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *, 22 int, u8, struct nvkm_i2c_aux **); 23 24 int g94_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **); 25 int g94_i2c_aux_xfer(struct nvkm_i2c_aux *, bool, u8, u32, u8 *, u8 *); 26 int gf119_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **); 27 int gm200_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **); 28 29 #define AUX_MSG(b,l,f,a...) do { \ 30 struct nvkm_i2c_aux *_aux = (b); \ 31 nvkm_##l(&_aux->pad->i2c->subdev, "aux %04x: "f"\n", _aux->id, ##a); \ 32 } while(0) 33 #define AUX_ERR(b,f,a...) AUX_MSG((b), error, f, ##a) 34 #define AUX_DBG(b,f,a...) AUX_MSG((b), debug, f, ##a) 35 #define AUX_TRACE(b,f,a...) AUX_MSG((b), trace, f, ##a) 36 #endif 37