Lines Matching +full:timeout +full:- +full:ms
35 struct nvkm_device *device = aux->base.pad->i2c->subdev.device; in gm200_i2c_aux_fini()
36 nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000); in gm200_i2c_aux_fini()
42 struct nvkm_device *device = aux->base.pad->i2c->subdev.device; in gm200_i2c_aux_init()
46 u32 ctrl, timeout; in gm200_i2c_aux_init() local
48 /* wait up to 1ms for any previous transaction to be done... */ in gm200_i2c_aux_init()
49 timeout = 1000; in gm200_i2c_aux_init()
51 ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50)); in gm200_i2c_aux_init()
53 if (!timeout--) { in gm200_i2c_aux_init()
54 AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl); in gm200_i2c_aux_init()
55 return -EBUSY; in gm200_i2c_aux_init()
59 /* set some magic, and wait up to 1ms for it to appear */ in gm200_i2c_aux_init()
60 nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq); in gm200_i2c_aux_init()
61 timeout = 1000; in gm200_i2c_aux_init()
63 ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50)); in gm200_i2c_aux_init()
65 if (!timeout--) { in gm200_i2c_aux_init()
66 AUX_ERR(&aux->base, "magic wait %08x", ctrl); in gm200_i2c_aux_init()
68 return -EBUSY; in gm200_i2c_aux_init()
80 struct nvkm_i2c *i2c = aux->base.pad->i2c; in gm200_i2c_aux_xfer()
81 struct nvkm_device *device = i2c->subdev.device; in gm200_i2c_aux_xfer()
82 const u32 base = aux->ch * 0x50; in gm200_i2c_aux_xfer()
83 u32 ctrl, stat, timeout, retries = 0; in gm200_i2c_aux_xfer() local
87 AUX_TRACE(&aux->base, "%d: %08x %d", type, addr, *size); in gm200_i2c_aux_xfer()
95 AUX_TRACE(&aux->base, "sink not detected"); in gm200_i2c_aux_xfer()
96 ret = -ENXIO; in gm200_i2c_aux_xfer()
100 nvkm_i2c_aux_autodpcd(i2c, aux->ch, false); in gm200_i2c_aux_xfer()
105 AUX_TRACE(&aux->base, "wr %08x", xbuf[i / 4]); in gm200_i2c_aux_xfer()
113 ctrl |= (*size ? (*size - 1) : 0x00000100); in gm200_i2c_aux_xfer()
124 /* transaction request, wait up to 2ms for it to complete */ in gm200_i2c_aux_xfer()
127 timeout = 2000; in gm200_i2c_aux_xfer()
131 if (!timeout--) { in gm200_i2c_aux_xfer()
132 AUX_ERR(&aux->base, "timeout %08x", ctrl); in gm200_i2c_aux_xfer()
133 ret = -EIO; in gm200_i2c_aux_xfer()
145 ret = -ETIMEDOUT; in gm200_i2c_aux_xfer()
147 ret = -EIO; in gm200_i2c_aux_xfer()
149 AUX_TRACE(&aux->base, "%02d %08x %08x", retries, ctrl, stat); in gm200_i2c_aux_xfer()
155 AUX_TRACE(&aux->base, "rd %08x", xbuf[i / 4]); in gm200_i2c_aux_xfer()
162 nvkm_i2c_aux_autodpcd(i2c, aux->ch, true); in gm200_i2c_aux_xfer()
181 return -ENOMEM; in gm200_i2c_aux_new()
182 *paux = &aux->base; in gm200_i2c_aux_new()
184 nvkm_i2c_aux_ctor(&gm200_i2c_aux_func, pad, index, &aux->base); in gm200_i2c_aux_new()
185 aux->ch = drive; in gm200_i2c_aux_new()
186 aux->base.intr = 1 << aux->ch; in gm200_i2c_aux_new()