return retry ? 0 : -ETIMEDOUT;
}
-static int hi3660_mbox_startup(struct mbox_chan *chan)
+static int hi3660_mbox_send_data(struct mbox_chan *chan, void *msg)
{
+ unsigned long ch = (unsigned long)chan->con_priv;
+ struct hi3660_mbox *mbox = to_hi3660_mbox(chan->mbox);
+ struct hi3660_chan_info *mchan = &mbox->mchan[ch];
+ void __iomem *base = MBOX_BASE(mbox, ch);
+ u32 *buf = msg;
+ unsigned int i;
int ret;
ret = hi3660_mbox_check_state(chan);
if (ret)
return ret;
- return 0;
-}
-
-static int hi3660_mbox_send_data(struct mbox_chan *chan, void *msg)
-{
- unsigned long ch = (unsigned long)chan->con_priv;
- struct hi3660_mbox *mbox = to_hi3660_mbox(chan->mbox);
- struct hi3660_chan_info *mchan = &mbox->mchan[ch];
- void __iomem *base = MBOX_BASE(mbox, ch);
- u32 *buf = msg;
- unsigned int i;
-
/* Ensure channel is released */
writel_relaxed(0xffffffff, base + MBOX_IMASK_REG);
- writel_relaxed(BIT(mchan->ack_irq), base + MBOX_SRC_REG);
/* Clear mask for destination interrupt */
writel_relaxed(~BIT(mchan->dst_irq), base + MBOX_IMASK_REG);
}
static struct mbox_chan_ops hi3660_mbox_ops = {
- .startup = hi3660_mbox_startup,
.send_data = hi3660_mbox_send_data,
};