Lines Matching refs:cp
78 int (*tx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp, void *data);
79 int (*rx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp);
118 struct imx_mu_con_priv *cp, in imx_mu_generic_tx() argument
123 switch (cp->type) { in imx_mu_generic_tx()
125 imx_mu_write(priv, *arg, priv->dcfg->xTR[cp->idx]); in imx_mu_generic_tx()
126 imx_mu_xcr_rmw(priv, IMX_MU_xCR_TIEn(cp->idx), 0); in imx_mu_generic_tx()
129 imx_mu_xcr_rmw(priv, IMX_MU_xCR_GIRn(cp->idx), 0); in imx_mu_generic_tx()
130 tasklet_schedule(&cp->txdb_tasklet); in imx_mu_generic_tx()
133 dev_warn_ratelimited(priv->dev, "Send data on wrong channel type: %d\n", cp->type); in imx_mu_generic_tx()
141 struct imx_mu_con_priv *cp) in imx_mu_generic_rx() argument
145 dat = imx_mu_read(priv, priv->dcfg->xRR[cp->idx]); in imx_mu_generic_rx()
146 mbox_chan_received_data(cp->chan, (void *)&dat); in imx_mu_generic_rx()
152 struct imx_mu_con_priv *cp, in imx_mu_scu_tx() argument
160 switch (cp->type) { in imx_mu_scu_tx()
190 imx_mu_xcr_rmw(priv, IMX_MU_xCR_TIEn(cp->idx), 0); in imx_mu_scu_tx()
193 dev_warn_ratelimited(priv->dev, "Send data on wrong channel type: %d\n", cp->type); in imx_mu_scu_tx()
201 struct imx_mu_con_priv *cp) in imx_mu_scu_rx() argument
227 mbox_chan_received_data(cp->chan, (void *)&msg); in imx_mu_scu_rx()
234 struct imx_mu_con_priv *cp = (struct imx_mu_con_priv *)data; in imx_mu_txdb_tasklet() local
236 mbox_chan_txdone(cp->chan, 0); in imx_mu_txdb_tasklet()
243 struct imx_mu_con_priv *cp = chan->con_priv; in imx_mu_isr() local
249 switch (cp->type) { in imx_mu_isr()
251 val &= IMX_MU_xSR_TEn(cp->idx) & in imx_mu_isr()
252 (ctrl & IMX_MU_xCR_TIEn(cp->idx)); in imx_mu_isr()
255 val &= IMX_MU_xSR_RFn(cp->idx) & in imx_mu_isr()
256 (ctrl & IMX_MU_xCR_RIEn(cp->idx)); in imx_mu_isr()
259 val &= IMX_MU_xSR_GIPn(cp->idx) & in imx_mu_isr()
260 (ctrl & IMX_MU_xCR_GIEn(cp->idx)); in imx_mu_isr()
269 if (val == IMX_MU_xSR_TEn(cp->idx)) { in imx_mu_isr()
270 imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx)); in imx_mu_isr()
272 } else if (val == IMX_MU_xSR_RFn(cp->idx)) { in imx_mu_isr()
273 priv->dcfg->rx(priv, cp); in imx_mu_isr()
274 } else if (val == IMX_MU_xSR_GIPn(cp->idx)) { in imx_mu_isr()
275 imx_mu_write(priv, IMX_MU_xSR_GIPn(cp->idx), priv->dcfg->xSR); in imx_mu_isr()
291 struct imx_mu_con_priv *cp = chan->con_priv; in imx_mu_send_data() local
293 return priv->dcfg->tx(priv, cp, data); in imx_mu_send_data()
299 struct imx_mu_con_priv *cp = chan->con_priv; in imx_mu_startup() local
304 if (cp->type == IMX_MU_TYPE_TXDB) { in imx_mu_startup()
306 tasklet_init(&cp->txdb_tasklet, imx_mu_txdb_tasklet, in imx_mu_startup()
307 (unsigned long)cp); in imx_mu_startup()
316 cp->irq_desc, chan); in imx_mu_startup()
323 switch (cp->type) { in imx_mu_startup()
325 imx_mu_xcr_rmw(priv, IMX_MU_xCR_RIEn(cp->idx), 0); in imx_mu_startup()
328 imx_mu_xcr_rmw(priv, IMX_MU_xCR_GIEn(cp->idx), 0); in imx_mu_startup()
342 struct imx_mu_con_priv *cp = chan->con_priv; in imx_mu_shutdown() local
344 if (cp->type == IMX_MU_TYPE_TXDB) { in imx_mu_shutdown()
345 tasklet_kill(&cp->txdb_tasklet); in imx_mu_shutdown()
350 switch (cp->type) { in imx_mu_shutdown()
352 imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx)); in imx_mu_shutdown()
355 imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_RIEn(cp->idx)); in imx_mu_shutdown()
358 imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_GIEn(cp->idx)); in imx_mu_shutdown()
437 struct imx_mu_con_priv *cp = &priv->con_priv[i]; in imx_mu_init_generic() local
439 cp->idx = i % 4; in imx_mu_init_generic()
440 cp->type = i >> 2; in imx_mu_init_generic()
441 cp->chan = &priv->mbox_chans[i]; in imx_mu_init_generic()
442 priv->mbox_chans[i].con_priv = cp; in imx_mu_init_generic()
443 snprintf(cp->irq_desc, sizeof(cp->irq_desc), in imx_mu_init_generic()
444 "imx_mu_chan[%i-%i]", cp->type, cp->idx); in imx_mu_init_generic()
462 struct imx_mu_con_priv *cp = &priv->con_priv[i]; in imx_mu_init_scu() local
464 cp->idx = i < 2 ? 0 : i - 2; in imx_mu_init_scu()
465 cp->type = i < 2 ? i : IMX_MU_TYPE_RXDB; in imx_mu_init_scu()
466 cp->chan = &priv->mbox_chans[i]; in imx_mu_init_scu()
467 priv->mbox_chans[i].con_priv = cp; in imx_mu_init_scu()
468 snprintf(cp->irq_desc, sizeof(cp->irq_desc), in imx_mu_init_scu()
469 "imx_mu_chan[%i-%i]", cp->type, cp->idx); in imx_mu_init_scu()