Lines Matching full:aux

27 #include "aux.h"
33 struct nvkm_i2c_aux *aux = container_of(adap, typeof(*aux), i2c); in nvkm_i2c_aux_i2c_xfer() local
37 ret = nvkm_i2c_aux_acquire(aux); in nvkm_i2c_aux_i2c_xfer()
60 ret = aux->func->xfer(aux, true, cmd, in nvkm_i2c_aux_i2c_xfer()
66 AUX_TRACE(aux, "no data after 32 retries"); in nvkm_i2c_aux_i2c_xfer()
80 nvkm_i2c_aux_release(aux); in nvkm_i2c_aux_i2c_xfer()
97 nvkm_i2c_aux_monitor(struct nvkm_i2c_aux *aux, bool monitor) in nvkm_i2c_aux_monitor() argument
99 struct nvkm_i2c_pad *pad = aux->pad; in nvkm_i2c_aux_monitor()
100 AUX_TRACE(aux, "monitor: %s", str_yes_no(monitor)); in nvkm_i2c_aux_monitor()
108 nvkm_i2c_aux_release(struct nvkm_i2c_aux *aux) in nvkm_i2c_aux_release() argument
110 struct nvkm_i2c_pad *pad = aux->pad; in nvkm_i2c_aux_release()
111 AUX_TRACE(aux, "release"); in nvkm_i2c_aux_release()
113 mutex_unlock(&aux->mutex); in nvkm_i2c_aux_release()
117 nvkm_i2c_aux_acquire(struct nvkm_i2c_aux *aux) in nvkm_i2c_aux_acquire() argument
119 struct nvkm_i2c_pad *pad = aux->pad; in nvkm_i2c_aux_acquire()
122 AUX_TRACE(aux, "acquire"); in nvkm_i2c_aux_acquire()
123 mutex_lock(&aux->mutex); in nvkm_i2c_aux_acquire()
125 if (aux->enabled) in nvkm_i2c_aux_acquire()
131 mutex_unlock(&aux->mutex); in nvkm_i2c_aux_acquire()
136 nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *aux, bool retry, u8 type, in nvkm_i2c_aux_xfer() argument
139 if (!*size && !aux->func->address_only) { in nvkm_i2c_aux_xfer()
140 AUX_ERR(aux, "address-only transaction dropped"); in nvkm_i2c_aux_xfer()
143 return aux->func->xfer(aux, retry, type, addr, data, size); in nvkm_i2c_aux_xfer()
147 nvkm_i2c_aux_lnk_ctl(struct nvkm_i2c_aux *aux, int nr, int bw, bool ef) in nvkm_i2c_aux_lnk_ctl() argument
149 if (aux->func->lnk_ctl) in nvkm_i2c_aux_lnk_ctl()
150 return aux->func->lnk_ctl(aux, nr, bw, ef); in nvkm_i2c_aux_lnk_ctl()
157 struct nvkm_i2c_aux *aux = *paux; in nvkm_i2c_aux_del() local
158 if (aux && !WARN_ON(!aux->func)) { in nvkm_i2c_aux_del()
159 AUX_TRACE(aux, "dtor"); in nvkm_i2c_aux_del()
160 list_del(&aux->head); in nvkm_i2c_aux_del()
161 i2c_del_adapter(&aux->i2c); in nvkm_i2c_aux_del()
168 nvkm_i2c_aux_init(struct nvkm_i2c_aux *aux) in nvkm_i2c_aux_init() argument
170 AUX_TRACE(aux, "init"); in nvkm_i2c_aux_init()
171 mutex_lock(&aux->mutex); in nvkm_i2c_aux_init()
172 aux->enabled = true; in nvkm_i2c_aux_init()
173 mutex_unlock(&aux->mutex); in nvkm_i2c_aux_init()
177 nvkm_i2c_aux_fini(struct nvkm_i2c_aux *aux) in nvkm_i2c_aux_fini() argument
179 AUX_TRACE(aux, "fini"); in nvkm_i2c_aux_fini()
180 mutex_lock(&aux->mutex); in nvkm_i2c_aux_fini()
181 aux->enabled = false; in nvkm_i2c_aux_fini()
182 mutex_unlock(&aux->mutex); in nvkm_i2c_aux_fini()
188 struct nvkm_i2c_aux *aux) in nvkm_i2c_aux_ctor() argument
192 aux->func = func; in nvkm_i2c_aux_ctor()
193 aux->pad = pad; in nvkm_i2c_aux_ctor()
194 aux->id = id; in nvkm_i2c_aux_ctor()
195 mutex_init(&aux->mutex); in nvkm_i2c_aux_ctor()
196 list_add_tail(&aux->head, &pad->i2c->aux); in nvkm_i2c_aux_ctor()
197 AUX_TRACE(aux, "ctor"); in nvkm_i2c_aux_ctor()
199 snprintf(aux->i2c.name, sizeof(aux->i2c.name), "nvkm-%s-aux-%04x", in nvkm_i2c_aux_ctor()
201 aux->i2c.owner = THIS_MODULE; in nvkm_i2c_aux_ctor()
202 aux->i2c.dev.parent = device->dev; in nvkm_i2c_aux_ctor()
203 aux->i2c.algo = &nvkm_i2c_aux_i2c_algo; in nvkm_i2c_aux_ctor()
204 return i2c_add_adapter(&aux->i2c); in nvkm_i2c_aux_ctor()