Lines Matching refs:aux
33 static int edp_msg_fifo_tx(struct edp_aux *aux, struct drm_dp_aux_msg *msg) in edp_msg_fifo_tx() argument
67 edp_write(aux->base + REG_EDP_AUX_DATA, reg); in edp_msg_fifo_tx()
75 edp_write(aux->base + REG_EDP_AUX_TRANS_CTRL, reg); in edp_msg_fifo_tx()
80 static int edp_msg_fifo_rx(struct edp_aux *aux, struct drm_dp_aux_msg *msg) in edp_msg_fifo_rx() argument
87 edp_write(aux->base + REG_EDP_AUX_DATA, in edp_msg_fifo_rx()
93 data = edp_read(aux->base + REG_EDP_AUX_DATA); in edp_msg_fifo_rx()
95 data = edp_read(aux->base + REG_EDP_AUX_DATA); in edp_msg_fifo_rx()
113 struct edp_aux *aux = to_edp_aux(drm_aux); in edp_aux_transfer() local
134 mutex_lock(&aux->msg_mutex); in edp_aux_transfer()
136 aux->msg_err = false; in edp_aux_transfer()
137 reinit_completion(&aux->msg_comp); in edp_aux_transfer()
139 ret = edp_msg_fifo_tx(aux, msg); in edp_aux_transfer()
144 time_left = wait_for_completion_timeout(&aux->msg_comp, in edp_aux_transfer()
151 edp_write(aux->base + REG_EDP_AUX_TRANS_CTRL, 0); in edp_aux_transfer()
152 msm_edp_aux_ctrl(aux, 1); in edp_aux_transfer()
159 if (!aux->msg_err) { in edp_aux_transfer()
161 ret = edp_msg_fifo_rx(aux, msg); in edp_aux_transfer()
183 mutex_unlock(&aux->msg_mutex); in edp_aux_transfer()
190 struct edp_aux *aux = NULL; in msm_edp_aux_init() local
194 aux = devm_kzalloc(dev, sizeof(*aux), GFP_KERNEL); in msm_edp_aux_init()
195 if (!aux) in msm_edp_aux_init()
198 aux->base = regbase; in msm_edp_aux_init()
199 mutex_init(&aux->msg_mutex); in msm_edp_aux_init()
200 init_completion(&aux->msg_comp); in msm_edp_aux_init()
202 aux->drm_aux.name = "msm_edp_aux"; in msm_edp_aux_init()
203 aux->drm_aux.dev = dev; in msm_edp_aux_init()
204 aux->drm_aux.drm_dev = edp->dev; in msm_edp_aux_init()
205 aux->drm_aux.transfer = edp_aux_transfer; in msm_edp_aux_init()
206 ret = drm_dp_aux_register(&aux->drm_aux); in msm_edp_aux_init()
209 mutex_destroy(&aux->msg_mutex); in msm_edp_aux_init()
212 if (drm_aux && aux) in msm_edp_aux_init()
213 *drm_aux = &aux->drm_aux; in msm_edp_aux_init()
215 return aux; in msm_edp_aux_init()
218 void msm_edp_aux_destroy(struct device *dev, struct edp_aux *aux) in msm_edp_aux_destroy() argument
220 if (aux) { in msm_edp_aux_destroy()
221 drm_dp_aux_unregister(&aux->drm_aux); in msm_edp_aux_destroy()
222 mutex_destroy(&aux->msg_mutex); in msm_edp_aux_destroy()
226 irqreturn_t msm_edp_aux_irq(struct edp_aux *aux, u32 isr) in msm_edp_aux_irq() argument
230 edp_write(aux->base + REG_EDP_AUX_TRANS_CTRL, 0); in msm_edp_aux_irq()
233 aux->msg_err = true; in msm_edp_aux_irq()
235 aux->msg_err = false; in msm_edp_aux_irq()
237 complete(&aux->msg_comp); in msm_edp_aux_irq()
243 void msm_edp_aux_ctrl(struct edp_aux *aux, int enable) in msm_edp_aux_ctrl() argument
248 data = edp_read(aux->base + REG_EDP_AUX_CTRL); in msm_edp_aux_ctrl()
252 edp_write(aux->base + REG_EDP_AUX_CTRL, data); in msm_edp_aux_ctrl()
259 edp_write(aux->base + REG_EDP_AUX_CTRL, data); in msm_edp_aux_ctrl()
262 edp_write(aux->base + REG_EDP_AUX_CTRL, data); in msm_edp_aux_ctrl()