}
}
- if (!err && (chan->txdone_method & TXDONE_BY_POLL)) {
+ if (!err && (chan->txdone_method & MBOX_TXDONE_BY_POLL)) {
/* kick start the timer immediately to avoid delays */
scoped_guard(spinlock_irqsave, &chan->mbox->poll_hrt_lock)
hrtimer_start(&chan->mbox->poll_hrt, 0, HRTIMER_MODE_REL);
*/
void mbox_chan_txdone(struct mbox_chan *chan, int r)
{
- if (unlikely(!(chan->txdone_method & TXDONE_BY_IRQ))) {
+ if (unlikely(!(chan->txdone_method & MBOX_TXDONE_BY_IRQ))) {
dev_err(chan->mbox->dev,
"Controller can't run the TX ticker\n");
return;
*/
void mbox_client_txdone(struct mbox_chan *chan, int r)
{
- if (unlikely(!(chan->txdone_method & TXDONE_BY_ACK))) {
+ if (unlikely(!(chan->txdone_method & MBOX_TXDONE_BY_ACK))) {
dev_err(chan->mbox->dev, "Client can't run the TX ticker\n");
return;
}
chan->cl = cl;
init_completion(&chan->tx_complete);
- if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
- chan->txdone_method = TXDONE_BY_ACK;
+ if (chan->txdone_method == MBOX_TXDONE_BY_POLL && cl->knows_txdone)
+ chan->txdone_method = MBOX_TXDONE_BY_ACK;
}
if (chan->mbox->ops->startup) {
scoped_guard(spinlock_irqsave, &chan->lock) {
chan->cl = NULL;
chan->active_req = MBOX_NO_MSG;
- if (chan->txdone_method == TXDONE_BY_ACK)
- chan->txdone_method = TXDONE_BY_POLL;
+ if (chan->txdone_method == MBOX_TXDONE_BY_ACK)
+ chan->txdone_method = MBOX_TXDONE_BY_POLL;
}
module_put(chan->mbox->dev->driver->owner);
return -EINVAL;
if (mbox->txdone_irq)
- txdone = TXDONE_BY_IRQ;
+ txdone = MBOX_TXDONE_BY_IRQ;
else if (mbox->txdone_poll)
- txdone = TXDONE_BY_POLL;
+ txdone = MBOX_TXDONE_BY_POLL;
else /* It has to be ACK then */
- txdone = TXDONE_BY_ACK;
+ txdone = MBOX_TXDONE_BY_ACK;
- if (txdone == TXDONE_BY_POLL) {
+ if (txdone == MBOX_TXDONE_BY_POLL) {
if (!mbox->ops->last_tx_done) {
dev_err(mbox->dev, "last_tx_done method is absent\n");
/* Sentinel value distinguishing "no active request" from "NULL message data" */
#define MBOX_NO_MSG ((void *)-1)
-#define TXDONE_BY_IRQ BIT(0) /* controller has remote RTR irq */
-#define TXDONE_BY_POLL BIT(1) /* controller can read status of last TX */
-#define TXDONE_BY_ACK BIT(2) /* S/W ACK received by Client ticks the TX */
+#define MBOX_TXDONE_BY_IRQ BIT(0) /* controller has remote RTR irq */
+#define MBOX_TXDONE_BY_POLL BIT(1) /* controller can read status of last TX */
+#define MBOX_TXDONE_BY_ACK BIT(2) /* S/W ACK received by Client ticks the TX */
/**
* struct mbox_chan_ops - methods to control mailbox channels