Lines Matching full:cp

112 static void th1520_mbox_chan_write(struct th1520_mbox_con_priv *cp, u32 val,  in th1520_mbox_chan_write()  argument
116 iowrite32(val, cp->comm_remote_base + offs); in th1520_mbox_chan_write()
118 iowrite32(val, cp->comm_local_base + offs); in th1520_mbox_chan_write()
121 static u32 th1520_mbox_chan_read(struct th1520_mbox_con_priv *cp, u32 offs, in th1520_mbox_chan_read() argument
125 return ioread32(cp->comm_remote_base + offs); in th1520_mbox_chan_read()
127 return ioread32(cp->comm_local_base + offs); in th1520_mbox_chan_read()
130 static void th1520_mbox_chan_rmw(struct th1520_mbox_con_priv *cp, u32 off, in th1520_mbox_chan_rmw() argument
133 struct th1520_mbox_priv *priv = to_th1520_mbox_priv(cp->chan->mbox); in th1520_mbox_chan_rmw()
138 val = th1520_mbox_chan_read(cp, off, is_remote); in th1520_mbox_chan_rmw()
141 th1520_mbox_chan_write(cp, val, off, is_remote); in th1520_mbox_chan_rmw()
145 static void th1520_mbox_chan_rd_data(struct th1520_mbox_con_priv *cp, in th1520_mbox_chan_rd_data() argument
156 *arg = th1520_mbox_chan_read(cp, off, is_remote); in th1520_mbox_chan_rd_data()
162 static void th1520_mbox_chan_wr_data(struct th1520_mbox_con_priv *cp, in th1520_mbox_chan_wr_data() argument
173 th1520_mbox_chan_write(cp, *arg, off, is_remote); in th1520_mbox_chan_wr_data()
179 static void th1520_mbox_chan_wr_ack(struct th1520_mbox_con_priv *cp, void *data, in th1520_mbox_chan_wr_ack() argument
185 th1520_mbox_chan_write(cp, *arg, off, is_remote); in th1520_mbox_chan_wr_ack()
188 static int th1520_mbox_chan_id_to_mapbit(struct th1520_mbox_con_priv *cp) in th1520_mbox_chan_id_to_mapbit() argument
194 if (i == cp->idx) in th1520_mbox_chan_id_to_mapbit()
202 dev_err(cp->chan->mbox->dev, "convert to mapbit failed\n"); in th1520_mbox_chan_id_to_mapbit()
211 struct th1520_mbox_con_priv *cp = chan->con_priv; in th1520_mbox_isr() local
212 int mapbit = th1520_mbox_chan_id_to_mapbit(cp); in th1520_mbox_isr()
225 info0_data = th1520_mbox_chan_read(cp, TH_1520_MBOX_INFO0, false); in th1520_mbox_isr()
228 th1520_mbox_chan_rd_data(cp, dat, false); in th1520_mbox_isr()
231 th1520_mbox_chan_write(cp, 0x0, TH_1520_MBOX_INFO0, false); in th1520_mbox_isr()
234 th1520_mbox_chan_wr_ack(cp, &ack_magic, true); in th1520_mbox_isr()
236 if (cp->idx != TH_1520_MBOX_ICU_CPU1 && in th1520_mbox_isr()
237 cp->idx != TH_1520_MBOX_ICU_CPU2) in th1520_mbox_isr()
238 th1520_mbox_chan_rmw(cp, TH_1520_MBOX_GEN, in th1520_mbox_isr()
246 info7_data = th1520_mbox_chan_read(cp, TH_1520_MBOX_INFO7, false); in th1520_mbox_isr()
249 th1520_mbox_chan_write(cp, 0x0, TH_1520_MBOX_INFO7, false); in th1520_mbox_isr()
263 struct th1520_mbox_con_priv *cp = chan->con_priv; in th1520_mbox_send_data() local
265 th1520_mbox_chan_wr_data(cp, data, true); in th1520_mbox_send_data()
266 th1520_mbox_chan_rmw(cp, TH_1520_MBOX_GEN, TH_1520_MBOX_GEN_RX_DATA, 0, in th1520_mbox_send_data()
274 struct th1520_mbox_con_priv *cp = chan->con_priv; in th1520_mbox_startup() local
280 th1520_mbox_chan_rmw(cp, TH_1520_MBOX_GEN, 0x0, 0xff, true); in th1520_mbox_startup()
281 th1520_mbox_chan_rmw(cp, TH_1520_MBOX_GEN, 0x0, 0xff, false); in th1520_mbox_startup()
282 th1520_mbox_chan_wr_ack(cp, &data[7], true); in th1520_mbox_startup()
283 th1520_mbox_chan_wr_ack(cp, &data[7], false); in th1520_mbox_startup()
284 th1520_mbox_chan_wr_data(cp, &data[0], true); in th1520_mbox_startup()
285 th1520_mbox_chan_wr_data(cp, &data[0], false); in th1520_mbox_startup()
288 mask_bit = th1520_mbox_chan_id_to_mapbit(cp); in th1520_mbox_startup()
308 IRQF_SHARED | IRQF_NO_SUSPEND, cp->irq_desc, chan); in th1520_mbox_startup()
320 struct th1520_mbox_con_priv *cp = chan->con_priv; in th1520_mbox_shutdown() local
326 mask_bit = th1520_mbox_chan_id_to_mapbit(cp); in th1520_mbox_shutdown()
483 struct th1520_mbox_con_priv *cp = &priv->con_priv[i]; in th1520_mbox_probe() local
485 cp->idx = i; in th1520_mbox_probe()
486 cp->chan = &priv->mbox_chans[i]; in th1520_mbox_probe()
487 priv->mbox_chans[i].con_priv = cp; in th1520_mbox_probe()
488 snprintf(cp->irq_desc, sizeof(cp->irq_desc), in th1520_mbox_probe()
489 "th1520_mbox_chan[%i]", cp->idx); in th1520_mbox_probe()
491 cp->comm_local_base = priv->local_icu[i]; in th1520_mbox_probe()
493 cp->comm_remote_base = priv->remote_icu[remote_idx]; in th1520_mbox_probe()