Lines Matching defs:message

1376  * __spi_pump_messages - function which processes spi message queue
1378 * @in_kthread: true if we are in the context of the message pump thread
1380 * This function checks if there is any spi message in the queue that
1382 * and transfer each message.
1399 /* Make sure we are not already running a message */
1505 dev_err(&ctlr->dev, "failed to prepare message: %d\n",
1531 "failed to transfer one message from queue\n");
1544 * spi_pump_messages - kthread work function which processes spi message queue
1658 "will run message pump with realtime priority\n");
1669 dev_err(&ctlr->dev, "failed to create message pump kworker\n");
1677 * message pump with high (realtime) priority to reduce the transfer
1679 * request and the scheduling of the message pump thread. Without this
1680 * setting the message pump thread will remain at default priority.
1693 * If there are more messages in the queue, the next message is returned from
1696 * Return: the next message in the queue, else NULL if the queue is empty.
1703 /* get a pointer to the next message, if any */
1714 * spi_finalize_current_message() - the current message is complete
1715 * @ctlr: the controller to return the message to
1717 * Called by the driver to notify the core that the message in the front of the
1754 dev_err(&ctlr->dev, "failed to unprepare message: %d\n",
1806 * friends on every SPI message. Do this instead.
1822 dev_warn(&ctlr->dev, "could not stop message queue\n");
1877 * @msg: spi message which is to handled is queued to driver queue
3028 * @message: the spi message
3031 void spi_res_add(struct spi_message *message, void *res)
3036 list_add_tail(&sres->entry, &message->resources);
3041 * spi_res_release - release all spi resources for this message
3043 * @message: the @spi_message
3045 void spi_res_release(struct spi_controller *ctlr, struct spi_message *message)
3049 list_for_each_entry_safe_reverse(res, tmp, &message->resources, entry) {
3051 res->release(ctlr, message, res->data);
3075 /* insert replaced transfers back into the message */
3144 /* insert replaced transfers back into the message */
3511 static int __spi_validate(struct spi_device *spi, struct spi_message *message)
3517 if (list_empty(&message->transfers))
3534 /* spi_split_transfers_maxsize() requires message->spi */
3535 message->spi = spi;
3537 ret = spi_split_transfers_maxsize(ctlr, message, maxsize,
3542 list_for_each_entry(xfer, &message->transfers, transfer_list) {
3544 if (list_is_last(&xfer->transfer_list, &message->transfers))
3559 list_for_each_entry(xfer, &message->transfers, transfer_list) {
3577 message->frame_length = 0;
3578 list_for_each_entry(xfer, &message->transfers, transfer_list) {
3580 message->frame_length += xfer->len;
3650 message->status = -EINPROGRESS;
3655 static int __spi_async(struct spi_device *spi, struct spi_message *message)
3667 message->spi = spi;
3672 trace_spi_message_submit(message);
3675 list_for_each_entry(xfer, &message->transfers, transfer_list) {
3681 return ctlr->transfer(spi, message);
3687 * @message: describes the data transfers, including completion callback
3694 * Before that invocation, the value of message->status is undefined.
3695 * When the callback is issued, message->status holds either zero (to
3707 * the entire message is aborted, and the device is deselected.
3708 * Until returning from the associated message completion callback,
3715 int spi_async(struct spi_device *spi, struct spi_message *message)
3721 ret = __spi_validate(spi, message);
3730 ret = __spi_async(spi, message);
3741 * @message: describes the data transfers, including completion callback
3748 * Before that invocation, the value of message->status is undefined.
3749 * When the callback is issued, message->status holds either zero (to
3761 * the entire message is aborted, and the device is deselected.
3762 * Until returning from the associated message completion callback,
3769 int spi_async_locked(struct spi_device *spi, struct spi_message *message)
3775 ret = __spi_validate(spi, message);
3781 ret = __spi_async(spi, message);
3802 static int __spi_sync(struct spi_device *spi, struct spi_message *message)
3809 status = __spi_validate(spi, message);
3813 message->complete = spi_complete;
3814 message->context = &done;
3815 message->spi = spi;
3823 * support for driver implemented message queues.
3828 trace_spi_message_submit(message);
3830 status = __spi_queued_transfer(spi, message, false);
3834 status = spi_async_locked(spi, message);
3850 status = message->status;
3852 message->context = NULL;
3859 * @message: describes the data transfers
3864 * drivers may DMA directly into and out of the message buffers.
3866 * Note that the SPI device's chip select is active during the message,
3869 * by leaving it selected in anticipation that the next message will go
3873 * message will not be freed before this call returns.
3877 int spi_sync(struct spi_device *spi, struct spi_message *message)
3882 ret = __spi_sync(spi, message);
3892 * @message: describes the data transfers
3897 * drivers may DMA directly into and out of the message buffers.
3905 int spi_sync_locked(struct spi_device *spi, struct spi_message *message)
3907 return __spi_sync(spi, message);
3997 struct spi_message message;
4015 spi_message_init(&message);
4019 spi_message_add_tail(&x[0], &message);
4023 spi_message_add_tail(&x[1], &message);
4031 status = spi_sync(spi, &message);