Lines Matching defs:message

994  * @message: the SPI message
997 static void spi_res_add(struct spi_message *message, void *res)
1002 list_add_tail(&sres->entry, &message->resources);
1006 * spi_res_release - release all SPI resources for this message
1008 * @message: the @spi_message
1010 static void spi_res_release(struct spi_controller *ctlr, struct spi_message *message)
1014 list_for_each_entry_safe_reverse(res, tmp, &message->resources, entry) {
1016 res->release(ctlr, message, res->data);
1777 dev_err(&ctlr->dev, "failed to prepare message: %d\n",
1821 "failed to transfer one message from queue\n");
1834 * __spi_pump_messages - function which processes SPI message queue
1836 * @in_kthread: true if we are in the context of the message pump thread
1838 * This function checks if there is any SPI message in the queue that
1840 * and transfer each message.
1859 /* Make sure we are not already running a message */
1932 * spi_pump_messages - kthread work function which processes spi message queue
2045 "will run message pump with realtime priority\n");
2057 dev_err(&ctlr->dev, "failed to create message pump kworker\n");
2065 * message pump with high (realtime) priority to reduce the transfer
2067 * request and the scheduling of the message pump thread. Without this
2068 * setting the message pump thread will remain at default priority.
2081 * If there are more messages in the queue, the next message is returned from
2084 * Return: the next message in the queue, else NULL if the queue is empty.
2091 /* Get a pointer to the next message, if any */
2104 * @msg: the message to unoptimize
2110 * It is not valid to call this on a message that is not currently optimized.
2127 * @msg: the message to unoptimize
2129 * This function is used to unoptimize a message if and only if it was
2139 * spi_finalize_current_message() - the current message is complete
2140 * @ctlr: the controller to return the message to
2142 * Called by the driver to notify the core that the message in the front of the
2169 dev_err(&ctlr->dev, "failed to unprepare message: %d\n",
2223 * friends on every SPI message. Do this instead.
2291 * @msg: SPI message which is to handled is queued to driver queue
3567 /* Insert replaced transfers back into the message */
3638 /* Insert replaced transfers back into the message */
3763 * spi message unoptimize phase so this function should only be called from
3805 * spi message unoptimize phase so this function should only be called from
4060 static int __spi_validate(struct spi_device *spi, struct spi_message *message)
4066 if (list_empty(&message->transfers))
4069 message->spi = spi;
4081 list_for_each_entry(xfer, &message->transfers, transfer_list) {
4099 message->frame_length = 0;
4100 list_for_each_entry(xfer, &message->transfers, transfer_list) {
4102 message->frame_length += xfer->len;
4177 message->status = -EINPROGRESS;
4184 * @msg: the message to split
4188 * will split the transfers in the message into smaller transfers that are
4236 * @spi: the device that will be used for the message
4237 * @msg: the message to optimize
4242 * It is not valid to call this on a message that has already been optimized.
4274 * spi_maybe_optimize_message - optimize message if it isn't already pre-optimized
4275 * @spi: the device that will be used for the message
4276 * @msg: the message to optimize
4289 * spi_optimize_message - do any one-time validation and setup for a SPI message
4290 * @spi: the device that will be used for the message
4291 * @msg: the message to optimize
4293 * Peripheral drivers that reuse the same message repeatedly may call this to
4294 * perform as much message prep as possible once, rather than repeating it each
4295 * time a message transfer is performed to improve throughput and reduce CPU
4298 * Once a message has been optimized, it cannot be modified with the exception
4318 * and therefore we shouldn't unoptimize message automatically when finalizing
4319 * the message but rather wait until spi_unoptimize_message() is called
4330 * @msg: the message to unoptimize
4343 static int __spi_async(struct spi_device *spi, struct spi_message *message)
4358 trace_spi_message_submit(message);
4361 list_for_each_entry(xfer, &message->transfers, transfer_list) {
4367 return ctlr->transfer(spi, message);
4373 * @message: describes the data transfers, including completion callback
4380 * Before that invocation, the value of message->status is undefined.
4381 * When the callback is issued, message->status holds either zero (to
4393 * the entire message is aborted, and the device is deselected.
4394 * Until returning from the associated message completion callback,
4401 int spi_async(struct spi_device *spi, struct spi_message *message)
4407 ret = spi_maybe_optimize_message(spi, message);
4416 ret = __spi_async(spi, message);
4420 spi_maybe_unoptimize_message(message);
4470 static int __spi_sync(struct spi_device *spi, struct spi_message *message)
4482 status = spi_maybe_optimize_message(spi, message);
4490 * Checking queue_empty here only guarantees async/sync message
4496 message->actual_length = 0;
4497 message->status = -EINPROGRESS;
4499 trace_spi_message_submit(message);
4504 __spi_transfer_message_noqueue(ctlr, message);
4506 return message->status;
4512 * Therefor we send the message to the async queue and wait until they
4515 message->complete = spi_complete;
4516 message->context = &done;
4519 status = __spi_async(spi, message);
4524 status = message->status;
4526 message->complete = NULL;
4527 message->context = NULL;
4535 * @message: describes the data transfers
4540 * drivers may DMA directly into and out of the message buffers.
4542 * Note that the SPI device's chip select is active during the message,
4545 * by leaving it selected in anticipation that the next message will go
4549 * message will not be freed before this call returns.
4553 int spi_sync(struct spi_device *spi, struct spi_message *message)
4558 ret = __spi_sync(spi, message);
4568 * @message: describes the data transfers
4573 * drivers may DMA directly into and out of the message buffers.
4581 int spi_sync_locked(struct spi_device *spi, struct spi_message *message)
4583 return __spi_sync(spi, message);
4673 struct spi_message message;
4692 spi_message_init(&message);
4696 spi_message_add_tail(&x[0], &message);
4700 spi_message_add_tail(&x[1], &message);
4708 status = spi_sync(spi, &message);