Lines Matching defs:message

914  * @message: the SPI message
917 static void spi_res_add(struct spi_message *message, void *res)
922 list_add_tail(&sres->entry, &message->resources);
926 * spi_res_release - release all SPI resources for this message
928 * @message: the @spi_message
930 static void spi_res_release(struct spi_controller *ctlr, struct spi_message *message)
934 list_for_each_entry_safe_reverse(res, tmp, &message->resources, entry) {
936 res->release(ctlr, message, res->data);
1669 dev_err(&ctlr->dev, "failed to prepare message: %d\n",
1713 "failed to transfer one message from queue\n");
1726 * __spi_pump_messages - function which processes SPI message queue
1728 * @in_kthread: true if we are in the context of the message pump thread
1730 * This function checks if there is any SPI message in the queue that
1732 * and transfer each message.
1751 /* Make sure we are not already running a message */
1824 * spi_pump_messages - kthread work function which processes spi message queue
1937 "will run message pump with realtime priority\n");
1949 dev_err(&ctlr->dev, "failed to create message pump kworker\n");
1957 * message pump with high (realtime) priority to reduce the transfer
1959 * request and the scheduling of the message pump thread. Without this
1960 * setting the message pump thread will remain at default priority.
1973 * If there are more messages in the queue, the next message is returned from
1976 * Return: the next message in the queue, else NULL if the queue is empty.
1983 /* Get a pointer to the next message, if any */
1994 * spi_finalize_current_message() - the current message is complete
1995 * @ctlr: the controller to return the message to
1997 * Called by the driver to notify the core that the message in the front of the
2033 dev_err(&ctlr->dev, "failed to unprepare message: %d\n",
2085 * friends on every SPI message. Do this instead.
2101 dev_warn(&ctlr->dev, "could not stop message queue\n");
2157 * @msg: SPI message which is to handled is queued to driver queue
3395 /* Insert replaced transfers back into the message */
3466 /* Insert replaced transfers back into the message */
3885 static int __spi_validate(struct spi_device *spi, struct spi_message *message)
3891 if (list_empty(&message->transfers))
3906 /* spi_split_transfers_maxsize() requires message->spi */
3907 message->spi = spi;
3909 ret = spi_split_transfers_maxsize(ctlr, message, maxsize,
3914 list_for_each_entry(xfer, &message->transfers, transfer_list) {
3916 if (list_is_last(&xfer->transfer_list, &message->transfers))
3932 list_for_each_entry(xfer, &message->transfers, transfer_list) {
3950 message->frame_length = 0;
3951 list_for_each_entry(xfer, &message->transfers, transfer_list) {
3953 message->frame_length += xfer->len;
4028 message->status = -EINPROGRESS;
4033 static int __spi_async(struct spi_device *spi, struct spi_message *message)
4045 message->spi = spi;
4050 trace_spi_message_submit(message);
4053 list_for_each_entry(xfer, &message->transfers, transfer_list) {
4059 return ctlr->transfer(spi, message);
4065 * @message: describes the data transfers, including completion callback
4072 * Before that invocation, the value of message->status is undefined.
4073 * When the callback is issued, message->status holds either zero (to
4085 * the entire message is aborted, and the device is deselected.
4086 * Until returning from the associated message completion callback,
4093 int spi_async(struct spi_device *spi, struct spi_message *message)
4099 ret = __spi_validate(spi, message);
4108 ret = __spi_async(spi, message);
4119 * @message: describes the data transfers, including completion callback
4126 * Before that invocation, the value of message->status is undefined.
4127 * When the callback is issued, message->status holds either zero (to
4139 * the entire message is aborted, and the device is deselected.
4140 * Until returning from the associated message completion callback,
4147 static int spi_async_locked(struct spi_device *spi, struct spi_message *message)
4153 ret = __spi_validate(spi, message);
4159 ret = __spi_async(spi, message);
4211 static int __spi_sync(struct spi_device *spi, struct spi_message *message)
4222 status = __spi_validate(spi, message);
4226 message->spi = spi;
4232 * Checking queue_empty here only guarantees async/sync message
4238 message->actual_length = 0;
4239 message->status = -EINPROGRESS;
4241 trace_spi_message_submit(message);
4246 __spi_transfer_message_noqueue(ctlr, message);
4248 return message->status;
4254 * Therefor we send the message to the async queue and wait until they
4257 message->complete = spi_complete;
4258 message->context = &done;
4259 status = spi_async_locked(spi, message);
4262 status = message->status;
4264 message->context = NULL;
4272 * @message: describes the data transfers
4277 * drivers may DMA directly into and out of the message buffers.
4279 * Note that the SPI device's chip select is active during the message,
4282 * by leaving it selected in anticipation that the next message will go
4286 * message will not be freed before this call returns.
4290 int spi_sync(struct spi_device *spi, struct spi_message *message)
4295 ret = __spi_sync(spi, message);
4305 * @message: describes the data transfers
4310 * drivers may DMA directly into and out of the message buffers.
4318 int spi_sync_locked(struct spi_device *spi, struct spi_message *message)
4320 return __spi_sync(spi, message);
4410 struct spi_message message;
4429 spi_message_init(&message);
4433 spi_message_add_tail(&x[0], &message);
4437 spi_message_add_tail(&x[1], &message);
4445 status = spi_sync(spi, &message);