'\" t .\" Title: spi_async .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Serial Peripheral Interface (SPI) .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "SPI_ASYNC" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Serial Peripheral Interface (S" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" spi_async \- asynchronous SPI transfer .SH "SYNOPSIS" .HP \w'int\ spi_async('u .BI "int spi_async(struct\ spi_device\ *\ " "spi" ", struct\ spi_message\ *\ " "message" ");" .SH "ARGUMENTS" .PP \fIspi\fR .RS 4 device with which data will be exchanged .RE .PP \fImessage\fR .RS 4 describes the data transfers, including completion callback .RE .SH "CONTEXT" .PP any (irqs may be blocked, etc) .SH "DESCRIPTION" .PP This call may be used in_irq and other contexts which can\*(Aqt sleep, as well as from task contexts which can sleep\&. .PP The completion callback is invoked in a context which can\*(Aqt sleep\&. Before that invocation, the value of message\->status is undefined\&. When the callback is issued, message\->status holds either zero (to indicate complete success) or a negative error code\&. After that callback returns, the driver which issued the transfer request may deallocate the associated memory; it\*(Aqs no longer in use by any SPI core or controller driver code\&. .PP Note that although all messages to a spi_device are handled in FIFO order, messages may go to different devices in other orders\&. Some device might be higher priority, or have various \(lqhard\(rq access time requirements, for example\&. .PP On detection of any fault during the transfer, processing of the entire message is aborted, and the device is deselected\&. Until returning from the associated message completion callback, no other spi_message queued to that device will be processed\&. (This rule applies equally to all the synchronous transfer calls, which are wrappers around this core asynchronous primitive\&.) .SH "RETURN" .PP zero on success, else a negative error code\&. .SH "COPYRIGHT" .br