Lines Matching refs:mbox

80 	err = chan->mbox->ops->send_data(chan, data);  in msg_submit()
90 hrtimer_start(&chan->mbox->poll_hrt, ktime_set(0, 0), in msg_submit()
117 struct mbox_controller *mbox = in txdone_hrtimer() local
122 for (i = 0; i < mbox->num_chans; i++) { in txdone_hrtimer()
123 struct mbox_chan *chan = &mbox->chans[i]; in txdone_hrtimer()
126 txdone = chan->mbox->ops->last_tx_done(chan); in txdone_hrtimer()
135 hrtimer_forward_now(hrtimer, ms_to_ktime(mbox->txpoll_period)); in txdone_hrtimer()
172 dev_err(chan->mbox->dev, in mbox_chan_txdone()
193 dev_err(chan->mbox->dev, "Client can't run the TX ticker\n"); in mbox_client_txdone()
218 if (chan->mbox->ops->peek_data) in mbox_client_peek_data()
219 return chan->mbox->ops->peek_data(chan); in mbox_client_peek_data()
258 dev_err(chan->mbox->dev, "Try increasing MBOX_TX_QUEUE_LEN\n"); in mbox_send_message()
304 struct mbox_controller *mbox; in mbox_request_channel() local
325 list_for_each_entry(mbox, &mbox_cons, node) in mbox_request_channel()
326 if (mbox->dev->of_node == spec.np) { in mbox_request_channel()
327 chan = mbox->of_xlate(mbox, &spec); in mbox_request_channel()
338 if (chan->cl || !try_module_get(mbox->dev->driver->owner)) { in mbox_request_channel()
356 ret = chan->mbox->ops->startup(chan); in mbox_request_channel()
409 chan->mbox->ops->shutdown(chan); in mbox_free_channel()
418 module_put(chan->mbox->dev->driver->owner); in mbox_free_channel()
424 of_mbox_index_xlate(struct mbox_controller *mbox, in of_mbox_index_xlate() argument
429 if (ind >= mbox->num_chans) in of_mbox_index_xlate()
432 return &mbox->chans[ind]; in of_mbox_index_xlate()
441 int mbox_controller_register(struct mbox_controller *mbox) in mbox_controller_register() argument
446 if (!mbox || !mbox->dev || !mbox->ops || !mbox->num_chans) in mbox_controller_register()
449 if (mbox->txdone_irq) in mbox_controller_register()
451 else if (mbox->txdone_poll) in mbox_controller_register()
457 hrtimer_init(&mbox->poll_hrt, CLOCK_MONOTONIC, in mbox_controller_register()
459 mbox->poll_hrt.function = txdone_hrtimer; in mbox_controller_register()
462 for (i = 0; i < mbox->num_chans; i++) { in mbox_controller_register()
463 struct mbox_chan *chan = &mbox->chans[i]; in mbox_controller_register()
466 chan->mbox = mbox; in mbox_controller_register()
471 if (!mbox->of_xlate) in mbox_controller_register()
472 mbox->of_xlate = of_mbox_index_xlate; in mbox_controller_register()
475 list_add_tail(&mbox->node, &mbox_cons); in mbox_controller_register()
486 void mbox_controller_unregister(struct mbox_controller *mbox) in mbox_controller_unregister() argument
490 if (!mbox) in mbox_controller_unregister()
495 list_del(&mbox->node); in mbox_controller_unregister()
497 for (i = 0; i < mbox->num_chans; i++) in mbox_controller_unregister()
498 mbox_free_channel(&mbox->chans[i]); in mbox_controller_unregister()
500 if (mbox->txdone_poll) in mbox_controller_unregister()
501 hrtimer_cancel(&mbox->poll_hrt); in mbox_controller_unregister()