sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget"/translations/zh_CN/driver-api/spimodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/zh_TW/driver-api/spimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/it_IT/driver-api/spimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ja_JP/driver-api/spimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ko_KR/driver-api/spimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/sp_SP/driver-api/spimodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h!Serial Peripheral Interface (SPI)h]h!Serial Peripheral Interface (SPI)}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh`. SPI devices are children of that master, represented as a :c:type:`struct spi_device ` and manufactured from :c:type:`struct spi_board_info ` descriptors which are usually provided by board-specific initialization code. A :c:type:`struct spi_driver ` is called a "Protocol Driver", and is bound to a spi_device using normal driver model calls.h](hXThe programming interface is structured around two kinds of driver, and two kinds of device. A “Controller Driver” abstracts the controller hardware, which may be as simple as a set of GPIO pins or as complex as a pair of FIFOs connected to dual DMA engines on the other side of the SPI shift register (maximizing throughput). Such drivers bridge between whatever bus they sit on (often the platform bus) and SPI, and expose the SPI side of their device as a }(hhhhhNhNubh)}(h0:c:type:`struct spi_controller `h]hliteral)}(hhh]hstruct spi_controller}(hhhhhNhNubah}(h]h ](xrefcc-typeeh"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]refdocdriver-api/spi refdomainhreftypetype refexplicitrefwarn reftargetspi_controlleruh1hhhhKhhubh<. SPI devices are children of that master, represented as a }(hhhhhNhNubh)}(h(:c:type:`struct spi_device `h]h)}(hjh]hstruct spi_device}(hj hhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnj spi_deviceuh1hhhhKhhubh and manufactured from }(hhhhhNhNubh)}(h0:c:type:`struct spi_board_info `h]h)}(hj+h]hstruct spi_board_info}(hj-hhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj)ubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnjspi_board_infouh1hhhhKhhubhQ descriptors which are usually provided by board-specific initialization code. A }(hhhhhNhNubh)}(h(:c:type:`struct spi_driver `h]h)}(hjNh]hstruct spi_driver}(hjPhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjLubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnj spi_driveruh1hhhhKhhubha is called a “Protocol Driver”, and is bound to a spi_device using normal driver model calls.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe I/O model is a set of queued messages. Protocol drivers submit one or more :c:type:`struct spi_message ` objects, which are processed and completed asynchronously. (There are synchronous wrappers, however.) Messages are built from one or more :c:type:`struct spi_transfer ` objects, each of which wraps a full duplex SPI transfer. A variety of protocol tweaking options are needed, because different chips adopt very different policies for how they use the bits transferred with SPI.h](hOThe I/O model is a set of queued messages. Protocol drivers submit one or more }(hjuhhhNhNubh)}(h*:c:type:`struct spi_message `h]h)}(hjh]hstruct spi_message}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj}ubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnj spi_messageuh1hhhhK%hjuubh objects, which are processed and completed asynchronously. (There are synchronous wrappers, however.) Messages are built from one or more }(hjuhhhNhNubh)}(h,:c:type:`struct spi_transfer `h]h)}(hjh]hstruct spi_transfer}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnj spi_transferuh1hhhhK%hjuubh objects, each of which wraps a full duplex SPI transfer. A variety of protocol tweaking options are needed, because different chips adopt very different policies for how they use the bits transferred with SPI.}(hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK%hhhhubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singlespi_statistics (C struct)c.spi_statisticshNtauh1jhhhhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhNubhdesc)}(hhh](hdesc_signature)}(hspi_statisticsh]hdesc_signature_line)}(hstruct spi_statisticsh](hdesc_sig_keyword)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]kah"]h$]h&]uh1jhjhhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhKubh desc_name)}(hspi_statisticsh]h desc_sig_name)}(hjh]hspi_statistics}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&] xml:spacepreserveuh1jhjhhhjhKubeh}(h]h ]h"]h$]h&]j-j. add_permalinkuh1jsphinx_line_type declaratorhjhhhjhKubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhKhjhhubh desc_content)}(hhh]h)}(hstatistics for spi transfersh]hstatistics for spi transfers}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK,hjEhhubah}(h]h ]h"]h$]h&]uh1jChjhhhjhKubeh}(h]h ](hstructeh"]h$]h&]domainhobjtypej`desctypej`noindex noindexentrynocontentsentryuh1jhhhhhjhNubh container)}(hXW**Definition**:: struct spi_statistics { struct u64_stats_sync syncp; u64_stats_t messages; u64_stats_t transfers; u64_stats_t errors; u64_stats_t timedout; u64_stats_t spi_sync; u64_stats_t spi_sync_immediate; u64_stats_t spi_async; u64_stats_t bytes; u64_stats_t bytes_rx; u64_stats_t bytes_tx; #define SPI_STATISTICS_HISTO_SIZE 17; u64_stats_t transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE]; u64_stats_t transfers_split_maxsize; }; **Members** ``syncp`` seqcount to protect members in this struct for per-cpu update on 32-bit systems ``messages`` number of spi-messages handled ``transfers`` number of spi_transfers handled ``errors`` number of errors during spi_transfer ``timedout`` number of timeouts during spi_transfer ``spi_sync`` number of times spi_sync is used ``spi_sync_immediate`` number of times spi_sync is executed immediately in calling context without queuing and scheduling ``spi_async`` number of times spi_async is used ``bytes`` number of bytes transferred to/from device ``bytes_rx`` number of bytes received from device ``bytes_tx`` number of bytes sent to device ``transfer_bytes_histo`` transfer bytes histogram ``transfers_split_maxsize`` number of transfers that have been split because of maxsize limith](h)}(h**Definition**::h](hstrong)}(h**Definition**h]h Definition}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjpubh:}(hjphhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK0hjlubh literal_block)}(hXstruct spi_statistics { struct u64_stats_sync syncp; u64_stats_t messages; u64_stats_t transfers; u64_stats_t errors; u64_stats_t timedout; u64_stats_t spi_sync; u64_stats_t spi_sync_immediate; u64_stats_t spi_async; u64_stats_t bytes; u64_stats_t bytes_rx; u64_stats_t bytes_tx; #define SPI_STATISTICS_HISTO_SIZE 17; u64_stats_t transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE]; u64_stats_t transfers_split_maxsize; };h]hXstruct spi_statistics { struct u64_stats_sync syncp; u64_stats_t messages; u64_stats_t transfers; u64_stats_t errors; u64_stats_t timedout; u64_stats_t spi_sync; u64_stats_t spi_sync_immediate; u64_stats_t spi_async; u64_stats_t bytes; u64_stats_t bytes_rx; u64_stats_t bytes_tx; #define SPI_STATISTICS_HISTO_SIZE 17; u64_stats_t transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE]; u64_stats_t transfers_split_maxsize; };}hjsbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK2hjlubh)}(h **Members**h]ju)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKChjlubhdefinition_list)}(hhh](hdefinition_list_item)}(hZ``syncp`` seqcount to protect members in this struct for per-cpu update on 32-bit systems h](hterm)}(h ``syncp``h]h)}(hjh]hsyncp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK/hjubh definition)}(hhh]h)}(hOseqcount to protect members in this struct for per-cpu update on 32-bit systemsh]hOseqcount to protect members in this struct for per-cpu update on 32-bit systems}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK.hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK/hjubj)}(h,``messages`` number of spi-messages handled h](j)}(h ``messages``h]h)}(hjh]hmessages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK1hjubj)}(hhh]h)}(hnumber of spi-messages handledh]hnumber of spi-messages handled}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK1hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK1hjubj)}(h.``transfers`` number of spi_transfers handled h](j)}(h ``transfers``h]h)}(hj<h]h transfers}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj:ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK2hj6ubj)}(hhh]h)}(hnumber of spi_transfers handledh]hnumber of spi_transfers handled}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQhK2hjRubah}(h]h ]h"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]uh1jhjQhK2hjubj)}(h0``errors`` number of errors during spi_transfer h](j)}(h ``errors``h]h)}(hjuh]herrors}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjsubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK3hjoubj)}(hhh]h)}(h$number of errors during spi_transferh]h$number of errors during spi_transfer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK3hjubah}(h]h ]h"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]uh1jhjhK3hjubj)}(h4``timedout`` number of timeouts during spi_transfer h](j)}(h ``timedout``h]h)}(hjh]htimedout}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK4hjubj)}(hhh]h)}(h&number of timeouts during spi_transferh]h&number of timeouts during spi_transfer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK4hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK4hjubj)}(h.``spi_sync`` number of times spi_sync is used h](j)}(h ``spi_sync``h]h)}(hjh]hspi_sync}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK6hjubj)}(hhh]h)}(h number of times spi_sync is usedh]h number of times spi_sync is used}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK6hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK6hjubj)}(hz``spi_sync_immediate`` number of times spi_sync is executed immediately in calling context without queuing and scheduling h](j)}(h``spi_sync_immediate``h]h)}(hj h]hspi_sync_immediate}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK8hjubj)}(hhh]h)}(hbnumber of times spi_sync is executed immediately in calling context without queuing and schedulingh]hbnumber of times spi_sync is executed immediately in calling context without queuing and scheduling}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK7hj6ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj5hK8hjubj)}(h0``spi_async`` number of times spi_async is used h](j)}(h ``spi_async``h]h)}(hjZh]h spi_async}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK:hjTubj)}(hhh]h)}(h!number of times spi_async is usedh]h!number of times spi_async is used}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohK:hjpubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1jhjohK:hjubj)}(h5``bytes`` number of bytes transferred to/from device h](j)}(h ``bytes``h]h)}(hjh]hbytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubj)}(hhh]h)}(h$number of bytes received from deviceh]h$number of bytes received from device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK>hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK>hjubj)}(h,``bytes_tx`` number of bytes sent to device h](j)}(h ``bytes_tx``h]h)}(hjh]hbytes_tx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK=hjubj)}(hhh]h)}(hnumber of bytes sent to deviceh]hnumber of bytes sent to device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK=hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhK=hjubj)}(h2``transfer_bytes_histo`` transfer bytes histogram h](j)}(h``transfer_bytes_histo``h]h)}(hj>h]htransfer_bytes_histo}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK@hj8ubj)}(hhh]h)}(htransfer bytes histogramh]htransfer bytes histogram}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShK@hjTubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1jhjShK@hjubj)}(h]``transfers_split_maxsize`` number of transfers that have been split because of maxsize limith](j)}(h``transfers_split_maxsize``h]h)}(hjwh]htransfers_split_maxsize}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKChjqubj)}(hhh]h)}(hAnumber of transfers that have been split because of maxsize limith]hAnumber of transfers that have been split because of maxsize limit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKChjubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1jhjhKChjubeh}(h]h ]h"]h$]h&]uh1jhjlubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_delay (C struct) c.spi_delayhNtauh1jhhhhhjhNubj)}(hhh](j)}(h spi_delayh]j)}(hstruct spi_delayh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKJubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhjhKJubj)}(h spi_delayh]j)}(hjh]h spi_delay}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhjhKJubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhjhKJubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjhKJhjhhubjD)}(hhh]h)}(hSPI delay informationh]hSPI delay information}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKshjhhubah}(h]h ]h"]h$]h&]uh1jChjhhhjhKJubeh}(h]h ](hstructeh"]h$]h&]jdhjej*jfj*jgjhjiuh1jhhhhhjhNubjk)}(hX**Definition**:: struct spi_delay { #define SPI_DELAY_UNIT_USECS 0; #define SPI_DELAY_UNIT_NSECS 1; #define SPI_DELAY_UNIT_SCK 2; u16 value; u8 unit; }; **Members** ``value`` Value for the delay ``unit`` Unit for the delayh](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj2ubh:}(hj2hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKwhj.ubj)}(hstruct spi_delay { #define SPI_DELAY_UNIT_USECS 0; #define SPI_DELAY_UNIT_NSECS 1; #define SPI_DELAY_UNIT_SCK 2; u16 value; u8 unit; };h]hstruct spi_delay { #define SPI_DELAY_UNIT_USECS 0; #define SPI_DELAY_UNIT_NSECS 1; #define SPI_DELAY_UNIT_SCK 2; u16 value; u8 unit; };}hjOsbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKyhj.ubh)}(h **Members**h]ju)}(hj`h]hMembers}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj^ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj.ubj)}(hhh](j)}(h``value`` Value for the delay h](j)}(h ``value``h]h)}(hjh]hvalue}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj}ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKuhjyubj)}(hhh]h)}(hValue for the delayh]hValue for the delay}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKuhjubah}(h]h ]h"]h$]h&]uh1jhjyubeh}(h]h ]h"]h$]h&]uh1jhjhKuhjvubj)}(h``unit`` Unit for the delayh](j)}(h``unit``h]h)}(hjh]hunit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKuhjubj)}(hhh]h)}(hUnit for the delayh]hUnit for the delay}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKvhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKuhjvubeh}(h]h ]h"]h$]h&]uh1jhj.ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_device (C struct) c.spi_devicehNtauh1jhhhhhjhNubj)}(hhh](j)}(h spi_deviceh]j)}(hstruct spi_deviceh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhK|ubj)}(h h]h }(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhjhK|ubj)}(h spi_deviceh]j)}(hj h]h spi_device}(hj2hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj.ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhjhK|ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hj hhhjhK|ubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjhK|hjhhubjD)}(hhh]h)}(h.Controller side proxy for an SPI target deviceh]h.Controller side proxy for an SPI target device}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjQhhubah}(h]h ]h"]h$]h&]uh1jChjhhhjhK|ubeh}(h]h ](hstructeh"]h$]h&]jdhjejljfjljgjhjiuh1jhhhhhjhNubjk)}(hX**Definition**:: struct spi_device { struct device dev; struct spi_controller *controller; u32 max_speed_hz; u8 bits_per_word; bool rt; #define SPI_NO_TX BIT(31); #define SPI_NO_RX BIT(30); #define SPI_TPM_HW_FLOW BIT(29); #define SPI_MODE_KERNEL_MASK (~(BIT(29) - 1)); u32 mode; int irq; void *controller_state; void *controller_data; char modalias[SPI_NAME_SIZE]; const char *driver_override; struct spi_statistics __percpu *pcpu_statistics; struct spi_delay word_delay; struct spi_delay cs_setup; struct spi_delay cs_hold; struct spi_delay cs_inactive; u8 chip_select[SPI_DEVICE_CS_CNT_MAX]; u8 num_chipselect; u32 cs_index_mask : SPI_DEVICE_CS_CNT_MAX; struct gpio_desc *cs_gpiod[SPI_DEVICE_CS_CNT_MAX]; }; **Members** ``dev`` Driver model representation of the device. ``controller`` SPI controller used with the device. ``max_speed_hz`` Maximum clock rate to be used with this chip (on this board); may be changed by the device's driver. The spi_transfer.speed_hz can override this for each transfer. ``bits_per_word`` Data transfers involve one or more words; word sizes like eight or 12 bits are common. In-memory wordsizes are powers of two bytes (e.g. 20 bit samples use 32 bits). This may be changed by the device's driver, or left at the default (0) indicating protocol words are eight bit bytes. The spi_transfer.bits_per_word can override this for each transfer. ``rt`` Make the pump thread real time priority. ``mode`` The spi mode defines how data is clocked out and in. This may be changed by the device's driver. The "active low" default for chipselect mode can be overridden (by specifying SPI_CS_HIGH) as can the "MSB first" default for each word in a transfer (by specifying SPI_LSB_FIRST). ``irq`` Negative, or the number passed to request_irq() to receive interrupts from this device. ``controller_state`` Controller's runtime state ``controller_data`` Board-specific definitions for controller, such as FIFO initialization parameters; from board_info.controller_data ``modalias`` Name of the driver to use with this device, or an alias for that name. This appears in the sysfs "modalias" attribute for driver coldplugging, and in uevents used for hotplugging ``driver_override`` If the name of a driver is written to this attribute, then the device will bind to the named driver and only the named driver. Do not set directly, because core frees it; use driver_set_override() to set or clear it. ``pcpu_statistics`` statistics for the spi_device ``word_delay`` delay to be inserted between consecutive words of a transfer ``cs_setup`` delay to be introduced by the controller after CS is asserted ``cs_hold`` delay to be introduced by the controller before CS is deasserted ``cs_inactive`` delay to be introduced by the controller after CS is deasserted. If **cs_change_delay** is used from **spi_transfer**, then the two delays will be added up. ``chip_select`` Array of physical chipselect, spi->chipselect[i] gives the corresponding physical CS for logical CS i. ``num_chipselect`` Number of physical chipselects used. ``cs_index_mask`` Bit mask of the active chipselect(s) in the chipselect array ``cs_gpiod`` Array of GPIO descriptors of the corresponding chipselect lines (optional, NULL when not using a GPIO line)h](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjtubh:}(hjthhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjpubj)}(hXistruct spi_device { struct device dev; struct spi_controller *controller; u32 max_speed_hz; u8 bits_per_word; bool rt; #define SPI_NO_TX BIT(31); #define SPI_NO_RX BIT(30); #define SPI_TPM_HW_FLOW BIT(29); #define SPI_MODE_KERNEL_MASK (~(BIT(29) - 1)); u32 mode; int irq; void *controller_state; void *controller_data; char modalias[SPI_NAME_SIZE]; const char *driver_override; struct spi_statistics __percpu *pcpu_statistics; struct spi_delay word_delay; struct spi_delay cs_setup; struct spi_delay cs_hold; struct spi_delay cs_inactive; u8 chip_select[SPI_DEVICE_CS_CNT_MAX]; u8 num_chipselect; u32 cs_index_mask : SPI_DEVICE_CS_CNT_MAX; struct gpio_desc *cs_gpiod[SPI_DEVICE_CS_CNT_MAX]; };h]hXistruct spi_device { struct device dev; struct spi_controller *controller; u32 max_speed_hz; u8 bits_per_word; bool rt; #define SPI_NO_TX BIT(31); #define SPI_NO_RX BIT(30); #define SPI_TPM_HW_FLOW BIT(29); #define SPI_MODE_KERNEL_MASK (~(BIT(29) - 1)); u32 mode; int irq; void *controller_state; void *controller_data; char modalias[SPI_NAME_SIZE]; const char *driver_override; struct spi_statistics __percpu *pcpu_statistics; struct spi_delay word_delay; struct spi_delay cs_setup; struct spi_delay cs_hold; struct spi_delay cs_inactive; u8 chip_select[SPI_DEVICE_CS_CNT_MAX]; u8 num_chipselect; u32 cs_index_mask : SPI_DEVICE_CS_CNT_MAX; struct gpio_desc *cs_gpiod[SPI_DEVICE_CS_CNT_MAX]; };}hjsbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjpubh)}(h **Members**h]ju)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjpubj)}(hhh](j)}(h3``dev`` Driver model representation of the device. h](j)}(h``dev``h]h)}(hjh]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubj)}(hhh]h)}(h*Driver model representation of the device.h]h*Driver model representation of the device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(h4``controller`` SPI controller used with the device. h](j)}(h``controller``h]h)}(hjh]h controller}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubj)}(hhh]h)}(h$SPI controller used with the device.h]h$SPI controller used with the device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(h``max_speed_hz`` Maximum clock rate to be used with this chip (on this board); may be changed by the device's driver. The spi_transfer.speed_hz can override this for each transfer. h](j)}(h``max_speed_hz``h]h)}(hj3h]h max_speed_hz}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj-ubj)}(hhh]h)}(hMaximum clock rate to be used with this chip (on this board); may be changed by the device's driver. The spi_transfer.speed_hz can override this for each transfer.h]hMaximum clock rate to be used with this chip (on this board); may be changed by the device’s driver. The spi_transfer.speed_hz can override this for each transfer.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjIubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jhjHhKhjubj)}(hXs``bits_per_word`` Data transfers involve one or more words; word sizes like eight or 12 bits are common. In-memory wordsizes are powers of two bytes (e.g. 20 bit samples use 32 bits). This may be changed by the device's driver, or left at the default (0) indicating protocol words are eight bit bytes. The spi_transfer.bits_per_word can override this for each transfer. h](j)}(h``bits_per_word``h]h)}(hjmh]h bits_per_word}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhjkubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjgubj)}(hhh]h)}(hX`Data transfers involve one or more words; word sizes like eight or 12 bits are common. In-memory wordsizes are powers of two bytes (e.g. 20 bit samples use 32 bits). This may be changed by the device's driver, or left at the default (0) indicating protocol words are eight bit bytes. The spi_transfer.bits_per_word can override this for each transfer.h]hXbData transfers involve one or more words; word sizes like eight or 12 bits are common. In-memory wordsizes are powers of two bytes (e.g. 20 bit samples use 32 bits). This may be changed by the device’s driver, or left at the default (0) indicating protocol words are eight bit bytes. The spi_transfer.bits_per_word can override this for each transfer.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjgubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(h0``rt`` Make the pump thread real time priority. h](j)}(h``rt``h]h)}(hjh]hrt}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubj)}(hhh]h)}(h(Make the pump thread real time priority.h]h(Make the pump thread real time priority.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(hX``mode`` The spi mode defines how data is clocked out and in. This may be changed by the device's driver. The "active low" default for chipselect mode can be overridden (by specifying SPI_CS_HIGH) as can the "MSB first" default for each word in a transfer (by specifying SPI_LSB_FIRST). h](j)}(h``mode``h]h)}(hjh]hmode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubj)}(hhh]h)}(hXThe spi mode defines how data is clocked out and in. This may be changed by the device's driver. The "active low" default for chipselect mode can be overridden (by specifying SPI_CS_HIGH) as can the "MSB first" default for each word in a transfer (by specifying SPI_LSB_FIRST).h]hXThe spi mode defines how data is clocked out and in. This may be changed by the device’s driver. The “active low” default for chipselect mode can be overridden (by specifying SPI_CS_HIGH) as can the “MSB first” default for each word in a transfer (by specifying SPI_LSB_FIRST).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(h```irq`` Negative, or the number passed to request_irq() to receive interrupts from this device. h](j)}(h``irq``h]h)}(hj h]hirq}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubj)}(hhh]h)}(hWNegative, or the number passed to request_irq() to receive interrupts from this device.h]hWNegative, or the number passed to request_irq() to receive interrupts from this device.}(hj3 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj0 ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj/ hKhjubj)}(h0``controller_state`` Controller's runtime state h](j)}(h``controller_state``h]h)}(hjT h]hcontroller_state}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjR ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjN ubj)}(hhh]h)}(hController's runtime stateh]hController’s runtime state}(hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji hKhjj ubah}(h]h ]h"]h$]h&]uh1jhjN ubeh}(h]h ]h"]h$]h&]uh1jhji hKhjubj)}(h``controller_data`` Board-specific definitions for controller, such as FIFO initialization parameters; from board_info.controller_data h](j)}(h``controller_data``h]h)}(hj h]hcontroller_data}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubj)}(hhh]h)}(hrBoard-specific definitions for controller, such as FIFO initialization parameters; from board_info.controller_datah]hrBoard-specific definitions for controller, such as FIFO initialization parameters; from board_info.controller_data}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hKhjubj)}(h``modalias`` Name of the driver to use with this device, or an alias for that name. This appears in the sysfs "modalias" attribute for driver coldplugging, and in uevents used for hotplugging h](j)}(h ``modalias``h]h)}(hj h]hmodalias}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubj)}(hhh]h)}(hName of the driver to use with this device, or an alias for that name. This appears in the sysfs "modalias" attribute for driver coldplugging, and in uevents used for hotpluggingh]hName of the driver to use with this device, or an alias for that name. This appears in the sysfs “modalias” attribute for driver coldplugging, and in uevents used for hotplugging}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hKhjubj)}(h``driver_override`` If the name of a driver is written to this attribute, then the device will bind to the named driver and only the named driver. Do not set directly, because core frees it; use driver_set_override() to set or clear it. h](j)}(h``driver_override``h]h)}(hj h]hdriver_override}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubj)}(hhh]h)}(hIf the name of a driver is written to this attribute, then the device will bind to the named driver and only the named driver. Do not set directly, because core frees it; use driver_set_override() to set or clear it.h]hIf the name of a driver is written to this attribute, then the device will bind to the named driver and only the named driver. Do not set directly, because core frees it; use driver_set_override() to set or clear it.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hKhjubj)}(h2``pcpu_statistics`` statistics for the spi_device h](j)}(h``pcpu_statistics``h]h)}(hj; h]hpcpu_statistics}(hj= hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9 ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj5 ubj)}(hhh]h)}(hstatistics for the spi_deviceh]hstatistics for the spi_device}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjP hKhjQ ubah}(h]h ]h"]h$]h&]uh1jhj5 ubeh}(h]h ]h"]h$]h&]uh1jhjP hKhjubj)}(hL``word_delay`` delay to be inserted between consecutive words of a transfer h](j)}(h``word_delay``h]h)}(hjt h]h word_delay}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjr ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjn ubj)}(hhh]h)}(hchipselect[i] gives the corresponding physical CS for logical CS i. h](j)}(h``chip_select``h]h)}(hj~ h]h chip_select}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj| ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjx ubj)}(hhh]h)}(hfArray of physical chipselect, spi->chipselect[i] gives the corresponding physical CS for logical CS i.h]hfArray of physical chipselect, spi->chipselect[i] gives the corresponding physical CS for logical CS i.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhjx ubeh}(h]h ]h"]h$]h&]uh1jhj hKhjubj)}(h8``num_chipselect`` Number of physical chipselects used. h](j)}(h``num_chipselect``h]h)}(hj h]hnum_chipselect}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubj)}(hhh]h)}(h$Number of physical chipselects used.h]h$Number of physical chipselects used.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hKhjubj)}(hO``cs_index_mask`` Bit mask of the active chipselect(s) in the chipselect array h](j)}(h``cs_index_mask``h]h)}(hj h]h cs_index_mask}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhj ubj)}(hhh]h)}(hptp_sts** as close as possible to the moment in time when **spi_transfer->ptp_sts_word_pre** and **spi_transfer->ptp_sts_word_post** were transmitted. If the driver does not set this, the SPI core takes the snapshot as close to the driver hand-over as possible. ``irq_flags`` Interrupt enable state during PTP system timestamping ``queue_empty`` signal green light for opportunistically skipping the queue for spi_sync transfers. ``must_async`` disable all fast paths in the core ``defer_optimize_message`` set to true if controller cannot pre-optimize messages and needs to defer the optimization step until the message is actually being transferredh](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hXstruct spi_controller { struct device dev; struct list_head list; s16 bus_num; u16 num_chipselect; u16 dma_alignment; u32 mode_bits; u32 buswidth_override_bits; u32 bits_per_word_mask; #define SPI_BPW_MASK(bits) BIT((bits) - 1); #define SPI_BPW_RANGE_MASK(min, max) GENMASK((max) - 1, (min) - 1); u32 min_speed_hz; u32 max_speed_hz; u16 flags; #define SPI_CONTROLLER_HALF_DUPLEX BIT(0); #define SPI_CONTROLLER_NO_RX BIT(1); #define SPI_CONTROLLER_NO_TX BIT(2); #define SPI_CONTROLLER_MUST_RX BIT(3); #define SPI_CONTROLLER_MUST_TX BIT(4); #define SPI_CONTROLLER_GPIO_SS BIT(5); #define SPI_CONTROLLER_SUSPENDED BIT(6); #define SPI_CONTROLLER_MULTI_CS BIT(7); bool devm_allocated; union { bool slave; bool target; }; size_t (*max_transfer_size)(struct spi_device *spi); size_t (*max_message_size)(struct spi_device *spi); struct mutex io_mutex; struct mutex add_lock; spinlock_t bus_lock_spinlock; struct mutex bus_lock_mutex; bool bus_lock_flag; int (*setup)(struct spi_device *spi); int (*set_cs_timing)(struct spi_device *spi); int (*transfer)(struct spi_device *spi, struct spi_message *mesg); void (*cleanup)(struct spi_device *spi); bool (*can_dma)(struct spi_controller *ctlr, struct spi_device *spi, struct spi_transfer *xfer); struct device *dma_map_dev; struct device *cur_rx_dma_dev; struct device *cur_tx_dma_dev; bool queued; struct kthread_worker *kworker; struct kthread_work pump_messages; spinlock_t queue_lock; struct list_head queue; struct spi_message *cur_msg; struct completion cur_msg_completion; bool cur_msg_incomplete; bool cur_msg_need_completion; bool busy; bool running; bool rt; bool auto_runtime_pm; bool fallback; bool last_cs_mode_high; s8 last_cs[SPI_DEVICE_CS_CNT_MAX]; u32 last_cs_index_mask : SPI_DEVICE_CS_CNT_MAX; struct completion xfer_completion; size_t max_dma_len; int (*optimize_message)(struct spi_message *msg); int (*unoptimize_message)(struct spi_message *msg); int (*prepare_transfer_hardware)(struct spi_controller *ctlr); int (*transfer_one_message)(struct spi_controller *ctlr, struct spi_message *mesg); int (*unprepare_transfer_hardware)(struct spi_controller *ctlr); int (*prepare_message)(struct spi_controller *ctlr, struct spi_message *message); int (*unprepare_message)(struct spi_controller *ctlr, struct spi_message *message); int (*target_abort)(struct spi_controller *ctlr); void (*set_cs)(struct spi_device *spi, bool enable); int (*transfer_one)(struct spi_controller *ctlr, struct spi_device *spi, struct spi_transfer *transfer); void (*handle_err)(struct spi_controller *ctlr, struct spi_message *message); const struct spi_controller_mem_ops *mem_ops; const struct spi_controller_mem_caps *mem_caps; bool dtr_caps; struct spi_offload *(*get_offload)(struct spi_device *spi, const struct spi_offload_config *config); void (*put_offload)(struct spi_offload *offload); struct gpio_desc **cs_gpiods; bool use_gpio_descriptors; s8 unused_native_cs; s8 max_native_cs; struct spi_statistics __percpu *pcpu_statistics; struct dma_chan *dma_tx; struct dma_chan *dma_rx; void *dummy_rx; void *dummy_tx; int (*fw_translate_cs)(struct spi_controller *ctlr, unsigned cs); bool ptp_sts_supported; unsigned long irq_flags; bool queue_empty; bool must_async; bool defer_optimize_message; };h]hXstruct spi_controller { struct device dev; struct list_head list; s16 bus_num; u16 num_chipselect; u16 dma_alignment; u32 mode_bits; u32 buswidth_override_bits; u32 bits_per_word_mask; #define SPI_BPW_MASK(bits) BIT((bits) - 1); #define SPI_BPW_RANGE_MASK(min, max) GENMASK((max) - 1, (min) - 1); u32 min_speed_hz; u32 max_speed_hz; u16 flags; #define SPI_CONTROLLER_HALF_DUPLEX BIT(0); #define SPI_CONTROLLER_NO_RX BIT(1); #define SPI_CONTROLLER_NO_TX BIT(2); #define SPI_CONTROLLER_MUST_RX BIT(3); #define SPI_CONTROLLER_MUST_TX BIT(4); #define SPI_CONTROLLER_GPIO_SS BIT(5); #define SPI_CONTROLLER_SUSPENDED BIT(6); #define SPI_CONTROLLER_MULTI_CS BIT(7); bool devm_allocated; union { bool slave; bool target; }; size_t (*max_transfer_size)(struct spi_device *spi); size_t (*max_message_size)(struct spi_device *spi); struct mutex io_mutex; struct mutex add_lock; spinlock_t bus_lock_spinlock; struct mutex bus_lock_mutex; bool bus_lock_flag; int (*setup)(struct spi_device *spi); int (*set_cs_timing)(struct spi_device *spi); int (*transfer)(struct spi_device *spi, struct spi_message *mesg); void (*cleanup)(struct spi_device *spi); bool (*can_dma)(struct spi_controller *ctlr, struct spi_device *spi, struct spi_transfer *xfer); struct device *dma_map_dev; struct device *cur_rx_dma_dev; struct device *cur_tx_dma_dev; bool queued; struct kthread_worker *kworker; struct kthread_work pump_messages; spinlock_t queue_lock; struct list_head queue; struct spi_message *cur_msg; struct completion cur_msg_completion; bool cur_msg_incomplete; bool cur_msg_need_completion; bool busy; bool running; bool rt; bool auto_runtime_pm; bool fallback; bool last_cs_mode_high; s8 last_cs[SPI_DEVICE_CS_CNT_MAX]; u32 last_cs_index_mask : SPI_DEVICE_CS_CNT_MAX; struct completion xfer_completion; size_t max_dma_len; int (*optimize_message)(struct spi_message *msg); int (*unoptimize_message)(struct spi_message *msg); int (*prepare_transfer_hardware)(struct spi_controller *ctlr); int (*transfer_one_message)(struct spi_controller *ctlr, struct spi_message *mesg); int (*unprepare_transfer_hardware)(struct spi_controller *ctlr); int (*prepare_message)(struct spi_controller *ctlr, struct spi_message *message); int (*unprepare_message)(struct spi_controller *ctlr, struct spi_message *message); int (*target_abort)(struct spi_controller *ctlr); void (*set_cs)(struct spi_device *spi, bool enable); int (*transfer_one)(struct spi_controller *ctlr, struct spi_device *spi, struct spi_transfer *transfer); void (*handle_err)(struct spi_controller *ctlr, struct spi_message *message); const struct spi_controller_mem_ops *mem_ops; const struct spi_controller_mem_caps *mem_caps; bool dtr_caps; struct spi_offload *(*get_offload)(struct spi_device *spi, const struct spi_offload_config *config); void (*put_offload)(struct spi_offload *offload); struct gpio_desc **cs_gpiods; bool use_gpio_descriptors; s8 unused_native_cs; s8 max_native_cs; struct spi_statistics __percpu *pcpu_statistics; struct dma_chan *dma_tx; struct dma_chan *dma_rx; void *dummy_rx; void *dummy_tx; int (*fw_translate_cs)(struct spi_controller *ctlr, unsigned cs); bool ptp_sts_supported; unsigned long irq_flags; bool queue_empty; bool must_async; bool defer_optimize_message; };}hj sbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubh)}(h **Members**h]ju)}(hj1h]hMembers}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj/ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh](j)}(h(``dev`` device interface to this driver h](j)}(h``dev``h]h)}(hjPh]hdev}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjJubj)}(hhh]h)}(hdevice interface to this driverh]hdevice interface to this driver}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehMhjfubah}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1jhjehMhjGubj)}(h2``list`` link with the global spi_controller list h](j)}(h``list``h]h)}(hjh]hlist}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h(link with the global spi_controller listh]h(link with the global spi_controller list}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h[``bus_num`` board-specific (and often SOC-specific) identifier for a given SPI controller. h](j)}(h ``bus_num``h]h)}(hjh]hbus_num}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hNboard-specific (and often SOC-specific) identifier for a given SPI controller.h]hNboard-specific (and often SOC-specific) identifier for a given SPI controller.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``num_chipselect`` chipselects are used to distinguish individual SPI targets, and are numbered from zero to num_chipselects. each target has a chipselect signal, but it's common that not every chipselect is connected to a target. h](j)}(h``num_chipselect``h]h)}(hjh]hnum_chipselect}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hchipselects are used to distinguish individual SPI targets, and are numbered from zero to num_chipselects. each target has a chipselect signal, but it's common that not every chipselect is connected to a target.h]hchipselects are used to distinguish individual SPI targets, and are numbered from zero to num_chipselects. each target has a chipselect signal, but it’s common that not every chipselect is connected to a target.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hF``dma_alignment`` SPI controller constraint on DMA buffers alignment. h](j)}(h``dma_alignment``h]h)}(hj6h]h dma_alignment}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj0ubj)}(hhh]h)}(h3SPI controller constraint on DMA buffers alignment.h]h3SPI controller constraint on DMA buffers alignment.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhMhjLubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1jhjKhMhjGubj)}(h9``mode_bits`` flags understood by this controller driver h](j)}(h ``mode_bits``h]h)}(hjoh]h mode_bits}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjmubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjiubj)}(hhh]h)}(h*flags understood by this controller driverh]h*flags understood by this controller driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hH``buswidth_override_bits`` flags to override for this controller driver h](j)}(h``buswidth_override_bits``h]h)}(hjh]hbuswidth_override_bits}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h,flags to override for this controller driverh]h,flags to override for this controller driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hXV``bits_per_word_mask`` A mask indicating which values of bits_per_word are supported by the driver. Bit n indicates that a bits_per_word n+1 is supported. If set, the SPI core will reject any transfer with an unsupported bits_per_word. If not set, this value is simply ignored, and it's up to the individual driver to perform any validation. h](j)}(h``bits_per_word_mask``h]h)}(hjh]hbits_per_word_mask}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hX>A mask indicating which values of bits_per_word are supported by the driver. Bit n indicates that a bits_per_word n+1 is supported. If set, the SPI core will reject any transfer with an unsupported bits_per_word. If not set, this value is simply ignored, and it's up to the individual driver to perform any validation.h]hX@A mask indicating which values of bits_per_word are supported by the driver. Bit n indicates that a bits_per_word n+1 is supported. If set, the SPI core will reject any transfer with an unsupported bits_per_word. If not set, this value is simply ignored, and it’s up to the individual driver to perform any validation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h1``min_speed_hz`` Lowest supported transfer speed h](j)}(h``min_speed_hz``h]h)}(hjh]h min_speed_hz}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hLowest supported transfer speedh]hLowest supported transfer speed}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj0hMhj1ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj0hMhjGubj)}(h2``max_speed_hz`` Highest supported transfer speed h](j)}(h``max_speed_hz``h]h)}(hjTh]h max_speed_hz}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjNubj)}(hhh]h)}(h Highest supported transfer speedh]h Highest supported transfer speed}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihMhjjubah}(h]h ]h"]h$]h&]uh1jhjNubeh}(h]h ]h"]h$]h&]uh1jhjihMhjGubj)}(h4``flags`` other constraints relevant to this driver h](j)}(h ``flags``h]h)}(hjh]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h)other constraints relevant to this driverh]h)other constraints relevant to this driver}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hK``devm_allocated`` whether the allocation of this struct is devres-managed h](j)}(h``devm_allocated``h]h)}(hjh]hdevm_allocated}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h7whether the allocation of this struct is devres-managedh]h7whether the allocation of this struct is devres-managed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``{unnamed_union}`` anonymous h](j)}(h``{unnamed_union}``h]h)}(hjh]h{unnamed_union}}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhKhjubj)}(hhh]h)}(h anonymoush]h anonymous}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjGubj)}(h9``slave`` indicates that this is an SPI slave controller h](j)}(h ``slave``h]h)}(hj8h]hslave}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj2ubj)}(hhh]h)}(h.indicates that this is an SPI slave controllerh]h.indicates that this is an SPI slave controller}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhMhjNubah}(h]h ]h"]h$]h&]uh1jhj2ubeh}(h]h ]h"]h$]h&]uh1jhjMhMhjGubj)}(h;``target`` indicates that this is an SPI target controller h](j)}(h ``target``h]h)}(hjqh]htarget}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjoubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjkubj)}(hhh]h)}(h/indicates that this is an SPI target controllerh]h/indicates that this is an SPI target controller}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``max_transfer_size`` function that returns the max transfer size for a :c:type:`spi_device`; may be ``NULL``, so the default ``SIZE_MAX`` will be used. h](j)}(h``max_transfer_size``h]h)}(hjh]hmax_transfer_size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hfunction that returns the max transfer size for a :c:type:`spi_device`; may be ``NULL``, so the default ``SIZE_MAX`` will be used.h](h2function that returns the max transfer size for a }(hjhhhNhNubh)}(h:c:type:`spi_device`h]h)}(hjh]h spi_device}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnj}j)}j]sbj spi_deviceuh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubh ; may be }(hjhhhNhNubh)}(h``NULL``h]hNULL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, so the default }(hjhhhNhNubh)}(h ``SIZE_MAX``h]hSIZE_MAX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh will be used.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``max_message_size`` function that returns the max message size for a :c:type:`spi_device`; may be ``NULL``, so the default ``SIZE_MAX`` will be used. h](j)}(h``max_message_size``h]h)}(hj.h]hmax_message_size}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj,ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj(ubj)}(hhh]h)}(hfunction that returns the max message size for a :c:type:`spi_device`; may be ``NULL``, so the default ``SIZE_MAX`` will be used.h](h1function that returns the max message size for a }(hjGhhhNhNubh)}(h:c:type:`spi_device`h]h)}(hjQh]h spi_device}(hjShhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjOubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnj}jj spi_deviceuh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjGubh ; may be }(hjGhhhNhNubh)}(h``NULL``h]hNULL}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh, so the default }(hjGhhhNhNubh)}(h ``SIZE_MAX``h]hSIZE_MAX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh will be used.}(hjGhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjnhMhjDubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhjChMhjGubj)}(h+``io_mutex`` mutex for physical bus access h](j)}(h ``io_mutex``h]h)}(hjh]hio_mutex}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hmutex for physical bus accessh]hmutex for physical bus access}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hB``add_lock`` mutex to avoid adding devices to the same chipselect h](j)}(h ``add_lock``h]h)}(hjh]hadd_lock}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h4mutex to avoid adding devices to the same chipselecth]h4mutex to avoid adding devices to the same chipselect}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h3``bus_lock_spinlock`` spinlock for SPI bus locking h](j)}(h``bus_lock_spinlock``h]h)}(hj!h]hbus_lock_spinlock}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hspinlock for SPI bus lockingh]hspinlock for SPI bus locking}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6hMhj7ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj6hMhjGubj)}(h;``bus_lock_mutex`` mutex for exclusion of multiple callers h](j)}(h``bus_lock_mutex``h]h)}(hjZh]hbus_lock_mutex}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjTubj)}(hhh]h)}(h'mutex for exclusion of multiple callersh]h'mutex for exclusion of multiple callers}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjohMhjpubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1jhjohMhjGubj)}(hI``bus_lock_flag`` indicates that the SPI bus is locked for exclusive use h](j)}(h``bus_lock_flag``h]h)}(hjh]h bus_lock_flag}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h6indicates that the SPI bus is locked for exclusive useh]h6indicates that the SPI bus is locked for exclusive use}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hX(``setup`` updates the device mode and clocking records used by a device's SPI controller; protocol code may call this. This must fail if an unrecognized or unsupported mode is requested. It's always safe to call this unless transfers are pending on the device whose settings are being modified. h](j)}(h ``setup``h]h)}(hjh]hsetup}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hXupdates the device mode and clocking records used by a device's SPI controller; protocol code may call this. This must fail if an unrecognized or unsupported mode is requested. It's always safe to call this unless transfers are pending on the device whose settings are being modified.h]hX!updates the device mode and clocking records used by a device’s SPI controller; protocol code may call this. This must fail if an unrecognized or unsupported mode is requested. It’s always safe to call this unless transfers are pending on the device whose settings are being modified.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``set_cs_timing`` optional hook for SPI devices to request SPI controller for configuring specific CS setup time, hold time and inactive delay in terms of clock counts h](j)}(h``set_cs_timing``h]h)}(hjh]h set_cs_timing}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hoptional hook for SPI devices to request SPI controller for configuring specific CS setup time, hold time and inactive delay in terms of clock countsh]hoptional hook for SPI devices to request SPI controller for configuring specific CS setup time, hold time and inactive delay in terms of clock counts}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h@``transfer`` adds a message to the controller's transfer queue. h](j)}(h ``transfer``h]h)}(hj@h]htransfer}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj:ubj)}(hhh]h)}(h2adds a message to the controller's transfer queue.h]h4adds a message to the controller’s transfer queue.}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUhMhjVubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhjUhMhjGubj)}(h,``cleanup`` frees controller-specific state h](j)}(h ``cleanup``h]h)}(hjyh]hcleanup}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjwubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjsubj)}(hhh]h)}(hfrees controller-specific stateh]hfrees controller-specific state}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjsubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h;``can_dma`` determine whether this controller supports DMA h](j)}(h ``can_dma``h]h)}(hjh]hcan_dma}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h.determine whether this controller supports DMAh]h.determine whether this controller supports DMA}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h9``dma_map_dev`` device which can be used for DMA mapping h](j)}(h``dma_map_dev``h]h)}(hjh]h dma_map_dev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h(device which can be used for DMA mappingh]h(device which can be used for DMA mapping}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hE``cur_rx_dma_dev`` device which is currently used for RX DMA mapping h](j)}(h``cur_rx_dma_dev``h]h)}(hj$h]hcur_rx_dma_dev}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h1device which is currently used for RX DMA mappingh]h1device which is currently used for RX DMA mapping}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hMhj:ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj9hMhjGubj)}(hE``cur_tx_dma_dev`` device which is currently used for TX DMA mapping h](j)}(h``cur_tx_dma_dev``h]h)}(hj]h]hcur_tx_dma_dev}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj[ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjWubj)}(hhh]h)}(h1device which is currently used for TX DMA mappingh]h1device which is currently used for TX DMA mapping}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrhMhjsubah}(h]h ]h"]h$]h&]uh1jhjWubeh}(h]h ]h"]h$]h&]uh1jhjrhMhjGubj)}(hJ``queued`` whether this controller is providing an internal message queue h](j)}(h ``queued``h]h)}(hjh]hqueued}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h>whether this controller is providing an internal message queueh]h>whether this controller is providing an internal message queue}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h6``kworker`` pointer to thread struct for message pump h](j)}(h ``kworker``h]h)}(hjh]hkworker}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h)pointer to thread struct for message pumph]h)pointer to thread struct for message pump}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hF``pump_messages`` work struct for scheduling work to the message pump h](j)}(h``pump_messages``h]h)}(hjh]h pump_messages}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h3work struct for scheduling work to the message pumph]h3work struct for scheduling work to the message pump}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h?``queue_lock`` spinlock to synchronise access to message queue h](j)}(h``queue_lock``h]h)}(hjAh]h queue_lock}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhj?ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj;ubj)}(hhh]h)}(h/spinlock to synchronise access to message queueh]h/spinlock to synchronise access to message queue}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjVhMhjWubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhjVhMhjGubj)}(h``queue`` message queue h](j)}(h ``queue``h]h)}(hjzh]hqueue}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjtubj)}(hhh]h)}(h message queueh]h message queue}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjtubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h,``cur_msg`` the currently in-flight message h](j)}(h ``cur_msg``h]h)}(hjh]hcur_msg}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hthe currently in-flight messageh]hthe currently in-flight message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hF``cur_msg_completion`` a completion for the current in-flight message h](j)}(h``cur_msg_completion``h]h)}(hjh]hcur_msg_completion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h.a completion for the current in-flight messageh]h.a completion for the current in-flight message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``cur_msg_incomplete`` Flag used internally to opportunistically skip the **cur_msg_completion**. This flag is used to check if the driver has already called spi_finalize_current_message(). h](j)}(h``cur_msg_incomplete``h]h)}(hj%h]hcur_msg_incomplete}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hFlag used internally to opportunistically skip the **cur_msg_completion**. This flag is used to check if the driver has already called spi_finalize_current_message().h](h3Flag used internally to opportunistically skip the }(hj>hhhNhNubju)}(h**cur_msg_completion**h]hcur_msg_completion}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj>ubh]. This flag is used to check if the driver has already called spi_finalize_current_message().}(hj>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj;ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj:hMhjGubj)}(h``cur_msg_need_completion`` Flag used internally to opportunistically skip the **cur_msg_completion**. This flag is used to signal the context that is running spi_finalize_current_message() that it needs to complete() h](j)}(h``cur_msg_need_completion``h]h)}(hjqh]hcur_msg_need_completion}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjoubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjkubj)}(hhh]h)}(hFlag used internally to opportunistically skip the **cur_msg_completion**. This flag is used to signal the context that is running spi_finalize_current_message() that it needs to complete()h](h3Flag used internally to opportunistically skip the }(hjhhhNhNubju)}(h**cur_msg_completion**h]hcur_msg_completion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubht. This flag is used to signal the context that is running spi_finalize_current_message() that it needs to complete()}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``busy`` message pump is busy h](j)}(h``busy``h]h)}(hjh]hbusy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hmessage pump is busyh]hmessage pump is busy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h$``running`` message pump is running h](j)}(h ``running``h]h)}(hjh]hrunning}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hmessage pump is runningh]hmessage pump is running}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj hMhjGubj)}(h;``rt`` whether this queue is set to run as a realtime task h](j)}(h``rt``h]h)}(hj/h]hrt}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj)ubj)}(hhh]h)}(h3whether this queue is set to run as a realtime taskh]h3whether this queue is set to run as a realtime task}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjDhMhjEubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhjDhMhjGubj)}(h``auto_runtime_pm`` the core should ensure a runtime PM reference is held while the hardware is prepared, using the parent device for the spidev h](j)}(h``auto_runtime_pm``h]h)}(hjhh]hauto_runtime_pm}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjfubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjbubj)}(hhh]h)}(h|the core should ensure a runtime PM reference is held while the hardware is prepared, using the parent device for the spidevh]h|the core should ensure a runtime PM reference is held while the hardware is prepared, using the parent device for the spidev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj~ubah}(h]h ]h"]h$]h&]uh1jhjbubeh}(h]h ]h"]h$]h&]uh1jhj}hMhjGubj)}(hZ``fallback`` fallback to PIO if DMA transfer return failure with SPI_TRANS_FAIL_NO_START. h](j)}(h ``fallback``h]h)}(hjh]hfallback}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hLfallback to PIO if DMA transfer return failure with SPI_TRANS_FAIL_NO_START.h]hLfallback to PIO if DMA transfer return failure with SPI_TRANS_FAIL_NO_START.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hP``last_cs_mode_high`` was (mode & SPI_CS_HIGH) true on the last call to set_cs. h](j)}(h``last_cs_mode_high``h]h)}(hjh]hlast_cs_mode_high}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h9was (mode & SPI_CS_HIGH) true on the last call to set_cs.h]h9was (mode & SPI_CS_HIGH) true on the last call to set_cs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjube&h}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hU``last_cs`` the last chip_select that is recorded by set_cs, -1 on non chip selected h](j)}(h ``last_cs``h]h)}(hjh]hlast_cs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hHthe last chip_select that is recorded by set_cs, -1 on non chip selectedh]hHthe last chip_select that is recorded by set_cs, -1 on non chip selected}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj+ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj*hMhjGubj)}(hE``last_cs_index_mask`` bit mask the last chip selects that were used h](j)}(h``last_cs_index_mask``h]h)}(hjOh]hlast_cs_index_mask}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjIubj)}(hhh]h)}(h-bit mask the last chip selects that were usedh]h-bit mask the last chip selects that were used}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjdhMhjeubah}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ]h"]h$]h&]uh1jhjdhMhjGubj)}(h8``xfer_completion`` used by core transfer_one_message() h](j)}(h``xfer_completion``h]h)}(hjh]hxfer_completion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h#used by core transfer_one_message()h]h#used by core transfer_one_message()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hA``max_dma_len`` Maximum length of a DMA transfer for the device. h](j)}(h``max_dma_len``h]h)}(hjh]h max_dma_len}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h0Maximum length of a DMA transfer for the device.h]h0Maximum length of a DMA transfer for the device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h4``optimize_message`` optimize the message for reuse h](j)}(h``optimize_message``h]h)}(hjh]hoptimize_message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hoptimize the message for reuseh]hoptimize the message for reuse}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hG``unoptimize_message`` release resources allocated by optimize_message h](j)}(h``unoptimize_message``h]h)}(hj3h]hunoptimize_message}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj-ubj)}(hhh]h)}(h/release resources allocated by optimize_messageh]h/release resources allocated by optimize_message}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjHhMhjIubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jhjHhMhjGubj)}(h``prepare_transfer_hardware`` a message will soon arrive from the queue so the subsystem requests the driver to prepare the transfer hardware by issuing this call h](j)}(h``prepare_transfer_hardware``h]h)}(hjlh]hprepare_transfer_hardware}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjfubj)}(hhh]h)}(ha message will soon arrive from the queue so the subsystem requests the driver to prepare the transfer hardware by issuing this callh]ha message will soon arrive from the queue so the subsystem requests the driver to prepare the transfer hardware by issuing this call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjfubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(hX``transfer_one_message`` the subsystem calls the driver to transfer a single message while queuing transfers that arrive in the meantime. When the driver is finished with this message, it must call spi_finalize_current_message() so the subsystem can issue the next message h](j)}(h``transfer_one_message``h]h)}(hjh]htransfer_one_message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hthe subsystem calls the driver to transfer a single message while queuing transfers that arrive in the meantime. When the driver is finished with this message, it must call spi_finalize_current_message() so the subsystem can issue the next messageh]hthe subsystem calls the driver to transfer a single message while queuing transfers that arrive in the meantime. When the driver is finished with this message, it must call spi_finalize_current_message() so the subsystem can issue the next message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``unprepare_transfer_hardware`` there are currently no more messages on the queue so the subsystem notifies the driver that it may relax the hardware by issuing this call h](j)}(h``unprepare_transfer_hardware``h]h)}(hjh]hunprepare_transfer_hardware}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hthere are currently no more messages on the queue so the subsystem notifies the driver that it may relax the hardware by issuing this callh]hthere are currently no more messages on the queue so the subsystem notifies the driver that it may relax the hardware by issuing this call}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h``prepare_message`` set up the controller to transfer a single message, for example doing DMA mapping. Called from threaded context. h](j)}(h``prepare_message``h]h)}(hjh]hprepare_message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hqset up the controller to transfer a single message, for example doing DMA mapping. Called from threaded context.h]hqset up the controller to transfer a single message, for example doing DMA mapping. Called from threaded context.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj0ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj/hMhjGubj)}(h?``unprepare_message`` undo any work done by prepare_message(). h](j)}(h``unprepare_message``h]h)}(hjTh]hunprepare_message}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjNubj)}(hhh]h)}(h(undo any work done by prepare_message().h]h(undo any work done by prepare_message().}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihMhjjubah}(h]h ]h"]h$]h&]uh1jhjNubeh}(h]h ]h"]h$]h&]uh1jhjihMhjGubj)}(hP``target_abort`` abort the ongoing transfer request on an SPI target controller h](j)}(h``target_abort``h]h)}(hjh]h target_abort}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(h>abort the ongoing transfer request on an SPI target controllerh]h>abort the ongoing transfer request on an SPI target controller}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h_``set_cs`` set the logic level of the chip select line. May be called from interrupt context. h](j)}(h ``set_cs``h]h)}(hjh]hset_cs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(hSset the logic level of the chip select line. May be called from interrupt context.h]hSset the logic level of the chip select line. May be called from interrupt context.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjGubj)}(h1``transfer_one`` transfer a single spi_transfer. h](j)}(h``transfer_one``h]h)}(hj h]h transfer_one}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjubj)}(hhh]h)}(htransfer a single spi_transfer.h]htransfer a single spi_transfer.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj hMhjGubj)}(h``handle_err`` the subsystem calls the driver to handle an error that occurs in the generic implementation of transfer_one_message(). h](j)}(h``handle_err``h]h)}(hj9 h]h handle_err}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7 ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj3 ubj)}(hhh]h)}(hvthe subsystem calls the driver to handle an error that occurs in the generic implementation of transfer_one_message().h]hvthe subsystem calls the driver to handle an error that occurs in the generic implementation of transfer_one_message().}(hjR hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjO ubah}(h]h ]h"]h$]h&]uh1jhj3 ubeh}(h]h ]h"]h$]h&]uh1jhjN hMhjGubj)}(h``mem_ops`` optimized/dedicated operations for interactions with SPI memory. This field is optional and should only be implemented if the controller has native support for memory like operations. h](j)}(h ``mem_ops``h]h)}(hjs h]hmem_ops}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjq ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjm ubj)}(hhh]h)}(hoptimized/dedicated operations for interactions with SPI memory. This field is optional and should only be implemented if the controller has native support for memory like operations.h]hoptimized/dedicated operations for interactions with SPI memory. This field is optional and should only be implemented if the controller has native support for memory like operations.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj ubah}(h]h ]h"]h$]h&]uh1jhjm ubeh}(h]h ]h"]h$]h&]uh1jhj hMhjGubj)}(hL``mem_caps`` controller capabilities for the handling of memory operations. h](j)}(h ``mem_caps``h]h)}(hj h]hmem_caps}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj ubj)}(hhh]h)}(h>controller capabilities for the handling of memory operations.h]h>controller capabilities for the handling of memory operations.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hMhjGubj)}(h``dtr_caps`` true if controller has dtr(single/dual transfer rate) capability. QSPI based controller should fill this based on controller's capability. h](j)}(h ``dtr_caps``h]h)}(hj h]hdtr_caps}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj ubj)}(hhh]h)}(htrue if controller has dtr(single/dual transfer rate) capability. QSPI based controller should fill this based on controller's capability.h]htrue if controller has dtr(single/dual transfer rate) capability. QSPI based controller should fill this based on controller’s capability.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj hMhjGubj)}(h``get_offload`` callback for controllers with offload support to get matching offload instance. Implementations should return -ENODEV if no match is found. h](j)}(h``get_offload``h]h)}(hj !h]h get_offload}(hj"!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj!ubj)}(hhh]h)}(hcallback for controllers with offload support to get matching offload instance. Implementations should return -ENODEV if no match is found.h]hcallback for controllers with offload support to get matching offload instance. Implementations should return -ENODEV if no match is found.}(hj9!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj6!ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhj5!hMhjGubj)}(hJ``put_offload`` release the offload instance acquired by **get_offload**. h](j)}(h``put_offload``h]h)}(hjZ!h]h put_offload}(hj\!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjX!ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjT!ubj)}(hhh]h)}(h9release the offload instance acquired by **get_offload**.h](h)release the offload instance acquired by }(hjs!hhhNhNubju)}(h**get_offload**h]h get_offload}(hj{!hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjs!ubh.}(hjs!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjo!hMhjp!ubah}(h]h ]h"]h$]h&]uh1jhjT!ubeh}(h]h ]h"]h$]h&]uh1jhjo!hMhjGubj)}(h``cs_gpiods`` Array of GPIO descriptors to use as chip select lines; one per CS number. Any individual value may be NULL for CS lines that are not GPIOs (driven by the SPI controller itself). h](j)}(h ``cs_gpiods``h]h)}(hj!h]h cs_gpiods}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj!ubj)}(hhh]h)}(hArray of GPIO descriptors to use as chip select lines; one per CS number. Any individual value may be NULL for CS lines that are not GPIOs (driven by the SPI controller itself).h]hArray of GPIO descriptors to use as chip select lines; one per CS number. Any individual value may be NULL for CS lines that are not GPIOs (driven by the SPI controller itself).}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj!ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhj!hMhjGubj)}(h``use_gpio_descriptors`` Turns on the code in the SPI core to parse and grab GPIO descriptors. This will fill in **cs_gpiods** and SPI devices will have the cs_gpiod assigned if a GPIO line is found for the chipselect. h](j)}(h``use_gpio_descriptors``h]h)}(hj!h]huse_gpio_descriptors}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj!ubj)}(hhh]h)}(hTurns on the code in the SPI core to parse and grab GPIO descriptors. This will fill in **cs_gpiods** and SPI devices will have the cs_gpiod assigned if a GPIO line is found for the chipselect.h](hXTurns on the code in the SPI core to parse and grab GPIO descriptors. This will fill in }(hj!hhhNhNubju)}(h **cs_gpiods**h]h cs_gpiods}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj!ubh\ and SPI devices will have the cs_gpiod assigned if a GPIO line is found for the chipselect.}(hj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj!ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhj!hMhjGubj)}(h``unused_native_cs`` When cs_gpiods is used, spi_register_controller() will fill in this field with the first unused native CS, to be used by SPI controller drivers that need to drive a native CS when using GPIO CS. h](j)}(h``unused_native_cs``h]h)}(hj+"h]hunused_native_cs}(hj-"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)"ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM hj%"ubj)}(hhh]h)}(hWhen cs_gpiods is used, spi_register_controller() will fill in this field with the first unused native CS, to be used by SPI controller drivers that need to drive a native CS when using GPIO CS.h]hWhen cs_gpiods is used, spi_register_controller() will fill in this field with the first unused native CS, to be used by SPI controller drivers that need to drive a native CS when using GPIO CS.}(hjD"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM hjA"ubah}(h]h ]h"]h$]h&]uh1jhj%"ubeh}(h]h ]h"]h$]h&]uh1jhj@"hM hjGubj)}(h``max_native_cs`` When cs_gpiods is used, and this field is filled in, spi_register_controller() will validate all native CS (including the unused native CS) against this value. h](j)}(h``max_native_cs``h]h)}(hje"h]h max_native_cs}(hjg"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjc"ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj_"ubj)}(hhh]h)}(hWhen cs_gpiods is used, and this field is filled in, spi_register_controller() will validate all native CS (including the unused native CS) against this value.h]hWhen cs_gpiods is used, and this field is filled in, spi_register_controller() will validate all native CS (including the unused native CS) against this value.}(hj~"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM hj{"ubah}(h]h ]h"]h$]h&]uh1jhj_"ubeh}(h]h ]h"]h$]h&]uh1jhjz"hMhjGubj)}(h6``pcpu_statistics`` statistics for the spi_controller h](j)}(h``pcpu_statistics``h]h)}(hj"h]hpcpu_statistics}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj"ubj)}(hhh]h)}(h!statistics for the spi_controllerh]h!statistics for the spi_controller}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hMhj"ubah}(h]h ]h"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]uh1jhj"hMhjGubj)}(h ``dma_tx`` DMA transmit channel h](j)}(h ``dma_tx``h]h)}(hj"h]hdma_tx}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj"ubj)}(hhh]h)}(hDMA transmit channelh]hDMA transmit channel}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hMhj"ubah}(h]h ]h"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]uh1jhj"hMhjGubj)}(h``dma_rx`` DMA receive channel h](j)}(h ``dma_rx``h]h)}(hj#h]hdma_rx}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj #ubj)}(hhh]h)}(hDMA receive channelh]hDMA receive channel}(hj*#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&#hMhj'#ubah}(h]h ]h"]h$]h&]uh1jhj #ubeh}(h]h ]h"]h$]h&]uh1jhj&#hMhjGubj)}(h:``dummy_rx`` dummy receive buffer for full-duplex devices h](j)}(h ``dummy_rx``h]h)}(hjJ#h]hdummy_rx}(hjL#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjH#ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjD#ubj)}(hhh]h)}(h,dummy receive buffer for full-duplex devicesh]h,dummy receive buffer for full-duplex devices}(hjc#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_#hMhj`#ubah}(h]h ]h"]h$]h&]uh1jhjD#ubeh}(h]h ]h"]h$]h&]uh1jhj_#hMhjGubj)}(h;``dummy_tx`` dummy transmit buffer for full-duplex devices h](j)}(h ``dummy_tx``h]h)}(hj#h]hdummy_tx}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj}#ubj)}(hhh]h)}(h-dummy transmit buffer for full-duplex devicesh]h-dummy transmit buffer for full-duplex devices}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hMhj#ubah}(h]h ]h"]h$]h&]uh1jhj}#ubeh}(h]h ]h"]h$]h&]uh1jhj#hMhjGubj)}(h``fw_translate_cs`` If the boot firmware uses different numbering scheme what Linux expects, this optional hook can be used to translate between the two. h](j)}(h``fw_translate_cs``h]h)}(hj#h]hfw_translate_cs}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj#ubj)}(hhh]h)}(hIf the boot firmware uses different numbering scheme what Linux expects, this optional hook can be used to translate between the two.h]hIf the boot firmware uses different numbering scheme what Linux expects, this optional hook can be used to translate between the two.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj#ubah}(h]h ]h"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]uh1jhj#hMhjGubj)}(hXp``ptp_sts_supported`` If the driver sets this to true, it must provide a time snapshot in **spi_transfer->ptp_sts** as close as possible to the moment in time when **spi_transfer->ptp_sts_word_pre** and **spi_transfer->ptp_sts_word_post** were transmitted. If the driver does not set this, the SPI core takes the snapshot as close to the driver hand-over as possible. h](j)}(h``ptp_sts_supported``h]h)}(hj#h]hptp_sts_supported}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj#ubj)}(hhh]h)}(hXYIf the driver sets this to true, it must provide a time snapshot in **spi_transfer->ptp_sts** as close as possible to the moment in time when **spi_transfer->ptp_sts_word_pre** and **spi_transfer->ptp_sts_word_post** were transmitted. If the driver does not set this, the SPI core takes the snapshot as close to the driver hand-over as possible.h](hDIf the driver sets this to true, it must provide a time snapshot in }(hj$hhhNhNubju)}(h**spi_transfer->ptp_sts**h]hspi_transfer->ptp_sts}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj$ubh1 as close as possible to the moment in time when }(hj$hhhNhNubju)}(h"**spi_transfer->ptp_sts_word_pre**h]hspi_transfer->ptp_sts_word_pre}(hj)$hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj$ubh and }(hj$hhhNhNubju)}(h#**spi_transfer->ptp_sts_word_post**h]hspi_transfer->ptp_sts_word_post}(hj;$hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj$ubh were transmitted. If the driver does not set this, the SPI core takes the snapshot as close to the driver hand-over as possible.}(hj$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj $ubah}(h]h ]h"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]uh1jhj $hMhjGubj)}(hD``irq_flags`` Interrupt enable state during PTP system timestamping h](j)}(h ``irq_flags``h]h)}(hjf$h]h irq_flags}(hjh$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjd$ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj`$ubj)}(hhh]h)}(h5Interrupt enable state during PTP system timestampingh]h5Interrupt enable state during PTP system timestamping}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj{$hMhj|$ubah}(h]h ]h"]h$]h&]uh1jhj`$ubeh}(h]h ]h"]h$]h&]uh1jhj{$hMhjGubj)}(hd``queue_empty`` signal green light for opportunistically skipping the queue for spi_sync transfers. h](j)}(h``queue_empty``h]h)}(hj$h]h queue_empty}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj$ubj)}(hhh]h)}(hSsignal green light for opportunistically skipping the queue for spi_sync transfers.h]hSsignal green light for opportunistically skipping the queue for spi_sync transfers.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj$ubah}(h]h ]h"]h$]h&]uh1jhj$ubeh}(h]h ]h"]h$]h&]uh1jhj$hMhjGubj)}(h2``must_async`` disable all fast paths in the core h](j)}(h``must_async``h]h)}(hj$h]h must_async}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM hj$ubj)}(hhh]h)}(h"disable all fast paths in the coreh]h"disable all fast paths in the core}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$hM hj$ubah}(h]h ]h"]h$]h&]uh1jhj$ubeh}(h]h ]h"]h$]h&]uh1jhj$hM hjGubj)}(h``defer_optimize_message`` set to true if controller cannot pre-optimize messages and needs to defer the optimization step until the message is actually being transferredh](j)}(h``defer_optimize_message``h]h)}(hj%h]hdefer_optimize_message}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj%ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM"hj %ubj)}(hhh]h)}(hset to true if controller cannot pre-optimize messages and needs to defer the optimization step until the message is actually being transferredh]hset to true if controller cannot pre-optimize messages and needs to defer the optimization step until the message is actually being transferred}(hj+%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM!hj(%ubah}(h]h ]h"]h$]h&]uh1jhj %ubeh}(h]h ]h"]h$]h&]uh1jhj'%hM"hjGubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubh)}(h**Description**h]ju)}(hjU%h]h Description}(hjW%hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjS%ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM&hhhhubj)}(hX- return 0 if the transfer is finished, - return 1 if the transfer is still in progress. When the driver is finished with this transfer it must call spi_finalize_current_transfer() so the subsystem can issue the next transfer. If the transfer fails, the driver must set the flag SPI_TRANS_FAIL_IO to spi_transfer->error first, before calling spi_finalize_current_transfer(). h]h bullet_list)}(hhh](h list_item)}(h%return 0 if the transfer is finished,h]h)}(hjx%h]h%return 0 if the transfer is finished,}(hjz%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjv%ubah}(h]h ]h"]h$]h&]uh1jt%hjq%ubju%)}(hXMreturn 1 if the transfer is still in progress. When the driver is finished with this transfer it must call spi_finalize_current_transfer() so the subsystem can issue the next transfer. If the transfer fails, the driver must set the flag SPI_TRANS_FAIL_IO to spi_transfer->error first, before calling spi_finalize_current_transfer(). h]h)}(hXLreturn 1 if the transfer is still in progress. When the driver is finished with this transfer it must call spi_finalize_current_transfer() so the subsystem can issue the next transfer. If the transfer fails, the driver must set the flag SPI_TRANS_FAIL_IO to spi_transfer->error first, before calling spi_finalize_current_transfer().h]hXLreturn 1 if the transfer is still in progress. When the driver is finished with this transfer it must call spi_finalize_current_transfer() so the subsystem can issue the next transfer. If the transfer fails, the driver must set the flag SPI_TRANS_FAIL_IO to spi_transfer->error first, before calling spi_finalize_current_transfer().}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj%ubah}(h]h ]h"]h$]h&]uh1jt%hjq%ubeh}(h]h ]h"]h$]h&]bullet-uh1jo%hj%hMhjk%ubah}(h]h ]h"]h$]h&]uh1jhj%hMhhhhubh)}(hX(Each SPI controller can communicate with one or more **spi_device** children. These make a small bus, sharing MOSI, MISO and SCK signals but not chip select signals. Each device may be configured to use a different clock rate, since those shared signals are ignored unless the chip is selected.h](h5Each SPI controller can communicate with one or more }(hj%hhhNhNubju)}(h**spi_device**h]h spi_device}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj%ubh children. These make a small bus, sharing MOSI, MISO and SCK signals but not chip select signals. Each device may be configured to use a different clock rate, since those shared signals are ignored unless the chip is selected.}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hXThe driver for an SPI controller manages access to those devices through a queue of spi_message transactions, copying data between CPU memory and an SPI target device. For each such message it queues, it calls the message's completion function when the transaction completes.h]hXThe driver for an SPI controller manages access to those devices through a queue of spi_message transactions, copying data between CPU memory and an SPI target device. For each such message it queues, it calls the message’s completion function when the transaction completes.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(h**Note**h]ju)}(hj%h]hNote}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj%ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubj)}(hhh]j)}(htransfer_one and transfer_one_message are mutually exclusive; when both are set, the generic subsystem does not call your transfer_one callback. h](j)}(h2transfer_one and transfer_one_message are mutuallyh]h2transfer_one and transfer_one_message are mutually}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj&ubj)}(hhh]h)}(h]exclusive; when both are set, the generic subsystem does not call your transfer_one callback.h]h]exclusive; when both are set, the generic subsystem does not call your transfer_one callback.}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj&ubah}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]uh1jhj&hMhj%ubah}(h]h ]h"]h$]h&]uh1jhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_res (C struct) c.spi_reshNtauh1jhhhhhjhNubj)}(hhh](j)}(hspi_resh]j)}(hstruct spi_resh](j)}(hjh]hstruct}(hjP&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjL&hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMubj)}(h h]h }(hj^&hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjL&hhhj]&hMubj)}(hspi_resh]j)}(hjJ&h]hspi_res}(hjp&hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjl&ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjL&hhhj]&hMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjH&hhhj]&hMubah}(h]jC&ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj]&hMhjE&hhubjD)}(hhh]h)}(h!SPI resource management structureh]h!SPI resource management structure}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj&hhubah}(h]h ]h"]h$]h&]uh1jChjE&hhhj]&hMubeh}(h]h ](hstructeh"]h$]h&]jdhjej&jfj&jgjhjiuh1jhhhhhjhNubjk)}(hX7**Definition**:: struct spi_res { struct list_head entry; spi_res_release_t release; unsigned long long data[]; }; **Members** ``entry`` list entry ``release`` release code called prior to freeing this resource ``data`` extra data allocated for the specific use-caseh](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj&ubh:}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj&ubj)}(hystruct spi_res { struct list_head entry; spi_res_release_t release; unsigned long long data[]; };h]hystruct spi_res { struct list_head entry; spi_res_release_t release; unsigned long long data[]; };}hj&sbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj&ubh)}(h **Members**h]ju)}(hj&h]hMembers}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj&ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj&ubj)}(hhh](j)}(h``entry`` list entry h](j)}(h ``entry``h]h)}(hj&h]hentry}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj&ubj)}(hhh]h)}(h list entryh]h list entry}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hMhj'ubah}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]uh1jhj'hMhj&ubj)}(h?``release`` release code called prior to freeing this resource h](j)}(h ``release``h]h)}(hj8'h]hrelease}(hj:'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6'ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj2'ubj)}(hhh]h)}(h2release code called prior to freeing this resourceh]h2release code called prior to freeing this resource}(hjQ'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjM'hMhjN'ubah}(h]h ]h"]h$]h&]uh1jhj2'ubeh}(h]h ]h"]h$]h&]uh1jhjM'hMhj&ubj)}(h7``data`` extra data allocated for the specific use-caseh](j)}(h``data``h]h)}(hjq'h]hdata}(hjs'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjo'ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjk'ubj)}(hhh]h)}(h.extra data allocated for the specific use-caseh]h.extra data allocated for the specific use-case}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj'ubah}(h]h ]h"]h$]h&]uh1jhjk'ubeh}(h]h ]h"]h$]h&]uh1jhj'hMhj&ubeh}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubh)}(h**Description**h]ju)}(hj'h]h Description}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj'ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hgThis is based on ideas from devres, but focused on life-cycle management during spi_message processing.h]hgThis is based on ideas from devres, but focused on life-cycle management during spi_message processing.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_transfer (C struct)c.spi_transferhNtauh1jhhhhhjhNubj)}(hhh](j)}(h spi_transferh]j)}(hstruct spi_transferh](j)}(hjh]hstruct}(hj'hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj'hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMubj)}(h h]h }(hj(hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj'hhhj'hMubj)}(h spi_transferh]j)}(hj'h]h spi_transfer}(hj(hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj(ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhj'hhhj'hMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hj'hhhj'hMubah}(h]j'ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj'hMhj'hhubjD)}(hhh]h)}(ha read/write buffer pairh]ha read/write buffer pair}(hj4(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj1(hhubah}(h]h ]h"]h$]h&]uh1jChj'hhhj'hMubeh}(h]h ](hstructeh"]h$]h&]jdhjejL(jfjL(jgjhjiuh1jhhhhhjhNubjk)}(hX**Definition**:: struct spi_transfer { const void *tx_buf; void *rx_buf; unsigned len; #define SPI_TRANS_FAIL_NO_START BIT(0); #define SPI_TRANS_FAIL_IO BIT(1); u16 error; bool tx_sg_mapped; bool rx_sg_mapped; struct sg_table tx_sg; struct sg_table rx_sg; dma_addr_t tx_dma; dma_addr_t rx_dma; unsigned dummy_data:1; unsigned cs_off:1; unsigned cs_change:1; unsigned tx_nbits:4; unsigned rx_nbits:4; unsigned timestamped:1; bool dtr_mode; #define SPI_NBITS_SINGLE 0x01; #define SPI_NBITS_DUAL 0x02; #define SPI_NBITS_QUAD 0x04; #define SPI_NBITS_OCTAL 0x08; u8 bits_per_word; struct spi_delay delay; struct spi_delay cs_change_delay; struct spi_delay word_delay; u32 speed_hz; u32 effective_speed_hz; unsigned int offload_flags; unsigned int ptp_sts_word_pre; unsigned int ptp_sts_word_post; struct ptp_system_timestamp *ptp_sts; struct list_head transfer_list; }; **Members** ``tx_buf`` data to be written (DMA-safe memory), or NULL ``rx_buf`` data to be read (DMA-safe memory), or NULL ``len`` size of rx and tx buffers (in bytes) ``error`` Error status logged by SPI controller driver. ``tx_sg_mapped`` If true, the **tx_sg** is mapped for DMA ``rx_sg_mapped`` If true, the **rx_sg** is mapped for DMA ``tx_sg`` Scatterlist for transmit, currently not for client use ``rx_sg`` Scatterlist for receive, currently not for client use ``tx_dma`` DMA address of tx_buf, currently not for client use ``rx_dma`` DMA address of rx_buf, currently not for client use ``dummy_data`` indicates transfer is dummy bytes transfer. ``cs_off`` performs the transfer with chipselect off. ``cs_change`` affects chipselect after this transfer completes ``tx_nbits`` number of bits used for writing. If 0 the default (SPI_NBITS_SINGLE) is used. ``rx_nbits`` number of bits used for reading. If 0 the default (SPI_NBITS_SINGLE) is used. ``timestamped`` true if the transfer has been timestamped ``dtr_mode`` true if supports double transfer rate. ``bits_per_word`` select a bits_per_word other than the device default for this transfer. If 0 the default (from **spi_device**) is used. ``delay`` delay to be introduced after this transfer before (optionally) changing the chipselect status, then starting the next transfer or completing this **spi_message**. ``cs_change_delay`` delay between cs deassert and assert when **cs_change** is set and **spi_transfer** is not the last in **spi_message** ``word_delay`` inter word delay to be introduced after each word size (set by bits_per_word) transmission. ``speed_hz`` Select a speed other than the device default for this transfer. If 0 the default (from **spi_device**) is used. ``effective_speed_hz`` the effective SCK-speed that was used to transfer this transfer. Set to 0 if the SPI bus driver does not support it. ``offload_flags`` Flags that are only applicable to specialized SPI offload transfers. See ``SPI_OFFLOAD_XFER_*`` in spi-offload.h. ``ptp_sts_word_pre`` The word (subject to bits_per_word semantics) offset within **tx_buf** for which the SPI device is requesting that the time snapshot for this transfer begins. Upon completing the SPI transfer, this value may have changed compared to what was requested, depending on the available snapshotting resolution (DMA transfer, **ptp_sts_supported** is false, etc). ``ptp_sts_word_post`` See **ptp_sts_word_post**. The two can be equal (meaning that a single byte should be snapshotted). If the core takes care of the timestamp (if **ptp_sts_supported** is false for this controller), it will set **ptp_sts_word_pre** to 0, and **ptp_sts_word_post** to the length of the transfer. This is done purposefully (instead of setting to spi_transfer->len - 1) to denote that a transfer-level snapshot taken from within the driver may still be of higher quality. ``ptp_sts`` Pointer to a memory location held by the SPI target device where a PTP system timestamp structure may lie. If drivers use PIO or their hardware has some sort of assist for retrieving exact transfer timing, they can (and should) assert **ptp_sts_supported** and populate this structure using the ptp_read_system_*ts helper functions. The timestamp must represent the time at which the SPI target device has processed the word, i.e. the "pre" timestamp should be taken before transmitting the "pre" word, and the "post" timestamp after receiving transmit confirmation from the controller for the "post" word. ``transfer_list`` transfers are sequenced through **spi_message.transfers**h](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hjX(hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjT(ubh:}(hjT(hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjP(ubj)}(hXstruct spi_transfer { const void *tx_buf; void *rx_buf; unsigned len; #define SPI_TRANS_FAIL_NO_START BIT(0); #define SPI_TRANS_FAIL_IO BIT(1); u16 error; bool tx_sg_mapped; bool rx_sg_mapped; struct sg_table tx_sg; struct sg_table rx_sg; dma_addr_t tx_dma; dma_addr_t rx_dma; unsigned dummy_data:1; unsigned cs_off:1; unsigned cs_change:1; unsigned tx_nbits:4; unsigned rx_nbits:4; unsigned timestamped:1; bool dtr_mode; #define SPI_NBITS_SINGLE 0x01; #define SPI_NBITS_DUAL 0x02; #define SPI_NBITS_QUAD 0x04; #define SPI_NBITS_OCTAL 0x08; u8 bits_per_word; struct spi_delay delay; struct spi_delay cs_change_delay; struct spi_delay word_delay; u32 speed_hz; u32 effective_speed_hz; unsigned int offload_flags; unsigned int ptp_sts_word_pre; unsigned int ptp_sts_word_post; struct ptp_system_timestamp *ptp_sts; struct list_head transfer_list; };h]hXstruct spi_transfer { const void *tx_buf; void *rx_buf; unsigned len; #define SPI_TRANS_FAIL_NO_START BIT(0); #define SPI_TRANS_FAIL_IO BIT(1); u16 error; bool tx_sg_mapped; bool rx_sg_mapped; struct sg_table tx_sg; struct sg_table rx_sg; dma_addr_t tx_dma; dma_addr_t rx_dma; unsigned dummy_data:1; unsigned cs_off:1; unsigned cs_change:1; unsigned tx_nbits:4; unsigned rx_nbits:4; unsigned timestamped:1; bool dtr_mode; #define SPI_NBITS_SINGLE 0x01; #define SPI_NBITS_DUAL 0x02; #define SPI_NBITS_QUAD 0x04; #define SPI_NBITS_OCTAL 0x08; u8 bits_per_word; struct spi_delay delay; struct spi_delay cs_change_delay; struct spi_delay word_delay; u32 speed_hz; u32 effective_speed_hz; unsigned int offload_flags; unsigned int ptp_sts_word_pre; unsigned int ptp_sts_word_post; struct ptp_system_timestamp *ptp_sts; struct list_head transfer_list; };}hjq(sbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjP(ubh)}(h **Members**h]ju)}(hj(h]hMembers}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj(ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjP(ubj)}(hhh](j)}(h9``tx_buf`` data to be written (DMA-safe memory), or NULL h](j)}(h ``tx_buf``h]h)}(hj(h]htx_buf}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj(ubj)}(hhh]h)}(h-data to be written (DMA-safe memory), or NULLh]h-data to be written (DMA-safe memory), or NULL}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hMhj(ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhj(hMhj(ubj)}(h6``rx_buf`` data to be read (DMA-safe memory), or NULL h](j)}(h ``rx_buf``h]h)}(hj(h]hrx_buf}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj(ubj)}(hhh]h)}(h*data to be read (DMA-safe memory), or NULLh]h*data to be read (DMA-safe memory), or NULL}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hMhj(ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhj(hMhj(ubj)}(h-``len`` size of rx and tx buffers (in bytes) h](j)}(h``len``h]h)}(hj)h]hlen}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj )ubj)}(hhh]h)}(h$size of rx and tx buffers (in bytes)h]h$size of rx and tx buffers (in bytes)}(hj,)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj()hMhj))ubah}(h]h ]h"]h$]h&]uh1jhj )ubeh}(h]h ]h"]h$]h&]uh1jhj()hMhj(ubj)}(h8``error`` Error status logged by SPI controller driver. h](j)}(h ``error``h]h)}(hjL)h]herror}(hjN)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJ)ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjF)ubj)}(hhh]h)}(h-Error status logged by SPI controller driver.h]h-Error status logged by SPI controller driver.}(hje)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhja)hMhjb)ubah}(h]h ]h"]h$]h&]uh1jhjF)ubeh}(h]h ]h"]h$]h&]uh1jhja)hMhj(ubj)}(h:``tx_sg_mapped`` If true, the **tx_sg** is mapped for DMA h](j)}(h``tx_sg_mapped``h]h)}(hj)h]h tx_sg_mapped}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj)ubj)}(hhh]h)}(h(If true, the **tx_sg** is mapped for DMAh](h If true, the }(hj)hhhNhNubju)}(h **tx_sg**h]htx_sg}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj)ubh is mapped for DMA}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj)hMhj)ubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhj)hMhj(ubj)}(h:``rx_sg_mapped`` If true, the **rx_sg** is mapped for DMA h](j)}(h``rx_sg_mapped``h]h)}(hj)h]h rx_sg_mapped}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj)ubj)}(hhh]h)}(h(If true, the **rx_sg** is mapped for DMAh](h If true, the }(hj)hhhNhNubju)}(h **rx_sg**h]hrx_sg}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj)ubh is mapped for DMA}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj)hMhj)ubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhj)hMhj(ubj)}(hA``tx_sg`` Scatterlist for transmit, currently not for client use h](j)}(h ``tx_sg``h]h)}(hj*h]htx_sg}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj*ubj)}(hhh]h)}(h6Scatterlist for transmit, currently not for client useh]h6Scatterlist for transmit, currently not for client use}(hj4*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj0*hMhj1*ubah}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1jhj0*hMhj(ubj)}(h@``rx_sg`` Scatterlist for receive, currently not for client use h](j)}(h ``rx_sg``h]h)}(hjT*h]hrx_sg}(hjV*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjR*ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjN*ubj)}(hhh]h)}(h5Scatterlist for receive, currently not for client useh]h5Scatterlist for receive, currently not for client use}(hjm*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhji*hMhjj*ubah}(h]h ]h"]h$]h&]uh1jhjN*ubeh}(h]h ]h"]h$]h&]uh1jhji*hMhj(ubj)}(h?``tx_dma`` DMA address of tx_buf, currently not for client use h](j)}(h ``tx_dma``h]h)}(hj*h]htx_dma}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj*ubj)}(hhh]h)}(h3DMA address of tx_buf, currently not for client useh]h3DMA address of tx_buf, currently not for client use}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*hMhj*ubah}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1jhj*hMhj(ubj)}(h?``rx_dma`` DMA address of rx_buf, currently not for client use h](j)}(h ``rx_dma``h]h)}(hj*h]hrx_dma}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj*ubj)}(hhh]h)}(h3DMA address of rx_buf, currently not for client useh]h3DMA address of rx_buf, currently not for client use}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*hMhj*ubah}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1jhj*hMhj(ubj)}(h;``dummy_data`` indicates transfer is dummy bytes transfer. h](j)}(h``dummy_data``h]h)}(hj*h]h dummy_data}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj*ubj)}(hhh]h)}(h+indicates transfer is dummy bytes transfer.h]h+indicates transfer is dummy bytes transfer.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hMhj+ubah}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1jhj+hMhj(ubj)}(h6``cs_off`` performs the transfer with chipselect off. h](j)}(h ``cs_off``h]h)}(hj8+h]hcs_off}(hj:+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6+ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj2+ubj)}(hhh]h)}(h*performs the transfer with chipselect off.h]h*performs the transfer with chipselect off.}(hjQ+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjM+hMhjN+ubah}(h]h ]h"]h$]h&]uh1jhj2+ubeh}(h]h ]h"]h$]h&]uh1jhjM+hMhj(ubj)}(h?``cs_change`` affects chipselect after this transfer completes h](j)}(h ``cs_change``h]h)}(hjq+h]h cs_change}(hjs+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjo+ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjk+ubj)}(hhh]h)}(h0affects chipselect after this transfer completesh]h0affects chipselect after this transfer completes}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hMhj+ubah}(h]h ]h"]h$]h&]uh1jhjk+ubeh}(h]h ]h"]h$]h&]uh1jhj+hMhj(ubj)}(h[``tx_nbits`` number of bits used for writing. If 0 the default (SPI_NBITS_SINGLE) is used. h](j)}(h ``tx_nbits``h]h)}(hj+h]htx_nbits}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj+ubj)}(hhh]h)}(hMnumber of bits used for writing. If 0 the default (SPI_NBITS_SINGLE) is used.h]hMnumber of bits used for writing. If 0 the default (SPI_NBITS_SINGLE) is used.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj+ubah}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]uh1jhj+hMhj(ubj)}(h[``rx_nbits`` number of bits used for reading. If 0 the default (SPI_NBITS_SINGLE) is used. h](j)}(h ``rx_nbits``h]h)}(hj+h]hrx_nbits}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj+ubj)}(hhh]h)}(hMnumber of bits used for reading. If 0 the default (SPI_NBITS_SINGLE) is used.h]hMnumber of bits used for reading. If 0 the default (SPI_NBITS_SINGLE) is used.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj+ubah}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]uh1jhj+hMhj(ubj)}(h:``timestamped`` true if the transfer has been timestamped h](j)}(h``timestamped``h]h)}(hj,h]h timestamped}(hj ,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj,ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj,ubj)}(hhh]h)}(h)true if the transfer has been timestampedh]h)true if the transfer has been timestamped}(hj7,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3,hMhj4,ubah}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhj3,hMhj(ubj)}(h4``dtr_mode`` true if supports double transfer rate. h](j)}(h ``dtr_mode``h]h)}(hjW,h]hdtr_mode}(hjY,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjU,ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjQ,ubj)}(hhh]h)}(h&true if supports double transfer rate.h]h&true if supports double transfer rate.}(hjp,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjl,hMhjm,ubah}(h]h ]h"]h$]h&]uh1jhjQ,ubeh}(h]h ]h"]h$]h&]uh1jhjl,hMhj(ubj)}(h``bits_per_word`` select a bits_per_word other than the device default for this transfer. If 0 the default (from **spi_device**) is used. h](j)}(h``bits_per_word``h]h)}(hj,h]h bits_per_word}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj,ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj,ubj)}(hhh]h)}(hwselect a bits_per_word other than the device default for this transfer. If 0 the default (from **spi_device**) is used.h](h_select a bits_per_word other than the device default for this transfer. If 0 the default (from }(hj,hhhNhNubju)}(h**spi_device**h]h spi_device}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj,ubh ) is used.}(hj,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj,ubah}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhj,hMhj(ubj)}(h``delay`` delay to be introduced after this transfer before (optionally) changing the chipselect status, then starting the next transfer or completing this **spi_message**. h](j)}(h ``delay``h]h)}(hj,h]hdelay}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj,ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj,ubj)}(hhh]h)}(hdelay to be introduced after this transfer before (optionally) changing the chipselect status, then starting the next transfer or completing this **spi_message**.h](hdelay to be introduced after this transfer before (optionally) changing the chipselect status, then starting the next transfer or completing this }(hj,hhhNhNubju)}(h**spi_message**h]h spi_message}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj,ubh.}(hj,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj,ubah}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhj,hMhj(ubj)}(h``cs_change_delay`` delay between cs deassert and assert when **cs_change** is set and **spi_transfer** is not the last in **spi_message** h](j)}(h``cs_change_delay``h]h)}(hj(-h]hcs_change_delay}(hj*-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&-ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj"-ubj)}(hhh]h)}(hvdelay between cs deassert and assert when **cs_change** is set and **spi_transfer** is not the last in **spi_message**h](h*delay between cs deassert and assert when }(hjA-hhhNhNubju)}(h **cs_change**h]h cs_change}(hjI-hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjA-ubh is set and }(hjA-hhhNhNubju)}(h**spi_transfer**h]h spi_transfer}(hj[-hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjA-ubh is not the last in }(hjA-hhhNhNubju)}(h**spi_message**h]h spi_message}(hjm-hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjA-ubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj>-ubah}(h]h ]h"]h$]h&]uh1jhj"-ubeh}(h]h ]h"]h$]h&]uh1jhj=-hMhj(ubj)}(hk``word_delay`` inter word delay to be introduced after each word size (set by bits_per_word) transmission. h](j)}(h``word_delay``h]h)}(hj-h]h word_delay}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj-ubj)}(hhh]h)}(h[inter word delay to be introduced after each word size (set by bits_per_word) transmission.h]h[inter word delay to be introduced after each word size (set by bits_per_word) transmission.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj-ubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jhj-hMhj(ubj)}(h}``speed_hz`` Select a speed other than the device default for this transfer. If 0 the default (from **spi_device**) is used. h](j)}(h ``speed_hz``h]h)}(hj-h]hspeed_hz}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj-ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj-ubj)}(hhh]h)}(hoSelect a speed other than the device default for this transfer. If 0 the default (from **spi_device**) is used.h](hWSelect a speed other than the device default for this transfer. If 0 the default (from }(hj-hhhNhNubju)}(h**spi_device**h]h spi_device}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj-ubh ) is used.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj-ubah}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jhj-hMhj(ubj)}(h``effective_speed_hz`` the effective SCK-speed that was used to transfer this transfer. Set to 0 if the SPI bus driver does not support it. h](j)}(h``effective_speed_hz``h]h)}(hj.h]heffective_speed_hz}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj.ubj)}(hhh]h)}(htthe effective SCK-speed that was used to transfer this transfer. Set to 0 if the SPI bus driver does not support it.h]htthe effective SCK-speed that was used to transfer this transfer. Set to 0 if the SPI bus driver does not support it.}(hj3.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj0.ubah}(h]h ]h"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]uh1jhj/.hMhj(ubj)}(h``offload_flags`` Flags that are only applicable to specialized SPI offload transfers. See ``SPI_OFFLOAD_XFER_*`` in spi-offload.h. h](j)}(h``offload_flags``h]h)}(hjT.h]h offload_flags}(hjV.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjR.ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjN.ubj)}(hhh]h)}(hqFlags that are only applicable to specialized SPI offload transfers. See ``SPI_OFFLOAD_XFER_*`` in spi-offload.h.h](hIFlags that are only applicable to specialized SPI offload transfers. See }(hjm.hhhNhNubh)}(h``SPI_OFFLOAD_XFER_*``h]hSPI_OFFLOAD_XFER_*}(hju.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjm.ubh in spi-offload.h.}(hjm.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjj.ubah}(h]h ]h"]h$]h&]uh1jhjN.ubeh}(h]h ]h"]h$]h&]uh1jhji.hMhj(ubj)}(hXz``ptp_sts_word_pre`` The word (subject to bits_per_word semantics) offset within **tx_buf** for which the SPI device is requesting that the time snapshot for this transfer begins. Upon completing the SPI transfer, this value may have changed compared to what was requested, depending on the available snapshotting resolution (DMA transfer, **ptp_sts_supported** is false, etc). h](j)}(h``ptp_sts_word_pre``h]h)}(hj.h]hptp_sts_word_pre}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj.ubj)}(hhh]h)}(hXdThe word (subject to bits_per_word semantics) offset within **tx_buf** for which the SPI device is requesting that the time snapshot for this transfer begins. Upon completing the SPI transfer, this value may have changed compared to what was requested, depending on the available snapshotting resolution (DMA transfer, **ptp_sts_supported** is false, etc).h](hlen - 1) to denote that a transfer-level snapshot taken from within the driver may still be of higher quality. h](j)}(h``ptp_sts_word_post``h]h)}(hj.h]hptp_sts_word_post}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj.ubj)}(hhh]h)}(hXSee **ptp_sts_word_post**. The two can be equal (meaning that a single byte should be snapshotted). If the core takes care of the timestamp (if **ptp_sts_supported** is false for this controller), it will set **ptp_sts_word_pre** to 0, and **ptp_sts_word_post** to the length of the transfer. This is done purposefully (instead of setting to spi_transfer->len - 1) to denote that a transfer-level snapshot taken from within the driver may still be of higher quality.h](hSee }(hj/hhhNhNubju)}(h**ptp_sts_word_post**h]hptp_sts_word_post}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj/ubhw. The two can be equal (meaning that a single byte should be snapshotted). If the core takes care of the timestamp (if }(hj/hhhNhNubju)}(h**ptp_sts_supported**h]hptp_sts_supported}(hj1/hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj/ubh, is false for this controller), it will set }(hj/hhhNhNubju)}(h**ptp_sts_word_pre**h]hptp_sts_word_pre}(hjC/hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj/ubh to 0, and }(hj/hhhNhNubju)}(h**ptp_sts_word_post**h]hptp_sts_word_post}(hjU/hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj/ubh to the length of the transfer. This is done purposefully (instead of setting to spi_transfer->len - 1) to denote that a transfer-level snapshot taken from within the driver may still be of higher quality.}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj/ubah}(h]h ]h"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]uh1jhj/hMhj(ubj)}(hXk``ptp_sts`` Pointer to a memory location held by the SPI target device where a PTP system timestamp structure may lie. If drivers use PIO or their hardware has some sort of assist for retrieving exact transfer timing, they can (and should) assert **ptp_sts_supported** and populate this structure using the ptp_read_system_*ts helper functions. The timestamp must represent the time at which the SPI target device has processed the word, i.e. the "pre" timestamp should be taken before transmitting the "pre" word, and the "post" timestamp after receiving transmit confirmation from the controller for the "post" word. h](j)}(h ``ptp_sts``h]h)}(hj/h]hptp_sts}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~/ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjz/ubj)}(hhh]h)}(hX^Pointer to a memory location held by the SPI target device where a PTP system timestamp structure may lie. If drivers use PIO or their hardware has some sort of assist for retrieving exact transfer timing, they can (and should) assert **ptp_sts_supported** and populate this structure using the ptp_read_system_*ts helper functions. The timestamp must represent the time at which the SPI target device has processed the word, i.e. the "pre" timestamp should be taken before transmitting the "pre" word, and the "post" timestamp after receiving transmit confirmation from the controller for the "post" word.h](hPointer to a memory location held by the SPI target device where a PTP system timestamp structure may lie. If drivers use PIO or their hardware has some sort of assist for retrieving exact transfer timing, they can (and should) assert }(hj/hhhNhNubju)}(h**ptp_sts_supported**h]hptp_sts_supported}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj/ubhXn and populate this structure using the ptp_read_system_*ts helper functions. The timestamp must represent the time at which the SPI target device has processed the word, i.e. the “pre” timestamp should be taken before transmitting the “pre” word, and the “post” timestamp after receiving transmit confirmation from the controller for the “post” word.}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj/ubah}(h]h ]h"]h$]h&]uh1jhjz/ubeh}(h]h ]h"]h$]h&]uh1jhj/hMhj(ubj)}(hK``transfer_list`` transfers are sequenced through **spi_message.transfers**h](j)}(h``transfer_list``h]h)}(hj/h]h transfer_list}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj/ubj)}(hhh]h)}(h9transfers are sequenced through **spi_message.transfers**h](h transfers are sequenced through }(hj/hhhNhNubju)}(h**spi_message.transfers**h]hspi_message.transfers}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj/ubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1jhj/hMhj(ubeh}(h]h ]h"]h$]h&]uh1jhjP(ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubh)}(h**Description**h]ju)}(hj0h]h Description}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj0ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hX SPI transfers always write the same number of bytes as they read. Protocol drivers should always provide **rx_buf** and/or **tx_buf**. In some cases, they may also want to provide DMA addresses for the data being transferred; that may reduce overhead, when the underlying driver uses DMA.h](hiSPI transfers always write the same number of bytes as they read. Protocol drivers should always provide }(hj30hhhNhNubju)}(h **rx_buf**h]hrx_buf}(hj;0hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj30ubh and/or }(hj30hhhNhNubju)}(h **tx_buf**h]htx_buf}(hjM0hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj30ubh. In some cases, they may also want to provide DMA addresses for the data being transferred; that may reduce overhead, when the underlying driver uses DMA.}(hj30hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hXIf the transmit buffer is NULL, zeroes will be shifted out while filling **rx_buf**. If the receive buffer is NULL, the data shifted in will be discarded. Only "len" bytes shift out (or in). It's an error to try to shift out a partial word. (For example, by shifting out three bytes with word size of sixteen or twenty bits; the former uses two bytes per word, the latter uses four bytes.)h](hIIf the transmit buffer is NULL, zeroes will be shifted out while filling }(hjf0hhhNhNubju)}(h **rx_buf**h]hrx_buf}(hjn0hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjf0ubhX;. If the receive buffer is NULL, the data shifted in will be discarded. Only “len” bytes shift out (or in). It’s an error to try to shift out a partial word. (For example, by shifting out three bytes with word size of sixteen or twenty bits; the former uses two bytes per word, the latter uses four bytes.)}(hjf0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hXIn-memory data values are always in native CPU byte order, translated from the wire byte order (big-endian except with SPI_LSB_FIRST). So for example when bits_per_word is sixteen, buffers are 2N bytes long (**len** = 2N) and hold N sixteen bit words in CPU byte order.h](hIn-memory data values are always in native CPU byte order, translated from the wire byte order (big-endian except with SPI_LSB_FIRST). So for example when bits_per_word is sixteen, buffers are 2N bytes long (}(hj0hhhNhNubju)}(h**len**h]hlen}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj0ubh6 = 2N) and hold N sixteen bit words in CPU byte order.}(hj0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hXWhen the word size of the SPI transfer is not a power-of-two multiple of eight bits, those in-memory words include extra bits. In-memory words are always seen by protocol drivers as right-justified, so the undefined (rx) or unused (tx) bits are always the most significant bits.h]hXWhen the word size of the SPI transfer is not a power-of-two multiple of eight bits, those in-memory words include extra bits. In-memory words are always seen by protocol drivers as right-justified, so the undefined (rx) or unused (tx) bits are always the most significant bits.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hAll SPI transfers start with the relevant chipselect active. Normally it stays selected until after the last transfer in a message. Drivers can affect the chipselect signal using cs_change.h]hAll SPI transfers start with the relevant chipselect active. Normally it stays selected until after the last transfer in a message. Drivers can affect the chipselect signal using cs_change.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM hhhhubh)}(hX.(i) If the transfer isn't the last one in the message, this flag is used to make the chipselect briefly go inactive in the middle of the message. Toggling chipselect in this way may be needed to terminate a chip command, letting a single spi_message perform all of group of chip transactions together.h]hX0(i) If the transfer isn’t the last one in the message, this flag is used to make the chipselect briefly go inactive in the middle of the message. Toggling chipselect in this way may be needed to terminate a chip command, letting a single spi_message perform all of group of chip transactions together.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hXM(ii) When the transfer is the last one in the message, the chip may stay selected until the next transfer. On multi-device SPI busses with nothing blocking messages going to other devices, this is just a performance hint; starting a message to another device deselects this one. But in other cases, this can be used to ensure correctness. Some devices need protocol transactions to be built from a series of spi_message submissions, where the content of one message is determined by the results of previous messages and where the whole transaction ends when the chipselect goes inactive.h]hXM(ii) When the transfer is the last one in the message, the chip may stay selected until the next transfer. On multi-device SPI busses with nothing blocking messages going to other devices, this is just a performance hint; starting a message to another device deselects this one. But in other cases, this can be used to ensure correctness. Some devices need protocol transactions to be built from a series of spi_message submissions, where the content of one message is determined by the results of previous messages and where the whole transaction ends when the chipselect goes inactive.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hX,When SPI can transfer in 1x,2x or 4x. It can get this transfer information from device through **tx_nbits** and **rx_nbits**. In Bi-direction, these two should both be set. User can set transfer mode with SPI_NBITS_SINGLE(1x) SPI_NBITS_DUAL(2x) and SPI_NBITS_QUAD(4x) to support these three transfer.h](h_When SPI can transfer in 1x,2x or 4x. It can get this transfer information from device through }(hj0hhhNhNubju)}(h **tx_nbits**h]htx_nbits}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj0ubh and }(hj0hhhNhNubju)}(h **rx_nbits**h]hrx_nbits}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj0ubh. In Bi-direction, these two should both be set. User can set transfer mode with SPI_NBITS_SINGLE(1x) SPI_NBITS_DUAL(2x) and SPI_NBITS_QUAD(4x) to support these three transfer.}(hj0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM hhhhubh)}(h|User may also set dtr_mode to true to use dual transfer mode if desired. if not, default considered as single transfer mode.h]h|User may also set dtr_mode to true to use dual transfer mode if desired. if not, default considered as single transfer mode.}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM%hhhhubh)}(hX3The code that submits an spi_message (and its spi_transfers) to the lower layers is responsible for managing its memory. Zero-initialize every field you don't set up explicitly, to insulate against future API updates. After you submit a message and its transfers, ignore them until its completion callback.h]hX5The code that submits an spi_message (and its spi_transfers) to the lower layers is responsible for managing its memory. Zero-initialize every field you don’t set up explicitly, to insulate against future API updates. After you submit a message and its transfers, ignore them until its completion callback.}(hj&1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM(hhhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_message (C struct) c.spi_messagehNtauh1jhhhhhjhNubj)}(hhh](j)}(h spi_messageh]j)}(hstruct spi_messageh](j)}(hjh]hstruct}(hjN1hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjJ1hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM1ubj)}(h h]h }(hj\1hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjJ1hhhj[1hM1ubj)}(h spi_messageh]j)}(hjH1h]h spi_message}(hjn1hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjj1ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjJ1hhhj[1hM1ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjF1hhhj[1hM1ubah}(h]jA1ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj[1hM1hjC1hhubjD)}(hhh]h)}(h!one multi-segment SPI transactionh]h!one multi-segment SPI transaction}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMdhj1hhubah}(h]h ]h"]h$]h&]uh1jChjC1hhhj[1hM1ubeh}(h]h ](hstructeh"]h$]h&]jdhjej1jfj1jgjhjiuh1jhhhhhjhNubjk)}(hX**Definition**:: struct spi_message { struct list_head transfers; struct spi_device *spi; bool pre_optimized; bool optimized; bool prepared; int status; void (*complete)(void *context); void *context; unsigned frame_length; unsigned actual_length; struct list_head queue; void *state; void *opt_state; struct spi_offload *offload; struct list_head resources; }; **Members** ``transfers`` list of transfer segments in this transaction ``spi`` SPI device to which the transaction is queued ``pre_optimized`` peripheral driver pre-optimized the message ``optimized`` the message is in the optimized state ``prepared`` spi_prepare_message was called for the this message ``status`` zero for success, else negative errno ``complete`` called to report transaction completions ``context`` the argument to complete() when it's called ``frame_length`` the total number of bytes in the message ``actual_length`` the total number of bytes that were transferred in all successful segments ``queue`` for use by whichever driver currently owns the message ``state`` for use by whichever driver currently owns the message ``opt_state`` for use by whichever driver currently owns the message ``offload`` (optional) offload instance used by this message ``resources`` for resource management when the SPI message is processedh](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj1ubh:}(hj1hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhj1ubj)}(hXstruct spi_message { struct list_head transfers; struct spi_device *spi; bool pre_optimized; bool optimized; bool prepared; int status; void (*complete)(void *context); void *context; unsigned frame_length; unsigned actual_length; struct list_head queue; void *state; void *opt_state; struct spi_offload *offload; struct list_head resources; };h]hXstruct spi_message { struct list_head transfers; struct spi_device *spi; bool pre_optimized; bool optimized; bool prepared; int status; void (*complete)(void *context); void *context; unsigned frame_length; unsigned actual_length; struct list_head queue; void *state; void *opt_state; struct spi_offload *offload; struct list_head resources; };}hj1sbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMjhj1ubh)}(h **Members**h]ju)}(hj1h]hMembers}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj1ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM|hj1ubj)}(hhh](j)}(h<``transfers`` list of transfer segments in this transaction h](j)}(h ``transfers``h]h)}(hj1h]h transfers}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMfhj1ubj)}(hhh]h)}(h-list of transfer segments in this transactionh]h-list of transfer segments in this transaction}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2hMfhj2ubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1jhj2hMfhj1ubj)}(h6``spi`` SPI device to which the transaction is queued h](j)}(h``spi``h]h)}(hj62h]hspi}(hj82hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj42ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMghj02ubj)}(hhh]h)}(h-SPI device to which the transaction is queuedh]h-SPI device to which the transaction is queued}(hjO2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjK2hMghjL2ubah}(h]h ]h"]h$]h&]uh1jhj02ubeh}(h]h ]h"]h$]h&]uh1jhjK2hMghj1ubj)}(h>``pre_optimized`` peripheral driver pre-optimized the message h](j)}(h``pre_optimized``h]h)}(hjo2h]h pre_optimized}(hjq2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjm2ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhji2ubj)}(hhh]h)}(h+peripheral driver pre-optimized the messageh]h+peripheral driver pre-optimized the message}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2hMhhj2ubah}(h]h ]h"]h$]h&]uh1jhji2ubeh}(h]h ]h"]h$]h&]uh1jhj2hMhhj1ubj)}(h4``optimized`` the message is in the optimized state h](j)}(h ``optimized``h]h)}(hj2h]h optimized}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMihj2ubj)}(hhh]h)}(h%the message is in the optimized stateh]h%the message is in the optimized state}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2hMihj2ubah}(h]h ]h"]h$]h&]uh1jhj2ubeh}(h]h ]h"]h$]h&]uh1jhj2hMihj1ubj)}(hA``prepared`` spi_prepare_message was called for the this message h](j)}(h ``prepared``h]h)}(hj2h]hprepared}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMjhj2ubj)}(hhh]h)}(h3spi_prepare_message was called for the this messageh]h3spi_prepare_message was called for the this message}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2hMjhj2ubah}(h]h ]h"]h$]h&]uh1jhj2ubeh}(h]h ]h"]h$]h&]uh1jhj2hMjhj1ubj)}(h1``status`` zero for success, else negative errno h](j)}(h ``status``h]h)}(hj3h]hstatus}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMkhj3ubj)}(hhh]h)}(h%zero for success, else negative errnoh]h%zero for success, else negative errno}(hj33hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/3hMkhj03ubah}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhj/3hMkhj1ubj)}(h6``complete`` called to report transaction completions h](j)}(h ``complete``h]h)}(hjS3h]hcomplete}(hjU3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQ3ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMlhjM3ubj)}(hhh]h)}(h(called to report transaction completionsh]h(called to report transaction completions}(hjl3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjh3hMlhji3ubah}(h]h ]h"]h$]h&]uh1jhjM3ubeh}(h]h ]h"]h$]h&]uh1jhjh3hMlhj1ubj)}(h8``context`` the argument to complete() when it's called h](j)}(h ``context``h]h)}(hj3h]hcontext}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMmhj3ubj)}(hhh]h)}(h+the argument to complete() when it's calledh]h-the argument to complete() when it’s called}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3hMmhj3ubah}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhj3hMmhj1ubj)}(h:``frame_length`` the total number of bytes in the message h](j)}(h``frame_length``h]h)}(hj3h]h frame_length}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMnhj3ubj)}(hhh]h)}(h(the total number of bytes in the messageh]h(the total number of bytes in the message}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3hMnhj3ubah}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhj3hMnhj1ubj)}(h]``actual_length`` the total number of bytes that were transferred in all successful segments h](j)}(h``actual_length``h]h)}(hj3h]h actual_length}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMphj3ubj)}(hhh]h)}(hJthe total number of bytes that were transferred in all successful segmentsh]hJthe total number of bytes that were transferred in all successful segments}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMohj4ubah}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhj4hMphj1ubj)}(hA``queue`` for use by whichever driver currently owns the message h](j)}(h ``queue``h]h)}(hj84h]hqueue}(hj:4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj64ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMqhj24ubj)}(hhh]h)}(h6for use by whichever driver currently owns the messageh]h6for use by whichever driver currently owns the message}(hjQ4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjM4hMqhjN4ubah}(h]h ]h"]h$]h&]uh1jhj24ubeh}(h]h ]h"]h$]h&]uh1jhjM4hMqhj1ubj)}(hA``state`` for use by whichever driver currently owns the message h](j)}(h ``state``h]h)}(hjq4h]hstate}(hjs4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjo4ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMrhjk4ubj)}(hhh]h)}(h6for use by whichever driver currently owns the messageh]h6for use by whichever driver currently owns the message}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4hMrhj4ubah}(h]h ]h"]h$]h&]uh1jhjk4ubeh}(h]h ]h"]h$]h&]uh1jhj4hMrhj1ubj)}(hE``opt_state`` for use by whichever driver currently owns the message h](j)}(h ``opt_state``h]h)}(hj4h]h opt_state}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMshj4ubj)}(hhh]h)}(h6for use by whichever driver currently owns the messageh]h6for use by whichever driver currently owns the message}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4hMshj4ubah}(h]h ]h"]h$]h&]uh1jhj4ubeh}(h]h ]h"]h$]h&]uh1jhj4hMshj1ubj)}(h=``offload`` (optional) offload instance used by this message h](j)}(h ``offload``h]h)}(hj4h]hoffload}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMuhj4ubj)}(hhh]h)}(h0(optional) offload instance used by this messageh]h0(optional) offload instance used by this message}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj4hMuhj4ubah}(h]h ]h"]h$]h&]uh1jhj4ubeh}(h]h ]h"]h$]h&]uh1jhj4hMuhj1ubj)}(hG``resources`` for resource management when the SPI message is processedh](j)}(h ``resources``h]h)}(hj5h]h resources}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMshj5ubj)}(hhh]h)}(h9for resource management when the SPI message is processedh]h9for resource management when the SPI message is processed}(hj55hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMthj25ubah}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]uh1jhj15hMshj1ubeh}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubh)}(h**Description**h]ju)}(hj_5h]h Description}(hja5hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj]5ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMwhhhhubh)}(hXA **spi_message** is used to execute an atomic sequence of data transfers, each represented by a struct spi_transfer. The sequence is "atomic" in the sense that no other spi_message may use that SPI bus until that sequence completes. On some systems, many such sequences can execute as a single programmed DMA transfer. On all systems, these messages are queued, and might complete after transactions to other devices. Messages sent to a given spi_device are always executed in FIFO order.h](hA }(hju5hhhNhNubju)}(h**spi_message**h]h spi_message}(hj}5hhhNhNubah}(h]h ]h"]h$]h&]uh1jthju5ubhX is used to execute an atomic sequence of data transfers, each represented by a struct spi_transfer. The sequence is “atomic” in the sense that no other spi_message may use that SPI bus until that sequence completes. On some systems, many such sequences can execute as a single programmed DMA transfer. On all systems, these messages are queued, and might complete after transactions to other devices. Messages sent to a given spi_device are always executed in FIFO order.}(hju5hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMuhhhhubh)}(hX3The code that submits an spi_message (and its spi_transfers) to the lower layers is responsible for managing its memory. Zero-initialize every field you don't set up explicitly, to insulate against future API updates. After you submit a message and its transfers, ignore them until its completion callback.h]hX5The code that submits an spi_message (and its spi_transfers) to the lower layers is responsible for managing its memory. Zero-initialize every field you don’t set up explicitly, to insulate against future API updates. After you submit a message and its transfers, ignore them until its completion callback.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM}hhhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j,spi_message_init_with_transfers (C function)!c.spi_message_init_with_transfershNtauh1jhhhhhjhNubj)}(hhh](j)}(hpvoid spi_message_init_with_transfers (struct spi_message *m, struct spi_transfer *xfers, unsigned int num_xfers)h]j)}(hovoid spi_message_init_with_transfers(struct spi_message *m, struct spi_transfer *xfers, unsigned int num_xfers)h](j)}(hvoidh]hvoid}(hj5hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMubj)}(h h]h }(hj5hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj5hhhj5hMubj)}(hspi_message_init_with_transfersh]j)}(hspi_message_init_with_transfersh]hspi_message_init_with_transfers}(hj5hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj5ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhj5hhhj5hMubj:)}(hK(struct spi_message *m, struct spi_transfer *xfers, unsigned int num_xfers)h](j@)}(hstruct spi_message *mh](j)}(hjh]hstruct}(hj5hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubj)}(h h]h }(hj6hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj5ubh)}(hhh]j)}(h spi_messageh]h spi_message}(hj6hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj6ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj6modnameN classnameNj}j)}j]j)}jyj5sb!c.spi_message_init_with_transfersasbuh1hhj5ubj)}(h h]h }(hj96hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj5ubj)}(hjh]h*}(hjG6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj5ubj)}(hmh]hm}(hjT6hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj5ubj@)}(hstruct spi_transfer *xfersh](j)}(hjh]hstruct}(hjm6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhji6ubj)}(h h]h }(hjz6hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhji6ubh)}(hhh]j)}(h spi_transferh]h spi_transfer}(hj6hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj6ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj6modnameN classnameNj}j)}j]j56!c.spi_message_init_with_transfersasbuh1hhji6ubj)}(h h]h }(hj6hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhji6ubj)}(hjh]h*}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhji6ubj)}(hxfersh]hxfers}(hj6hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhji6ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj5ubj@)}(hunsigned int num_xfersh](j)}(hunsignedh]hunsigned}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubj)}(h h]h }(hj6hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj6ubj)}(hinth]hint}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubj)}(h h]h }(hj7hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj6ubj)}(h num_xfersh]h num_xfers}(hj7hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj5ubeh}(h]h ]h"]h$]h&]j-j.uh1j9hj5hhhj5hMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hj5hhhj5hMubah}(h]j5ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj5hMhj5hhubjD)}(hhh]h)}(h+Initialize spi_message and append transfersh]h+Initialize spi_message and append transfers}(hj?7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj<7hhubah}(h]h ]h"]h$]h&]uh1jChj5hhhj5hMubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejW7jfjW7jgjhjiuh1jhhhhhjhNubjk)}(hXE**Parameters** ``struct spi_message *m`` spi_message to be initialized ``struct spi_transfer *xfers`` An array of SPI transfers ``unsigned int num_xfers`` Number of items in the xfer array **Description** This function initializes the given spi_message and adds each spi_transfer in the given array to the message.h](h)}(h**Parameters**h]ju)}(hja7h]h Parameters}(hjc7hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj_7ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj[7ubj)}(hhh](j)}(h8``struct spi_message *m`` spi_message to be initialized h](j)}(h``struct spi_message *m``h]h)}(hj7h]hstruct spi_message *m}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj~7ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhjz7ubj)}(hhh]h)}(hspi_message to be initializedh]hspi_message to be initialized}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hMhj7ubah}(h]h ]h"]h$]h&]uh1jhjz7ubeh}(h]h ]h"]h$]h&]uh1jhj7hMhjw7ubj)}(h9``struct spi_transfer *xfers`` An array of SPI transfers h](j)}(h``struct spi_transfer *xfers``h]h)}(hj7h]hstruct spi_transfer *xfers}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj7ubj)}(hhh]h)}(hAn array of SPI transfersh]hAn array of SPI transfers}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hMhj7ubah}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1jhj7hMhjw7ubj)}(h=``unsigned int num_xfers`` Number of items in the xfer array h](j)}(h``unsigned int num_xfers``h]h)}(hj7h]hunsigned int num_xfers}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj7ubj)}(hhh]h)}(h!Number of items in the xfer arrayh]h!Number of items in the xfer array}(hj 8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8hMhj8ubah}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1jhj8hMhjw7ubeh}(h]h ]h"]h$]h&]uh1jhj[7ubh)}(h**Description**h]ju)}(hj-8h]h Description}(hj/8hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj+8ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj[7ubh)}(hmThis function initializes the given spi_message and adds each spi_transfer in the given array to the message.h]hmThis function initializes the given spi_message and adds each spi_transfer in the given array to the message.}(hjC8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj[7ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!spi_is_bpw_supported (C function)c.spi_is_bpw_supportedhNtauh1jhhhhhjhNubj)}(hhh](j)}(h;bool spi_is_bpw_supported (struct spi_device *spi, u32 bpw)h]j)}(h:bool spi_is_bpw_supported(struct spi_device *spi, u32 bpw)h](j)}(hboolh]hbool}(hjr8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjn8hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM+ubj)}(h h]h }(hj8hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjn8hhhj8hM+ubj)}(hspi_is_bpw_supportedh]j)}(hspi_is_bpw_supportedh]hspi_is_bpw_supported}(hj8hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj8ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjn8hhhj8hM+ubj:)}(h!(struct spi_device *spi, u32 bpw)h](j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hj8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8ubj)}(h h]h }(hj8hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj8ubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hj8hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj8modnameN classnameNj}j)}j]j)}jyj8sbc.spi_is_bpw_supportedasbuh1hhj8ubj)}(h h]h }(hj8hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj8ubj)}(hjh]h*}(hj8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8ubj)}(hspih]hspi}(hj9hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj8ubj@)}(hu32 bpwh](h)}(hhh]j)}(hu32h]hu32}(hj$9hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj!9ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj&9modnameN classnameNj}j)}j]j8c.spi_is_bpw_supportedasbuh1hhj9ubj)}(h h]h }(hjB9hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj9ubj)}(hbpwh]hbpw}(hjP9hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj8ubeh}(h]h ]h"]h$]h&]j-j.uh1j9hjn8hhhj8hM+ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjj8hhhj8hM+ubah}(h]je8ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj8hM+hjg8hhubjD)}(hhh]h)}(h#Check if bits per word is supportedh]h#Check if bits per word is supported}(hjz9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM+hjw9hhubah}(h]h ]h"]h$]h&]uh1jChjg8hhhj8hM+ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjej9jfj9jgjhjiuh1jhhhhhjhNubjk)}(h**Parameters** ``struct spi_device *spi`` SPI device ``u32 bpw`` Bits per word **Description** This function checks to see if the SPI controller supports **bpw**. **Return** True if **bpw** is supported, false otherwise.h](h)}(h**Parameters**h]ju)}(hj9h]h Parameters}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj9ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM/hj9ubj)}(hhh](j)}(h&``struct spi_device *spi`` SPI device h](j)}(h``struct spi_device *spi``h]h)}(hj9h]hstruct spi_device *spi}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM,hj9ubj)}(hhh]h)}(h SPI deviceh]h SPI device}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hM,hj9ubah}(h]h ]h"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]uh1jhj9hM,hj9ubj)}(h``u32 bpw`` Bits per word h](j)}(h ``u32 bpw``h]h)}(hj9h]hu32 bpw}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM-hj9ubj)}(hhh]h)}(h Bits per wordh]h Bits per word}(hj :hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj :hM-hj :ubah}(h]h ]h"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]uh1jhj :hM-hj9ubeh}(h]h ]h"]h$]h&]uh1jhj9ubh)}(h**Description**h]ju)}(hj/:h]h Description}(hj1:hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj-:ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM/hj9ubh)}(hCThis function checks to see if the SPI controller supports **bpw**.h](h;This function checks to see if the SPI controller supports }(hjE:hhhNhNubju)}(h**bpw**h]hbpw}(hjM:hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjE:ubh.}(hjE:hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM.hj9ubh)}(h **Return**h]ju)}(hjh:h]hReturn}(hjj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjf:ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM0hj9ubh)}(h.True if **bpw** is supported, false otherwise.h](hTrue if }(hj~:hhhNhNubju)}(h**bpw**h]hbpw}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj~:ubh is supported, false otherwise.}(hj~:hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM1hj9ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_bpw_to_bytes (C function)c.spi_bpw_to_byteshNtauh1jhhhhhjhNubj)}(hhh](j)}(hu32 spi_bpw_to_bytes (u32 bpw)h]j)}(hu32 spi_bpw_to_bytes(u32 bpw)h](h)}(hhh]j)}(hu32h]hu32}(hj:hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj:ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj:modnameN classnameNj}j)}j]j)}jyspi_bpw_to_bytessbc.spi_bpw_to_bytesasbuh1hhj:hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM?ubj)}(h h]h }(hj:hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj:hhhj:hM?ubj)}(hspi_bpw_to_bytesh]j)}(hj:h]hspi_bpw_to_bytes}(hj:hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj:ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhj:hhhj:hM?ubj:)}(h (u32 bpw)h]j@)}(hu32 bpwh](h)}(hhh]j)}(hu32h]hu32}(hj;hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj;ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj;modnameN classnameNj}j)}j]j:c.spi_bpw_to_bytesasbuh1hhj ;ubj)}(h h]h }(hj2;hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ;ubj)}(hbpwh]hbpw}(hj@;hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj ;ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj ;ubah}(h]h ]h"]h$]h&]j-j.uh1j9hj:hhhj:hM?ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hj:hhhj:hM?ubah}(h]j:ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj:hM?hj:hhubjD)}(hhh]h)}(hCovert bits per word to bytesh]hCovert bits per word to bytes}(hjj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM?hjg;hhubah}(h]h ]h"]h$]h&]uh1jChj:hhhj:hM?ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjej;jfj;jgjhjiuh1jhhhhhjhNubjk)}(hX**Parameters** ``u32 bpw`` Bits per word **Description** This function converts the given **bpw** to bytes. The result is always power-of-two, e.g., =============== ================= Input (in bits) Output (in bytes) =============== ================= 5 1 9 2 21 4 37 8 =============== ================= It will return 0 for the 0 input. **Return** Bytes for the given **bpw**.h](h)}(h**Parameters**h]ju)}(hj;h]h Parameters}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj;ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMChj;ubj)}(hhh]j)}(h``u32 bpw`` Bits per word h](j)}(h ``u32 bpw``h]h)}(hj;h]hu32 bpw}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM@hj;ubj)}(hhh]h)}(h Bits per wordh]h Bits per word}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;hM@hj;ubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhj;hM@hj;ubah}(h]h ]h"]h$]h&]uh1jhj;ubh)}(h**Description**h]ju)}(hj;h]h Description}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj;ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMBhj;ubh)}(h[This function converts the given **bpw** to bytes. The result is always power-of-two, e.g.,h](h!This function converts the given }(hj;hhhNhNubju)}(h**bpw**h]hbpw}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj;ubh3 to bytes. The result is always power-of-two, e.g.,}(hj;hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMAhj;ubj)}(hX =============== ================= Input (in bits) Output (in bytes) =============== ================= 5 1 9 2 21 4 37 8 =============== ================= h]htable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j+<hj(<ubj,<)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j+<hj(<ubhthead)}(hhh]hrow)}(hhh](hentry)}(hhh]h)}(hInput (in bits)h]hInput (in bits)}(hjP<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMEhjM<ubah}(h]h ]h"]h$]h&]uh1jK<hjH<ubjL<)}(hhh]h)}(hOutput (in bytes)h]hOutput (in bytes)}(hjh<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^<hMEhje<ubah}(h]h ]h"]h$]h&]uh1jK<hjH<ubeh}(h]h ]h"]h$]h&]uh1jF<hjC<ubah}(h]h ]h"]h$]h&]uh1jA<hj(<ubhtbody)}(hhh](jG<)}(hhh](jL<)}(hhh]h)}(h5h]h5}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMGhj<ubah}(h]h ]h"]h$]h&]uh1jK<hj<ubjL<)}(hhh]h)}(h1h]h1}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<hMGhj<ubah}(h]h ]h"]h$]h&]uh1jK<hj<ubeh}(h]h ]h"]h$]h&]uh1jF<hj<ubjG<)}(hhh](jL<)}(hhh]h)}(h9h]h9}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMHhj<ubah}(h]h ]h"]h$]h&]uh1jK<hj<ubjL<)}(hhh]h)}(h2h]h2}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<hMHhj<ubah}(h]h ]h"]h$]h&]uh1jK<hj<ubeh}(h]h ]h"]h$]h&]uh1jF<hj<ubjG<)}(hhh](jL<)}(hhh]h)}(h21h]h21}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMIhj=ubah}(h]h ]h"]h$]h&]uh1jK<hj<ubjL<)}(hhh]h)}(h4h]h4}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj=hMIhj=ubah}(h]h ]h"]h$]h&]uh1jK<hj<ubeh}(h]h ]h"]h$]h&]uh1jF<hj<ubjG<)}(hhh](jL<)}(hhh]h)}(h37h]h37}(hj;=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMJhj8=ubah}(h]h ]h"]h$]h&]uh1jK<hj5=ubjL<)}(hhh]h)}(h8h]h8}(hjS=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjI=hMJhjP=ubah}(h]h ]h"]h$]h&]uh1jK<hj5=ubeh}(h]h ]h"]h$]h&]uh1jF<hj<ubeh}(h]h ]h"]h$]h&]uh1j<hj(<ubeh}(h]h ]h"]h$]h&]colsKuh1j&<hj#<ubah}(h]h ]h"]h$]h&]uh1j!<hj<ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMDhj;ubh)}(h!It will return 0 for the 0 input.h]h!It will return 0 for the 0 input.}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMMhj;ubh)}(h **Return**h]ju)}(hj=h]hReturn}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj=ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMOhj;ubh)}(hBytes for the given **bpw**.h](hBytes for the given }(hj=hhhNhNubju)}(h**bpw**h]hbpw}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj=ubh.}(hj=hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMPhj;ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j(spi_controller_xfer_timeout (C function)c.spi_controller_xfer_timeouthNtauh1jhhhhhjhNubj)}(hhh](j)}(haunsigned int spi_controller_xfer_timeout (struct spi_controller *ctlr, struct spi_transfer *xfer)h]j)}(h`unsigned int spi_controller_xfer_timeout(struct spi_controller *ctlr, struct spi_transfer *xfer)h](j)}(hunsignedh]hunsigned}(hj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMYubj)}(h h]h }(hj=hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj=hhhj=hMYubj)}(hinth]hint}(hj >hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj=hhhj=hMYubj)}(h h]h }(hj>hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj=hhhj=hMYubj)}(hspi_controller_xfer_timeouth]j)}(hspi_controller_xfer_timeouth]hspi_controller_xfer_timeout}(hj,>hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj(>ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhj=hhhj=hMYubj:)}(h8(struct spi_controller *ctlr, struct spi_transfer *xfer)h](j@)}(hstruct spi_controller *ctlrh](j)}(hjh]hstruct}(hjH>hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjD>ubj)}(h h]h }(hjU>hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjD>ubh)}(hhh]j)}(hspi_controllerh]hspi_controller}(hjf>hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjc>ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjh>modnameN classnameNj}j)}j]j)}jyj.>sbc.spi_controller_xfer_timeoutasbuh1hhjD>ubj)}(h h]h }(hj>hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjD>ubj)}(hjh]h*}(hj>hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjD>ubj)}(hctlrh]hctlr}(hj>hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjD>ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj@>ubj@)}(hstruct spi_transfer *xferh](j)}(hjh]hstruct}(hj>hhhNhNubah}(h]h ]jah"]h$]h&]uh1j(hj>ubj)}(h h]h }(hj>hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj>ubh)}(hhh]j)}(h spi_transferh]h spi_transfer}(hj>hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj>modnameN classnameNj}j)}j]j>c.spi_controller_xfer_timeoutasbuh1hhj>ubj)}(h h]h }(hj>hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj>ubj)}(hjh]h*}(hj?hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj>ubj)}(hxferh]hxfer}(hj?hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj@>ubeh}(h]h ]h"]h$]h&]j-j.uh1j9hj=hhhj=hMYubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hj=hhhj=hMYubah}(h]j=ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj=hMYhj=hhubjD)}(hhh]h)}(h Compute a suitable timeout valueh]h Compute a suitable timeout value}(hj;?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMYhj8?hhubah}(h]h ]h"]h$]h&]uh1jChj=hhhj=hMYubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejS?jfjS?jgjhjiuh1jhhhhhjhNubjk)}(hX**Parameters** ``struct spi_controller *ctlr`` SPI device ``struct spi_transfer *xfer`` Transfer descriptor **Description** Compute a relevant timeout value for the given transfer. We derive the time that it would take on a single data line and take twice this amount of time with a minimum of 500ms to avoid false positives on loaded systems. **Return** Transfer timeout value in milliseconds.h](h)}(h**Parameters**h]ju)}(hj]?h]h Parameters}(hj_?hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj[?ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM]hjW?ubj)}(hhh](j)}(h+``struct spi_controller *ctlr`` SPI device h](j)}(h``struct spi_controller *ctlr``h]h)}(hj|?h]hstruct spi_controller *ctlr}(hj~?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjz?ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMZhjv?ubj)}(hhh]h)}(h SPI deviceh]h SPI device}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj?hMZhj?ubah}(h]h ]h"]h$]h&]uh1jhjv?ubeh}(h]h ]h"]h$]h&]uh1jhj?hMZhjs?ubj)}(h2``struct spi_transfer *xfer`` Transfer descriptor h](j)}(h``struct spi_transfer *xfer``h]h)}(hj?h]hstruct spi_transfer *xfer}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj?ubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM[hj?ubj)}(hhh]h)}(hTransfer descriptorh]hTransfer descriptor}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj?hM[hj?ubah}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]uh1jhj?hM[hjs?ubeh}(h]h ]h"]h$]h&]uh1jhjW?ubh)}(h**Description**h]ju)}(hj?h]h Description}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj?ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM]hjW?ubh)}(hCompute a relevant timeout value for the given transfer. We derive the time that it would take on a single data line and take twice this amount of time with a minimum of 500ms to avoid false positives on loaded systems.h]hCompute a relevant timeout value for the given transfer. We derive the time that it would take on a single data line and take twice this amount of time with a minimum of 500ms to avoid false positives on loaded systems.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM\hjW?ubh)}(h **Return**h]ju)}(hj@h]hReturn}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj@ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM`hjW?ubh)}(h'Transfer timeout value in milliseconds.h]h'Transfer timeout value in milliseconds.}(hj-@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMahjW?ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!spi_replaced_transfers (C struct)c.spi_replaced_transfershNtauh1jhhhhhjhNubj)}(hhh](j)}(hspi_replaced_transfersh]j)}(hstruct spi_replaced_transfersh](j)}(hjh]hstruct}(hj\@hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjX@hhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMfubj)}(h h]h }(hjj@hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjX@hhhji@hMfubj)}(hspi_replaced_transfersh]j)}(hjV@h]hspi_replaced_transfers}(hj|@hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjx@ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjX@hhhji@hMfubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjT@hhhji@hMfubah}(h]jO@ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhji@hMfhjQ@hhubjD)}(hhh]h)}(hcstructure describing the spi_transfer replacements that have occurred so that they can get revertedh]hcstructure describing the spi_transfer replacements that have occurred so that they can get reverted}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMrhj@hhubah}(h]h ]h"]h$]h&]uh1jChjQ@hhhji@hMfubeh}(h]h ](hstructeh"]h$]h&]jdhjej@jfj@jgjhjiuh1jhhhhhjhNubjk)}(hX **Definition**:: struct spi_replaced_transfers { spi_replaced_release_t release; void *extradata; struct list_head replaced_transfers; struct list_head *replaced_after; size_t inserted; struct spi_transfer inserted_transfers[]; }; **Members** ``release`` some extra release code to get executed prior to releasing this structure ``extradata`` pointer to some extra data if requested or NULL ``replaced_transfers`` transfers that have been replaced and which need to get restored ``replaced_after`` the transfer after which the **replaced_transfers** are to get re-inserted ``inserted`` number of transfers inserted ``inserted_transfers`` array of spi_transfers of array-size **inserted**, that have been replacing replaced_transfersh](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj@ubh:}(hj@hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMvhj@ubj)}(hstruct spi_replaced_transfers { spi_replaced_release_t release; void *extradata; struct list_head replaced_transfers; struct list_head *replaced_after; size_t inserted; struct spi_transfer inserted_transfers[]; };h]hstruct spi_replaced_transfers { spi_replaced_release_t release; void *extradata; struct list_head replaced_transfers; struct list_head *replaced_after; size_t inserted; struct spi_transfer inserted_transfers[]; };}hj@sbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMxhj@ubh)}(h **Members**h]ju)}(hj@h]hMembers}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj@ubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhj@ubj)}(hhh](j)}(hV``release`` some extra release code to get executed prior to releasing this structure h](j)}(h ``release``h]h)}(hj Ah]hrelease}(hj AhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj Aubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMwhjAubj)}(hhh]h)}(hIsome extra release code to get executed prior to releasing this structureh]hIsome extra release code to get executed prior to releasing this structure}(hj$AhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMvhj!Aubah}(h]h ]h"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]uh1jhj AhMwhjAubj)}(h>``extradata`` pointer to some extra data if requested or NULL h](j)}(h ``extradata``h]h)}(hjEAh]h extradata}(hjGAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjCAubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMxhj?Aubj)}(hhh]h)}(h/pointer to some extra data if requested or NULLh]h/pointer to some extra data if requested or NULL}(hj^AhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZAhMxhj[Aubah}(h]h ]h"]h$]h&]uh1jhj?Aubeh}(h]h ]h"]h$]h&]uh1jhjZAhMxhjAubj)}(hX``replaced_transfers`` transfers that have been replaced and which need to get restored h](j)}(h``replaced_transfers``h]h)}(hj~Ah]hreplaced_transfers}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj|Aubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMzhjxAubj)}(hhh]h)}(h@transfers that have been replaced and which need to get restoredh]h@transfers that have been replaced and which need to get restored}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMyhjAubah}(h]h ]h"]h$]h&]uh1jhjxAubeh}(h]h ]h"]h$]h&]uh1jhjAhMzhjAubj)}(h^``replaced_after`` the transfer after which the **replaced_transfers** are to get re-inserted h](j)}(h``replaced_after``h]h)}(hjAh]hreplaced_after}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjAubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM|hjAubj)}(hhh]h)}(hJthe transfer after which the **replaced_transfers** are to get re-insertedh](hthe transfer after which the }(hjAhhhNhNubju)}(h**replaced_transfers**h]hreplaced_transfers}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjAubh are to get re-inserted}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM{hjAubah}(h]h ]h"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]uh1jhjAhM|hjAubj)}(h*``inserted`` number of transfers inserted h](j)}(h ``inserted``h]h)}(hjBh]hinserted}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM}hjAubj)}(hhh]h)}(hnumber of transfers insertedh]hnumber of transfers inserted}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBhM}hjBubah}(h]h ]h"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]uh1jhjBhM}hjAubj)}(hu``inserted_transfers`` array of spi_transfers of array-size **inserted**, that have been replacing replaced_transfersh](j)}(h``inserted_transfers``h]h)}(hj=Bh]hinserted_transfers}(hj?BhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj;Bubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM~hj7Bubj)}(hhh]h)}(h^array of spi_transfers of array-size **inserted**, that have been replacing replaced_transfersh](h%array of spi_transfers of array-size }(hjVBhhhNhNubju)}(h **inserted**h]hinserted}(hj^BhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjVBubh-, that have been replacing replaced_transfers}(hjVBhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjRBhM~hjSBubah}(h]h ]h"]h$]h&]uh1jhj7Bubeh}(h]h ]h"]h$]h&]uh1jhjRBhM~hjAubeh}(h]h ]h"]h$]h&]uh1jhj@ubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubh)}(h**Note**h]ju)}(hjBh]hNote}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjBubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubh)}(hthat **extradata** will point to **inserted_transfers**[**inserted**] if some extra allocation is requested, so alignment will be the same as for spi_transfers.h](hthat }(hjBhhhNhNubju)}(h **extradata**h]h extradata}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjBubh will point to }(hjBhhhNhNubju)}(h#**inserted_transfers**[**inserted**h]hinserted_transfers**[**inserted}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjBubh\] if some extra allocation is requested, so alignment will be the same as for spi_transfers.}(hjBhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMhhhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_sync_transfer (C function)c.spi_sync_transferhNtauh1jhhhhhjhNubj)}(hhh](j)}(hbint spi_sync_transfer (struct spi_device *spi, struct spi_transfer *xfers, unsigned int num_xfers)h]j)}(haint spi_sync_transfer(struct spi_device *spi, struct spi_transfer *xfers, unsigned int num_xfers)h](j)}(hinth]hint}(hjBhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjBhhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMubj)}(h h]h }(hjChhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjBhhhjChMubj)}(hspi_sync_transferh]j)}(hspi_sync_transferh]hspi_sync_transfer}(hjChhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjCubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjBhhhjChMubj:)}(hL(struct spi_device *spi, struct spi_transfer *xfers, unsigned int num_xfers)h](j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hj0ChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,Cubj)}(h h]h }(hj=ChhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj,Cubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hjNChhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjKCubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjPCmodnameN classnameNj}j)}j]j)}jyjCsbc.spi_sync_transferasbuh1hhj,Cubj)}(h h]h }(hjnChhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj,Cubj)}(hjh]h*}(hj|ChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj,Cubj)}(hspih]hspi}(hjChhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj,Cubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj(Cubj@)}(hstruct spi_transfer *xfersh](j)}(hjh]hstruct}(hjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjCubj)}(h h]h }(hjChhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjCubh)}(hhh]j)}(h spi_transferh]h spi_transfer}(hjChhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjCubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjCmodnameN classnameNj}j)}j]jjCc.spi_sync_transferasbuh1hhjCubj)}(h h]h }(hjChhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjCubj)}(hjh]h*}(hjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjCubj)}(hxfersh]hxfers}(hjChhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj(Cubj@)}(hunsigned int num_xfersh](j)}(hunsignedh]hunsigned}(hjDhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjDubj)}(h h]h }(hj DhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjDubj)}(hinth]hint}(hj.DhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjDubj)}(h h]h }(hjSPI synchronous 8 bit write followed by 16 bit big-endian readh]h>SPI synchronous 8 bit write followed by 16 bit big-endian read}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM hjQhhubah}(h]h ]h"]h$]h&]uh1jChjPhhhjPhM ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejQjfjQjgjhjiuh1jhhhhhjhNubjk)}(hX**Parameters** ``struct spi_device *spi`` device with which data will be exchanged ``u8 cmd`` command to be written before data is read back **Context** can sleep **Description** This function is similar to spi_w8r16, with the exception that it will convert the read 16 bit data word from big-endian to native endianness. Callable only from contexts that can sleep. **Return** the (unsigned) sixteen bit number returned by the device in CPU endianness, or else a negative error code.h](h)}(h**Parameters**h]ju)}(hjQh]h Parameters}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjQubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM$hjQubj)}(hhh](j)}(hD``struct spi_device *spi`` device with which data will be exchanged h](j)}(h``struct spi_device *spi``h]h)}(hj Rh]hstruct spi_device *spi}(hj RhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj Rubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM!hjRubj)}(hhh]h)}(h(device with which data will be exchangedh]h(device with which data will be exchanged}(hj$RhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj RhM!hj!Rubah}(h]h ]h"]h$]h&]uh1jhjRubeh}(h]h ]h"]h$]h&]uh1jhj RhM!hjRubj)}(h:``u8 cmd`` command to be written before data is read back h](j)}(h ``u8 cmd``h]h)}(hjDRh]hu8 cmd}(hjFRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBRubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM"hj>Rubj)}(hhh]h)}(h.command to be written before data is read backh]h.command to be written before data is read back}(hj]RhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjYRhM"hjZRubah}(h]h ]h"]h$]h&]uh1jhj>Rubeh}(h]h ]h"]h$]h&]uh1jhjYRhM"hjRubeh}(h]h ]h"]h$]h&]uh1jhjQubh)}(h **Context**h]ju)}(hjRh]hContext}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj}Rubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM$hjQubh)}(h can sleeph]h can sleep}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM#hjQubh)}(h**Description**h]ju)}(hjRh]h Description}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjRubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM%hjQubh)}(hThis function is similar to spi_w8r16, with the exception that it will convert the read 16 bit data word from big-endian to native endianness.h]hThis function is similar to spi_w8r16, with the exception that it will convert the read 16 bit data word from big-endian to native endianness.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM$hjQubh)}(h+Callable only from contexts that can sleep.h]h+Callable only from contexts that can sleep.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM'hjQubh)}(h **Return**h]ju)}(hjRh]hReturn}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjRubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM)hjQubh)}(hjthe (unsigned) sixteen bit number returned by the device in CPU endianness, or else a negative error code.h]hjthe (unsigned) sixteen bit number returned by the device in CPU endianness, or else a negative error code.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM*hjQubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_board_info (C struct)c.spi_board_infohNtauh1jhhhhhjhNubj)}(hhh](j)}(hspi_board_infoh]j)}(hstruct spi_board_infoh](j)}(hjh]hstruct}(hj!ShhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjShhhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM0ubj)}(h h]h }(hj/ShhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjShhhj.ShM0ubj)}(hspi_board_infoh]j)}(hjSh]hspi_board_info}(hjAShhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj=Subah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjShhhj.ShM0ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjShhhj.ShM0ubah}(h]jSah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj.ShM0hjShhubjD)}(hhh]h)}(h(board-specific template for a SPI deviceh]h(board-specific template for a SPI device}(hjcShhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMKhj`Shhubah}(h]h ]h"]h$]h&]uh1jChjShhhj.ShM0ubeh}(h]h ](hstructeh"]h$]h&]jdhjej{Sjfj{Sjgjhjiuh1jhhhhhjhNubjk)}(hX**Definition**:: struct spi_board_info { char modalias[SPI_NAME_SIZE]; const void *platform_data; const struct software_node *swnode; void *controller_data; int irq; u32 max_speed_hz; u16 bus_num; u16 chip_select; u32 mode; }; **Members** ``modalias`` Initializes spi_device.modalias; identifies the driver. ``platform_data`` Initializes spi_device.platform_data; the particular data stored there is driver-specific. ``swnode`` Software node for the device. ``controller_data`` Initializes spi_device.controller_data; some controllers need hints about hardware setup, e.g. for DMA. ``irq`` Initializes spi_device.irq; depends on how the board is wired. ``max_speed_hz`` Initializes spi_device.max_speed_hz; based on limits from the chip datasheet and board-specific signal quality issues. ``bus_num`` Identifies which spi_controller parents the spi_device; unused by spi_new_device(), and otherwise depends on board wiring. ``chip_select`` Initializes spi_device.chip_select; depends on how the board is wired. ``mode`` Initializes spi_device.mode; based on the chip datasheet, board wiring (some devices support both 3WIRE and standard modes), and possibly presence of an inverter in the chipselect path.h](h)}(h**Definition**::h](ju)}(h**Definition**h]h Definition}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1jthjSubh:}(hjShhhNhNubeh}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMOhjSubj)}(hstruct spi_board_info { char modalias[SPI_NAME_SIZE]; const void *platform_data; const struct software_node *swnode; void *controller_data; int irq; u32 max_speed_hz; u16 bus_num; u16 chip_select; u32 mode; };7h]hstruct spi_board_info { char modalias[SPI_NAME_SIZE]; const void *platform_data; const struct software_node *swnode; void *controller_data; int irq; u32 max_speed_hz; u16 bus_num; u16 chip_select; u32 mode; };}hjSsbah}(h]h ]h"]h$]h&]j-j.uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMQhjSubh)}(h **Members**h]ju)}(hjSh]hMembers}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1jthjSubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM]hjSubj)}(hhh](j)}(hE``modalias`` Initializes spi_device.modalias; identifies the driver. h](j)}(h ``modalias``h]h)}(hjSh]hmodalias}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjSubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMMhjSubj)}(hhh]h)}(h7Initializes spi_device.modalias; identifies the driver.h]h7Initializes spi_device.modalias; identifies the driver.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShMMhjSubah}(h]h ]h"]h$]h&]uh1jhjSubeh}(h]h ]h"]h$]h&]uh1jhjShMMhjSubj)}(hm``platform_data`` Initializes spi_device.platform_data; the particular data stored there is driver-specific. h](j)}(h``platform_data``h]h)}(hj Th]h platform_data}(hj ThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjTubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMOhjTubj)}(hhh]h)}(hZInitializes spi_device.platform_data; the particular data stored there is driver-specific.h]hZInitializes spi_device.platform_data; the particular data stored there is driver-specific.}(hj"ThhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMNhjTubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1jhjThMOhjSubj)}(h)``swnode`` Software node for the device. h](j)}(h ``swnode``h]h)}(hjCTh]hswnode}(hjEThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjATubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMPhj=Tubj)}(hhh]h)}(hSoftware node for the device.h]hSoftware node for the device.}(hj\ThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXThMPhjYTubah}(h]h ]h"]h$]h&]uh1jhj=Tubeh}(h]h ]h"]h$]h&]uh1jhjXThMPhjSubj)}(h|``controller_data`` Initializes spi_device.controller_data; some controllers need hints about hardware setup, e.g. for DMA. h](j)}(h``controller_data``h]h)}(hj|Th]hcontroller_data}(hj~ThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzTubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMRhjvTubj)}(hhh]h)}(hgInitializes spi_device.controller_data; some controllers need hints about hardware setup, e.g. for DMA.h]hgInitializes spi_device.controller_data; some controllers need hints about hardware setup, e.g. for DMA.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMQhjTubah}(h]h ]h"]h$]h&]uh1jhjvTubeh}(h]h ]h"]h$]h&]uh1jhjThMRhjSubj)}(hG``irq`` Initializes spi_device.irq; depends on how the board is wired. h](j)}(h``irq``h]h)}(hjTh]hirq}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjTubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMShjTubj)}(hhh]h)}(h>Initializes spi_device.irq; depends on how the board is wired.h]h>Initializes spi_device.irq; depends on how the board is wired.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThMShjTubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1jhjThMShjSubj)}(h``max_speed_hz`` Initializes spi_device.max_speed_hz; based on limits from the chip datasheet and board-specific signal quality issues. h](j)}(h``max_speed_hz``h]h)}(hjTh]h max_speed_hz}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjTubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMUhjTubj)}(hhh]h)}(hvInitializes spi_device.max_speed_hz; based on limits from the chip datasheet and board-specific signal quality issues.h]hvInitializes spi_device.max_speed_hz; based on limits from the chip datasheet and board-specific signal quality issues.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMThjUubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1jhjUhMUhjSubj)}(h``bus_num`` Identifies which spi_controller parents the spi_device; unused by spi_new_device(), and otherwise depends on board wiring. h](j)}(h ``bus_num``h]h)}(hj)Uh]hbus_num}(hj+UhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'Uubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMWhj#Uubj)}(hhh]h)}(hzIdentifies which spi_controller parents the spi_device; unused by spi_new_device(), and otherwise depends on board wiring.h]hzIdentifies which spi_controller parents the spi_device; unused by spi_new_device(), and otherwise depends on board wiring.}(hjBUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMVhj?Uubah}(h]h ]h"]h$]h&]uh1jhj#Uubeh}(h]h ]h"]h$]h&]uh1jhj>UhMWhjSubj)}(hW``chip_select`` Initializes spi_device.chip_select; depends on how the board is wired. h](j)}(h``chip_select``h]h)}(hjcUh]h chip_select}(hjeUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjaUubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMYhj]Uubj)}(hhh]h)}(hFInitializes spi_device.chip_select; depends on how the board is wired.h]hFInitializes spi_device.chip_select; depends on how the board is wired.}(hj|UhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMXhjyUubah}(h]h ]h"]h$]h&]uh1jhj]Uubeh}(h]h ]h"]h$]h&]uh1jhjxUhMYhjSubj)}(h``mode`` Initializes spi_device.mode; based on the chip datasheet, board wiring (some devices support both 3WIRE and standard modes), and possibly presence of an inverter in the chipselect path.h](j)}(h``mode``h]h)}(hjUh]hmode}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUubah}(h]h ]h"]h$]h&]uh1jhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM[hjUubj)}(hhh]h)}(hInitializes spi_device.mode; based on the chip datasheet, board wiring (some devices support both 3WIRE and standard modes), and possibly presence of an inverter in the chipselect path.h]hInitializes spi_device.mode; based on the chip datasheet, board wiring (some devices support both 3WIRE and standard modes), and possibly presence of an inverter in the chipselect path.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMZhjUubah}(h]h ]h"]h$]h&]uh1jhjUubeh}(h]h ]h"]h$]h&]uh1jhjUhM[hjSubeh}(h]h ]h"]h$]h&]uh1jhjSubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhjhNubh)}(h**Description**h]ju)}(hjUh]h Description}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjUubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM_hhhhubh)}(hXWhen adding new SPI devices to the device tree, these structures serve as a partial device template. They hold information which can't always be determined by drivers. Information that probe() can establish (such as the default transfer wordsize) is not included here.h]hXWhen adding new SPI devices to the device tree, these structures serve as a partial device template. They hold information which can’t always be determined by drivers. Information that probe() can establish (such as the default transfer wordsize) is not included here.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhM\hhhhubh)}(hXThese structures are used in two places. Their primary role is to be stored in tables of board-specific device descriptors, which are declared early in board initialization and then used (much later) to populate a controller's device tree after the that controller's driver initializes. A secondary (and atypical) role is as a parameter to spi_new_device() call, which happens after those controller drivers are active in some dynamic board configuration models.h]hXThese structures are used in two places. Their primary role is to be stored in tables of board-specific device descriptors, which are declared early in board initialization and then used (much later) to populate a controller’s device tree after the that controller’s driver initializes. A secondary (and atypical) role is as a parameter to spi_new_device() call, which happens after those controller drivers are active in some dynamic board configuration models.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhV/var/lib/git/docbuild/linux/Documentation/driver-api/spi:46: ./include/linux/spi/spi.hhMahhhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$spi_register_board_info (C function)c.spi_register_board_infohNtauh1jhhhhhNhNubj)}(hhh](j)}(hKint spi_register_board_info (struct spi_board_info const *info, unsigned n)h]j)}(hJint spi_register_board_info(struct spi_board_info const *info, unsigned n)h](j)}(hinth]hint}(hj-VhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj)VhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:49: ./drivers/spi/spi.chMubj)}(h h]h }(hjjh]h bool irqs_off}(hj@jhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIf true, will re-enable IRQs and preemption for the local CPU.h]h>If true, will re-enable IRQs and preemption for the local CPU.}(hjWjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjSjhMhjTjubah}(h]h ]h"]h$]h&]uh1jhj8jubeh}(h]h ]h"]h$]h&]uh1jhjSjhMhjiubeh}(h]h ]h"]h$]h&]uh1jhjniubh)}(h**Description**h]ju)}(hjyjh]h Description}(hj{jhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjwjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjniubh)}(hThis is a helper for drivers to collect the end of the TX timestamp for the requested byte from the SPI transfer. Can be called with an arbitrary frequency: only the first call where **tx** exceeds or is equal to the requested word will be timestamped.h](hThis is a helper for drivers to collect the end of the TX timestamp for the requested byte from the SPI transfer. Can be called with an arbitrary frequency: only the first call where }(hjjhhhNhNubju)}(h**tx**h]htx}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjjubh? exceeds or is equal to the requested word will be timestamped.}(hjjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjniubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j(spi_get_next_queued_message (C function)c.spi_get_next_queued_messagehNtauh1jhhhhhNhNubj)}(hhh](j)}(hNstruct spi_message * spi_get_next_queued_message (struct spi_controller *ctlr)h]j)}(hLstruct spi_message *spi_get_next_queued_message(struct spi_controller *ctlr)h](j)}(hjh]hstruct}(hjjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMubj)}(h h]h }(hjjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjjhhhjjhMubh)}(hhh]j)}(h spi_messageh]h spi_message}(hjjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjjubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjjmodnameN classnameNj}j)}j]j)}jyspi_get_next_queued_messagesbc.spi_get_next_queued_messageasbuh1hhjjhhhjjhMubj)}(h h]h }(hjkhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjjhhhjjhMubj)}(hjh]h*}(hjkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjjhhhjjhMubj)}(hspi_get_next_queued_messageh]j)}(hj kh]hspi_get_next_queued_message}(hj/khhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj+kubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjjhhhjjhMubj:)}(h(struct spi_controller *ctlr)h]j@)}(hstruct spi_controller *ctlrh](j)}(hjh]hstruct}(hjJkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFkubj)}(h h]h }(hjWkhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjFkubh)}(hhh]j)}(hspi_controllerh]hspi_controller}(hjhkhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjekubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjjkmodnameN classnameNj}j)}j]j kc.spi_get_next_queued_messageasbuh1hhjFkubj)}(h h]h }(hjkhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjFkubj)}(hjh]h*}(hjkhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjFkubj)}(hctlrh]hctlr}(hjkhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjFkubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjBkubah}(h]h ]h"]h$]h&]j-j.uh1j9hjjhhhjjhMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjjhhhjjhMubah}(h]jjah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjjhMhjjhhubjD)}(hhh]h)}(h-called by driver to check for queued messagesh]h-called by driver to check for queued messages}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjkhhubah}(h]h ]h"]h$]h&]uh1jChjjhhhjjhMubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejkjfjkjgjhjiuh1jhhhhhNhNubjk)}(hX**Parameters** ``struct spi_controller *ctlr`` the controller to check for queued messages **Description** If there are more messages in the queue, the next message is returned from this call. **Return** the next message in the queue, else NULL if the queue is empty.h](h)}(h**Parameters**h]ju)}(hjkh]h Parameters}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjkubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjkubj)}(hhh]j)}(hL``struct spi_controller *ctlr`` the controller to check for queued messages h](j)}(h``struct spi_controller *ctlr``h]h)}(hj lh]hstruct spi_controller *ctlr}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj lubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjlubj)}(hhh]h)}(h+the controller to check for queued messagesh]h+the controller to check for queued messages}(hj%lhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!lhMhj"lubah}(h]h ]h"]h$]h&]uh1jhjlubeh}(h]h ]h"]h$]h&]uh1jhj!lhMhjlubah}(h]h ]h"]h$]h&]uh1jhjkubh)}(h**Description**h]ju)}(hjGlh]h Description}(hjIlhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjElubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjkubh)}(hUIf there are more messages in the queue, the next message is returned from this call.h]hUIf there are more messages in the queue, the next message is returned from this call.}(hj]lhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjkubh)}(h **Return**h]ju)}(hjnlh]hReturn}(hjplhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjllubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjkubh)}(h?the next message in the queue, else NULL if the queue is empty.h]h?the next message in the queue, else NULL if the queue is empty.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjkubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j)spi_finalize_current_message (C function)c.spi_finalize_current_messagehNtauh1jhhhhhNhNubj)}(hhh](j)}(h?void spi_finalize_current_message (struct spi_controller *ctlr)h]j)}(h>void spi_finalize_current_message(struct spi_controller *ctlr)h](j)}(hvoidh]hvoid}(hjlhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjlhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMVubj)}(h h]h }(hjlhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjlhhhjlhMVubj)}(hspi_finalize_current_messageh]j)}(hspi_finalize_current_messageh]hspi_finalize_current_message}(hjlhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjlubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjlhhhjlhMVubj:)}(h(struct spi_controller *ctlr)h]j@)}(hstruct spi_controller *ctlrh](j)}(hjh]hstruct}(hjlhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjlubj)}(h h]h }(hjlhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjlubh)}(hhh]j)}(hspi_controllerh]hspi_controller}(hjmhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj mubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjmmodnameN classnameNj}j)}j]j)}jyjlsbc.spi_finalize_current_messageasbuh1hhjlubj)}(h h]h }(hj.mhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjlubj)}(hjh]h*}(hjabort the ongoing transfer request on an SPI target controllerh]h>abort the ongoing transfer request on an SPI target controller}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMd hjvhhubah}(h]h ]h"]h$]h&]uh1jChjMuhhhjfuhMd ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjej0vjfj0vjgjhjiuh1jhhhhhNhNubjk)}(hQ**Parameters** ``struct spi_device *spi`` device used for the current transferh](h)}(h**Parameters**h]ju)}(hj:vh]h Parameters}(hjjfj>jgjhjiuh1jhhhhhNhNubjk)}(hX**Parameters** ``struct device *dev`` device managing SPI controller ``struct spi_controller *ctlr`` initialized controller, originally from spi_alloc_host() or spi_alloc_target() **Context** can sleep **Description** Register a SPI device as with spi_register_controller() which will automatically be unregistered and freed. **Return** zero on success, else a negative error code.h](h)}(h**Parameters**h]ju)}(hjHh]h Parameters}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjFubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM3 hjBubj)}(hhh](j)}(h6``struct device *dev`` device managing SPI controller h](j)}(h``struct device *dev``h]h)}(hjgh]hstruct device *dev}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjeubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM0 hjaubj)}(hhh]h)}(hdevice managing SPI controllerh]hdevice managing SPI controller}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj|hM0 hj}ubah}(h]h ]h"]h$]h&]uh1jhjaubeh}(h]h ]h"]h$]h&]uh1jhj|hM0 hj^ubj)}(ho``struct spi_controller *ctlr`` initialized controller, originally from spi_alloc_host() or spi_alloc_target() h](j)}(h``struct spi_controller *ctlr``h]h)}(hjh]hstruct spi_controller *ctlr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM2 hjubj)}(hhh]h)}(hNinitialized controller, originally from spi_alloc_host() or spi_alloc_target()h]hNinitialized controller, originally from spi_alloc_host() or spi_alloc_target()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM1 hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM2 hj^ubeh}(h]h ]h"]h$]h&]uh1jhjBubh)}(h **Context**h]ju)}(hj܀h]hContext}(hjހhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjڀubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM4 hjBubh)}(h can sleeph]h can sleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM3 hjBubh)}(h**Description**h]ju)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM5 hjBubh)}(hkRegister a SPI device as with spi_register_controller() which will automatically be unregistered and freed.h]hkRegister a SPI device as with spi_register_controller() which will automatically be unregistered and freed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM4 hjBubh)}(h **Return**h]ju)}(hj*h]hReturn}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj(ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM7 hjBubh)}(h,zero on success, else a negative error code.h]h,zero on success, else a negative error code.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM8 hjBubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&spi_unregister_controller (C function)c.spi_unregister_controllerhNtauh1jhhhhhNhNubj)}(hhh](j)}(hubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhj/hM ubj:)}(h(struct spi_device *spi)h]j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hj^hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjZubj)}(h h]h }(hjkhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjZubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hj|hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjyubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj~modnameN classnameNj}j)}j]j)}jyjDsb c.spi_setupasbuh1hhjZubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjZubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjZubj)}(hspih]hspi}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjZubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjVubah}(h]h ]h"]h$]h&]j-j.uh1j9hjhhhj/hM ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhj/hM ubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj/hM hjhhubjD)}(hhh]h)}(hsetup SPI mode and clock rateh]hsetup SPI mode and clock rate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjމhhubah}(h]h ]h"]h$]h&]uh1jChjhhhj/hM ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejjfjjgjhjiuh1jhhhhhNhNubjk)}(hX**Parameters** ``struct spi_device *spi`` the device whose settings are being modified **Context** can sleep, and no requests are queued to the device **Description** SPI protocol drivers may need to update the transfer mode if the device doesn't work with its default. They may likewise need to update clock rates or word sizes from initial values. This function changes those settings, and must be called from a context that can sleep. Except for SPI_CS_HIGH, which takes effect immediately, the changes take effect the next time the device is selected and data is transferred to or from it. When this function returns, the SPI device is deselected. Note that this call will fail if the protocol driver specifies an option that the underlying controller or its driver does not support. For example, not all hardware supports wire transfers using nine bit words, LSB-first wire encoding, or active-high chipselects. **Return** zero on success, else a negative error code.h](h)}(h**Parameters**h]ju)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh]j)}(hH``struct spi_device *spi`` the device whose settings are being modified h](j)}(h``struct spi_device *spi``h]h)}(hj"h]hstruct spi_device *spi}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubj)}(hhh]h)}(h,the device whose settings are being modifiedh]h,the device whose settings are being modified}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hM hj8ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj7hM hjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h **Context**h]ju)}(hj]h]hContext}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj[ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h3can sleep, and no requests are queued to the deviceh]h3can sleep, and no requests are queued to the device}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h**Description**h]ju)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(hXSPI protocol drivers may need to update the transfer mode if the device doesn't work with its default. They may likewise need to update clock rates or word sizes from initial values. This function changes those settings, and must be called from a context that can sleep. Except for SPI_CS_HIGH, which takes effect immediately, the changes take effect the next time the device is selected and data is transferred to or from it. When this function returns, the SPI device is deselected.h]hXSPI protocol drivers may need to update the transfer mode if the device doesn’t work with its default. They may likewise need to update clock rates or word sizes from initial values. This function changes those settings, and must be called from a context that can sleep. Except for SPI_CS_HIGH, which takes effect immediately, the changes take effect the next time the device is selected and data is transferred to or from it. When this function returns, the SPI device is deselected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(hX Note that this call will fail if the protocol driver specifies an option that the underlying controller or its driver does not support. For example, not all hardware supports wire transfers using nine bit words, LSB-first wire encoding, or active-high chipselects.h]hX Note that this call will fail if the protocol driver specifies an option that the underlying controller or its driver does not support. For example, not all hardware supports wire transfers using nine bit words, LSB-first wire encoding, or active-high chipselects.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h **Return**h]ju)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h,zero on success, else a negative error code.h]h,zero on success, else a negative error code.}(hjЊhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!spi_optimize_message (C function)c.spi_optimize_messagehNtauh1jhhhhhNhNubj)}(hhh](j)}(hJint spi_optimize_message (struct spi_device *spi, struct spi_message *msg)h]j)}(hIint spi_optimize_message(struct spi_device *spi, struct spi_message *msg)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhj hMubj)}(hspi_optimize_messageh]j)}(hspi_optimize_messageh]hspi_optimize_message}(hj hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhj hMubj:)}(h1(struct spi_device *spi, struct spi_message *msg)h](j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hj<hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8ubj)}(h h]h }(hjIhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj8ubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hjZhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjWubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj\modnameN classnameNj}j)}j]j)}jyj"sbc.spi_optimize_messageasbuh1hhj8ubj)}(h h]h }(hjzhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj8ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj8ubj)}(hspih]hspi}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj4ubj@)}(hstruct spi_message *msgh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubh)}(hhh]j)}(h spi_messageh]h spi_message}(hj̋hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjɋubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj΋modnameN classnameNj}j)}j]jvc.spi_optimize_messageasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hmsgh]hmsg}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj4ubeh}(h]h ]h"]h$]h&]j-j.uh1j9hjhhhj hMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhj hMubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj hMhjhhubjD)}(hhh]h)}(h6do any one-time validation and setup for a SPI messageh]h6do any one-time validation and setup for a SPI message}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhj,hhubah}(h]h ]h"]h$]h&]uh1jChjhhhj hMubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejGjfjGjgjhjiuh1jhhhhhNhNubjk)}(hX **Parameters** ``struct spi_device *spi`` the device that will be used for the message ``struct spi_message *msg`` the message to optimize **Description** Peripheral drivers that reuse the same message repeatedly may call this to perform as much message prep as possible once, rather than repeating it each time a message transfer is performed to improve throughput and reduce CPU usage. Once a message has been optimized, it cannot be modified with the exception of updating the contents of any xfer->tx_buf (the pointer can't be changed, only the data in the memory it points to). Calls to this function must be balanced with calls to spi_unoptimize_message() to avoid leaking resources. **Context** can sleep **Return** zero on success, else a negative error codeh](h)}(h**Parameters**h]ju)}(hjQh]h Parameters}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1jthjOubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubj)}(hhh](j)}(hH``struct spi_device *spi`` the device that will be used for the message h](j)}(h``struct spi_device *spi``h]h)}(hjph]hstruct spi_device *spi}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjnubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjjubj)}(hhh]h)}(h,the device that will be used for the messageh]h,the device that will be used for the message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjgubj)}(h4``struct spi_message *msg`` the message to optimize h](j)}(h``struct spi_message *msg``h]h)}(hjh]hstruct spi_message *msg}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh]h)}(hthe message to optimizeh]hthe message to optimize}(hjŒhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjgubeh}(h]h ]h"]h$]h&]uh1jhjKubh)}(h**Description**h]ju)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubh)}(hPeripheral drivers that reuse the same message repeatedly may call this to perform as much message prep as possible once, rather than repeating it each time a message transfer is performed to improve throughput and reduce CPU usage.h]hPeripheral drivers that reuse the same message repeatedly may call this to perform as much message prep as possible once, rather than repeating it each time a message transfer is performed to improve throughput and reduce CPU usage.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubh)}(hOnce a message has been optimized, it cannot be modified with the exception of updating the contents of any xfer->tx_buf (the pointer can't be changed, only the data in the memory it points to).h]hOnce a message has been optimized, it cannot be modified with the exception of updating the contents of any xfer->tx_buf (the pointer can’t be changed, only the data in the memory it points to).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubh)}(hjCalls to this function must be balanced with calls to spi_unoptimize_message() to avoid leaking resources.h]hjCalls to this function must be balanced with calls to spi_unoptimize_message() to avoid leaking resources.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubh)}(h **Context**h]ju)}(hj)h]hContext}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj'ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubh)}(h can sleeph]h can sleep}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubh)}(h **Return**h]ju)}(hjPh]hReturn}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubh)}(h+zero on success, else a negative error codeh]h+zero on success, else a negative error code}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjKubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j#spi_unoptimize_message (C function)c.spi_unoptimize_messagehNtauh1jhhhhhNhNubj)}(hhh](j)}(h5void spi_unoptimize_message (struct spi_message *msg)h]j)}(h4void spi_unoptimize_message(struct spi_message *msg)h](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhjhMubj)}(hspi_unoptimize_messageh]j)}(hspi_unoptimize_messageh]hspi_unoptimize_message}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhjhMubj:)}(h(struct spi_message *msg)h]j@)}(hstruct spi_message *msgh](j)}(hjh]hstruct}(hjҍhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj΍ubj)}(h h]h }(hjߍhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj΍ubh)}(hhh]j)}(h spi_messageh]h spi_message}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjmodnameN classnameNj}j)}j]j)}jyjsbc.spi_unoptimize_messageasbuh1hhj΍ubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj΍ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj΍ubj)}(hmsgh]hmsg}(hj+hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj΍ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjʍubah}(h]h ]h"]h$]h&]j-j.uh1j9hjhhhjhMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhjhMubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjhMhjhhubjD)}(hhh]h)}(h:releases any resources allocated by spi_optimize_message()h]h:releases any resources allocated by spi_optimize_message()}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjRhhubah}(h]h ]h"]h$]h&]uh1jChjhhhjhMubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejmjfjmjgjhjiuh1jhhhhhNhNubjk)}(h**Parameters** ``struct spi_message *msg`` the message to unoptimize **Description** Calls to this function must be balanced with calls to spi_optimize_message(). **Context** can sleeph](h)}(h**Parameters**h]ju)}(hjwh]h Parameters}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjuubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjqubj)}(hhh]j)}(h6``struct spi_message *msg`` the message to unoptimize h](j)}(h``struct spi_message *msg``h]h)}(hjh]hstruct spi_message *msg}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh]h)}(hthe message to unoptimizeh]hthe message to unoptimize}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjqubh)}(h**Description**h]ju)}(hjюh]h Description}(hjӎhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjώubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjqubh)}(hMCalls to this function must be balanced with calls to spi_optimize_message().h]hMCalls to this function must be balanced with calls to spi_optimize_message().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjqubh)}(h **Context**h]ju)}(hjh]hContext}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjqubh)}(h can sleeph]h can sleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjqubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j&devm_spi_optimize_message (C function)c.devm_spi_optimize_messagehNtauh1jhhhhhNhNubj)}(hhh](j)}(hcint devm_spi_optimize_message (struct device *dev, struct spi_device *spi, struct spi_message *msg)h]j)}(hbint devm_spi_optimize_message(struct device *dev, struct spi_device *spi, struct spi_message *msg)h](j)}(hinth]hint}(hj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9hhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMubj)}(h h]h }(hjLhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj9hhhjKhMubj)}(hdevm_spi_optimize_messageh]j)}(hdevm_spi_optimize_messageh]hdevm_spi_optimize_message}(hj^hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjZubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhj9hhhjKhMubj:)}(hE(struct device *dev, struct spi_device *spi, struct spi_message *msg)h](j@)}(hstruct device *devh](j)}(hjh]hstruct}(hjzhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjvubh)}(hhh]j)}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjmodnameN classnameNj}j)}j]j)}jyj`sbc.devm_spi_optimize_messageasbuh1hhjvubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjvubj)}(hjh]h*}(hjƏhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjvubj)}(hdevh]hdev}(hjӏhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjvubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjrubj@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hj hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj modnameN classnameNj}j)}j]jc.devm_spi_optimize_messageasbuh1hhjubj)}(h h]h }(hj(hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hspih]hspi}(hjChhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjrubj@)}(hstruct spi_message *msgh](j)}(hjh]hstruct}(hj\hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjXubj)}(h h]h }(hjihhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjXubh)}(hhh]j)}(h spi_messageh]h spi_message}(hjzhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjwubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj|modnameN classnameNj}j)}j]jc.devm_spi_optimize_messageasbuh1hhjXubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjXubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjXubj)}(hmsgh]hmsg}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjXubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjrubeh}(h]h ]h"]h$]h&]j-j.uh1j9hj9hhhjKhMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hj5hhhjKhMubah}(h]j0ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjKhMhj2hhubjD)}(hhh]h)}(h)managed version of spi_optimize_message()h]h)managed version of spi_optimize_message()}(hjݐhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjڐhhubah}(h]h ]h"]h$]h&]uh1jChj2hhhjKhMubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejjfjjgjhjiuh1jhhhhhNhNubjk)}(hX~**Parameters** ``struct device *dev`` the device that manages **msg** (usually **spi->dev**) ``struct spi_device *spi`` the device that will be used for the message ``struct spi_message *msg`` the message to optimize **Return** zero on success, else a negative error code **Description** spi_unoptimize_message() will automatically be called when the device is removed.h](h)}(h**Parameters**h]ju)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh](j)}(hN``struct device *dev`` the device that manages **msg** (usually **spi->dev**) h](j)}(h``struct device *dev``h]h)}(hjh]hstruct device *dev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh]h)}(h6the device that manages **msg** (usually **spi->dev**)h](hthe device that manages }(hj7hhhNhNubju)}(h**msg**h]hmsg}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj7ubh (usually }(hj7hhhNhNubju)}(h **spi->dev**h]hspi->dev}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj7ubh)}(hj7hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj3hMhj4ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj3hMhjubj)}(hH``struct spi_device *spi`` the device that will be used for the message h](j)}(h``struct spi_device *spi``h]h)}(hj{h]hstruct spi_device *spi}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjyubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjuubj)}(hhh]h)}(h,the device that will be used for the messageh]h,the device that will be used for the message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjuubeh}(h]h ]h"]h$]h&]uh1jhjhMhjubj)}(h4``struct spi_message *msg`` the message to optimize h](j)}(h``struct spi_message *msg``h]h)}(hjh]hstruct spi_message *msg}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh]h)}(hthe message to optimizeh]hthe message to optimize}(hj͑hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjɑhMhjʑubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjɑhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h **Return**h]ju)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubh)}(h+zero on success, else a negative error codeh]h+zero on success, else a negative error code}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h**Description**h]ju)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM!hjubh)}(hQspi_unoptimize_message() will automatically be called when the device is removed.h]hQspi_unoptimize_message() will automatically be called when the device is removed.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_async (C function) c.spi_asynchNtauh1jhhhhhNhNubj)}(hhh](j)}(hCint spi_async (struct spi_device *spi, struct spi_message *message)h]j)}(hBint spi_async(struct spi_device *spi, struct spi_message *message)h](j)}(hinth]hint}(hj[hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjWhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM2ubj)}(h h]h }(hjjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjWhhhjihM2ubj)}(h spi_asynch]j)}(h spi_asynch]h spi_async}(hj|hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjxubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjWhhhjihM2ubj:)}(h5(struct spi_device *spi, struct spi_message *message)h](j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjmodnameN classnameNj}j)}j]j)}jyj~sb c.spi_asyncasbuh1hhjubj)}(h h]h }(hj֒hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hspih]hspi}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjubj@)}(hstruct spi_message *messageh](j)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubh)}(hhh]j)}(h spi_messageh]h spi_message}(hj(hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj%ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj*modnameN classnameNj}j)}j]jҒ c.spi_asyncasbuh1hhjubj)}(h h]h }(hjFhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjThhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hmessageh]hmessage}(hjahhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjubeh}(h]h ]h"]h$]h&]j-j.uh1j9hjWhhhjihM2ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjShhhjihM2ubah}(h]jNah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjihM2hjPhhubjD)}(hhh]h)}(hasynchronous SPI transferh]hasynchronous SPI transfer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM2hjhhubah}(h]h ]h"]h$]h&]uh1jChjPhhhjihM2ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejjfjjgjhjiuh1jhhhhhNhNubjk)}(hX**Parameters** ``struct spi_device *spi`` device with which data will be exchanged ``struct spi_message *message`` describes the data transfers, including completion callback **Context** any (IRQs may be blocked, etc) **Description** This call may be used in_irq and other contexts which can't sleep, as well as from task contexts which can sleep. The completion callback is invoked in a context which can't 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's no longer in use by any SPI core or controller driver code. 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 "hard" access time requirements, for example. 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.) **Return** zero on success, else a negative error code.h](h)}(h**Parameters**h]ju)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM6hjubj)}(hhh](j)}(hD``struct spi_device *spi`` device with which data will be exchanged h](j)}(h``struct spi_device *spi``h]h)}(hj̓h]hstruct spi_device *spi}(hjΓhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjʓubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM3hjƓubj)}(hhh]h)}(h(device with which data will be exchangedh]h(device with which data will be exchanged}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM3hjubah}(h]h ]h"]h$]h&]uh1jhjƓubeh}(h]h ]h"]h$]h&]uh1jhjhM3hjÓubj)}(h\``struct spi_message *message`` describes the data transfers, including completion callback h](j)}(h``struct spi_message *message``h]h)}(hjh]hstruct spi_message *message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM4hjubj)}(hhh]h)}(h;describes the data transfers, including completion callbackh]h;describes the data transfers, including completion callback}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM4hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM4hjÓubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h **Context**h]ju)}(hj@h]hContext}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj>ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM6hjubh)}(hany (IRQs may be blocked, etc)h]hany (IRQs may be blocked, etc)}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM5hjubh)}(h**Description**h]ju)}(hjgh]h Description}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jthjeubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM7hjubh)}(hqThis call may be used in_irq and other contexts which can't sleep, as well as from task contexts which can sleep.h]hsThis call may be used in_irq and other contexts which can’t sleep, as well as from task contexts which can sleep.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM6hjubh)}(hXThe completion callback is invoked in a context which can't 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's no longer in use by any SPI core or controller driver code.h]hXThe completion callback is invoked in a context which can’t 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’s no longer in use by any SPI core or controller driver code.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM9hjubh)}(hNote 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 "hard" access time requirements, for example.h]hNote 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 “hard” access time requirements, for example.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMAhjubh)}(hXwOn 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.)h]hXwOn 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.)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMFhjubh)}(h **Return**h]ju)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMMhjubh)}(h,zero on success, else a negative error code.h]h,zero on success, else a negative error code.}(hjєhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMNhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_sync (C function) c.spi_synchNtauh1jhhhhhNhNubj)}(hhh](j)}(hBint spi_sync (struct spi_device *spi, struct spi_message *message)h]j)}(hAint spi_sync(struct spi_device *spi, struct spi_message *message)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhjhMubj)}(hspi_synch]j)}(hspi_synch]hspi_sync}(hj!hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhjhMubj:)}(h5(struct spi_device *spi, struct spi_message *message)h](j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hj=hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9ubj)}(h h]h }(hjJhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj9ubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hj[hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj]modnameN classnameNj}j)}j]j)}jyj#sb c.spi_syncasbuh1hhj9ubj)}(h h]h }(hj{hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj9ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj9ubj)}(hspih]hspi}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj5ubj@)}(hstruct spi_message *messageh](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubh)}(hhh]j)}(h spi_messageh]h spi_message}(hj͕hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjʕubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjϕmodnameN classnameNj}j)}j]jw c.spi_syncasbuh1hhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hmessageh]hmessage}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj5ubeh}(h]h ]h"]h$]h&]j-j.uh1j9hjhhhjhMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhjhMubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjhMhjhhubjD)}(hhh]h)}(h'blocking/synchronous SPI data transfersh]h'blocking/synchronous SPI data transfers}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhj-hhubah}(h]h ]h"]h$]h&]uh1jChjhhhjhMubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejHjfjHjgjhjiuh1jhhhhhNhNubjk)}(hX**Parameters** ``struct spi_device *spi`` device with which data will be exchanged ``struct spi_message *message`` describes the data transfers **Context** can sleep **Description** This call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. Low-overhead controller drivers may DMA directly into and out of the message buffers. Note that the SPI device's chip select is active during the message, and then is normally disabled between messages. Drivers for some frequently-used devices may want to minimize costs of selecting a chip, by leaving it selected in anticipation that the next message will go to the same chip. (That may increase power usage.) Also, the caller is guaranteeing that the memory associated with the message will not be freed before this call returns. **Return** zero on success, else a negative error code.h](h)}(h**Parameters**h]ju)}(hjRh]h Parameters}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jthjPubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubj)}(hhh](j)}(hD``struct spi_device *spi`` device with which data will be exchanged h](j)}(h``struct spi_device *spi``h]h)}(hjqh]hstruct spi_device *spi}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjoubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjkubj)}(hhh]h)}(h(device with which data will be exchangedh]h(device with which data will be exchanged}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1jhjhMhjhubj)}(h=``struct spi_message *message`` describes the data transfers h](j)}(h``struct spi_message *message``h]h)}(hjh]hstruct spi_message *message}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh]h)}(hdescribes the data transfersh]hdescribes the data transfers}(hjÖhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjhubeh}(h]h ]h"]h$]h&]uh1jhjLubh)}(h **Context**h]ju)}(hjh]hContext}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubh)}(h can sleeph]h can sleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubh)}(h**Description**h]ju)}(hj h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubh)}(hThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. Low-overhead controller drivers may DMA directly into and out of the message buffers.h]hThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. Low-overhead controller drivers may DMA directly into and out of the message buffers.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubh)}(hXGNote that the SPI device's chip select is active during the message, and then is normally disabled between messages. Drivers for some frequently-used devices may want to minimize costs of selecting a chip, by leaving it selected in anticipation that the next message will go to the same chip. (That may increase power usage.)h]hXINote that the SPI device’s chip select is active during the message, and then is normally disabled between messages. Drivers for some frequently-used devices may want to minimize costs of selecting a chip, by leaving it selected in anticipation that the next message will go to the same chip. (That may increase power usage.)}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubh)}(hxAlso, the caller is guaranteeing that the memory associated with the message will not be freed before this call returns.h]hxAlso, the caller is guaranteeing that the memory associated with the message will not be freed before this call returns.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubh)}(h **Return**h]ju)}(hjQh]hReturn}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1jthjOubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubh)}(h,zero on success, else a negative error code.h]h,zero on success, else a negative error code.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjLubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_sync_locked (C function)c.spi_sync_lockedhNtauh1jhhhhhNhNubj)}(hhh](j)}(hIint spi_sync_locked (struct spi_device *spi, struct spi_message *message)h]j)}(hHint spi_sync_locked(struct spi_device *spi, struct spi_message *message)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhjhMubj)}(hspi_sync_lockedh]j)}(hspi_sync_lockedh]hspi_sync_locked}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhjhMubj:)}(h5(struct spi_device *spi, struct spi_message *message)h](j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hjӗhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjϗubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjϗubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjmodnameN classnameNj}j)}j]j)}jyjsbc.spi_sync_lockedasbuh1hhjϗubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjϗubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjϗubj)}(hspih]hspi}(hj,hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjϗubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj˗ubj@)}(hstruct spi_message *messageh](j)}(hjh]hstruct}(hjEhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjAubj)}(h h]h }(hjRhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjAubh)}(hhh]j)}(h spi_messageh]h spi_message}(hjchhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj`ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjemodnameN classnameNj}j)}j]j c.spi_sync_lockedasbuh1hhjAubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjAubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjAubj)}(hmessageh]hmessage}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj˗ubeh}(h]h ]h"]h$]h&]j-j.uh1j9hjhhhjhMubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhjhMubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjhMhjhhubjD)}(hhh]h)}(h,version of spi_sync with exclusive bus usageh]h,version of spi_sync with exclusive bus usage}(hjƘhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjØhhubah}(h]h ]h"]h$]h&]uh1jChjhhhjhMubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejޘjfjޘjgjhjiuh1jhhhhhNhNubjk)}(hX**Parameters** ``struct spi_device *spi`` device with which data will be exchanged ``struct spi_message *message`` describes the data transfers **Context** can sleep **Description** This call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. Low-overhead controller drivers may DMA directly into and out of the message buffers. This call should be used by drivers that require exclusive access to the SPI bus. It has to be preceded by a spi_bus_lock call. The SPI bus must be released by a spi_bus_unlock call when the exclusive access is over. **Return** zero on success, else a negative error code.h](h)}(h**Parameters**h]ju)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh](j)}(hD``struct spi_device *spi`` device with which data will be exchanged h](j)}(h``struct spi_device *spi``h]h)}(hjh]hstruct spi_device *spi}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubj)}(hhh]h)}(h(device with which data will be exchangedh]h(device with which data will be exchanged}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjubj)}(h=``struct spi_message *message`` describes the data transfers h](j)}(h``struct spi_message *message``h]h)}(hj@h]hstruct spi_message *message}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>ubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhj:ubj)}(hhh]h)}(hdescribes the data transfersh]hdescribes the data transfers}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUhMhjVubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhjUhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h **Context**h]ju)}(hj{h]hContext}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjyubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h can sleeph]h can sleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h**Description**h]ju)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(hThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. Low-overhead controller drivers may DMA directly into and out of the message buffers.h]hThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. Low-overhead controller drivers may DMA directly into and out of the message buffers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(hThis call should be used by drivers that require exclusive access to the SPI bus. It has to be preceded by a spi_bus_lock call. The SPI bus must be released by a spi_bus_unlock call when the exclusive access is over.h]hThis call should be used by drivers that require exclusive access to the SPI bus. It has to be preceded by a spi_bus_lock call. The SPI bus must be released by a spi_bus_unlock call when the exclusive access is over.}(hjǙhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h **Return**h]ju)}(hjؙh]hReturn}(hjڙhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj֙ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h,zero on success, else a negative error code.h]h,zero on success, else a negative error code.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_bus_lock (C function)c.spi_bus_lockhNtauh1jhhhhhNhNubj)}(hhh](j)}(h.int spi_bus_lock (struct spi_controller *ctlr)h]j)}(h-int spi_bus_lock(struct spi_controller *ctlr)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM ubj)}(h h]h }(hj,hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhj+hM ubj)}(h spi_bus_lockh]j)}(h spi_bus_lockh]h spi_bus_lock}(hj>hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj:ubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhj+hM ubj:)}(h(struct spi_controller *ctlr)h]j@)}(hstruct spi_controller *ctlrh](j)}(hjh]hstruct}(hjZhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjVubj)}(h h]h }(hjghhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjVubh)}(hhh]j)}(hspi_controllerh]hspi_controller}(hjxhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjuubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjzmodnameN classnameNj}j)}j]j)}jyj@sbc.spi_bus_lockasbuh1hhjVubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjVubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjVubj)}(hctlrh]hctlr}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjVubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjRubah}(h]h ]h"]h$]h&]j-j.uh1j9hjhhhj+hM ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhj+hM ubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj+hM hjhhubjD)}(hhh]h)}(h)obtain a lock for exclusive SPI bus usageh]h)obtain a lock for exclusive SPI bus usage}(hjݚhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjښhhubah}(h]h ]h"]h$]h&]uh1jChjhhhj+hM ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejjfjjgjhjiuh1jhhhhhNhNubjk)}(hX:**Parameters** ``struct spi_controller *ctlr`` SPI bus controller that should be locked for exclusive bus access **Context** can sleep **Description** This call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. This call should be used by drivers that require exclusive access to the SPI bus. The SPI bus must be released by a spi_bus_unlock call when the exclusive access is over. Data transfer must be done by spi_sync_locked and spi_async_locked calls when the SPI bus lock is held. **Return** always zero.h](h)}(h**Parameters**h]ju)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubj)}(hhh]j)}(hb``struct spi_controller *ctlr`` SPI bus controller that should be locked for exclusive bus access h](j)}(h``struct spi_controller *ctlr``h]h)}(hjh]hstruct spi_controller *ctlr}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubj)}(hhh]h)}(hASPI bus controller that should be locked for exclusive bus accessh]hASPI bus controller that should be locked for exclusive bus access}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3hM hj4ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj3hM hjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h **Context**h]ju)}(hjYh]hContext}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jthjWubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubh)}(h can sleeph]h can sleep}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubh)}(h**Description**h]ju)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthj~ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubh)}(hnThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout.h]hnThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM hjubh)}(hXThis call should be used by drivers that require exclusive access to the SPI bus. The SPI bus must be released by a spi_bus_unlock call when the exclusive access is over. Data transfer must be done by spi_sync_locked and spi_async_locked calls when the SPI bus lock is held.h]hXThis call should be used by drivers that require exclusive access to the SPI bus. The SPI bus must be released by a spi_bus_unlock call when the exclusive access is over. Data transfer must be done by spi_sync_locked and spi_async_locked calls when the SPI bus lock is held.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h **Return**h]ju)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubh)}(h always zero.h]h always zero.}(hj̛hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jspi_bus_unlock (C function)c.spi_bus_unlockhNtauh1jhhhhhNhNubj)}(hhh](j)}(h0int spi_bus_unlock (struct spi_controller *ctlr)h]j)}(h/int spi_bus_unlock(struct spi_controller *ctlr)h](j)}(hinth]hint}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM(ubj)}(h h]h }(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhhhj hM(ubj)}(hspi_bus_unlockh]j)}(hspi_bus_unlockh]hspi_bus_unlock}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhjhhhj hM(ubj:)}(h(struct spi_controller *ctlr)h]j@)}(hstruct spi_controller *ctlrh](j)}(hjh]hstruct}(hj8hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubj)}(h h]h }(hjEhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj4ubh)}(hhh]j)}(hspi_controllerh]hspi_controller}(hjVhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjSubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetjXmodnameN classnameNj}j)}j]j)}jyjsbc.spi_bus_unlockasbuh1hhj4ubj)}(h h]h }(hjvhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj4ubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj4ubj)}(hctlrh]hctlr}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj4ubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hj0ubah}(h]h ]h"]h$]h&]j-j.uh1j9hjhhhj hM(ubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjhhhj hM(ubah}(h]jah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhj hM(hjhhubjD)}(hhh]h)}(h,release the lock for exclusive SPI bus usageh]h,release the lock for exclusive SPI bus usage}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM(hjhhubah}(h]h ]h"]h$]h&]uh1jChjhhhj hM(ubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejӜjfjӜjgjhjiuh1jhhhhhNhNubjk)}(hXq**Parameters** ``struct spi_controller *ctlr`` SPI bus controller that was locked for exclusive bus access **Context** can sleep **Description** This call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout. This call releases an SPI bus lock previously obtained by an spi_bus_lock call. **Return** always zero.h](h)}(h**Parameters**h]ju)}(hjݜh]h Parameters}(hjߜhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjۜubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM,hjלubj)}(hhh]j)}(h\``struct spi_controller *ctlr`` SPI bus controller that was locked for exclusive bus access h](j)}(h``struct spi_controller *ctlr``h]h)}(hjh]hstruct spi_controller *ctlr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM)hjubj)}(hhh]h)}(h;SPI bus controller that was locked for exclusive bus accessh]h;SPI bus controller that was locked for exclusive bus access}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM)hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhM)hjubah}(h]h ]h"]h$]h&]uh1jhjלubh)}(h **Context**h]ju)}(hj7h]hContext}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj5ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM+hjלubh)}(h can sleeph]h can sleep}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM*hjלubh)}(h**Description**h]ju)}(hj^h]h Description}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj\ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM,hjלubh)}(hnThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout.h]hnThis call may only be used from a context that may sleep. The sleep is non-interruptible, and has no timeout.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM+hjלubh)}(hOThis call releases an SPI bus lock previously obtained by an spi_bus_lock call.h]hOThis call releases an SPI bus lock previously obtained by an spi_bus_lock call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM.hjלubh)}(h **Return**h]ju)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM1hjלubh)}(h always zero.h]h always zero.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chM2hjלubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j spi_write_then_read (C function)c.spi_write_then_readhNtauh1jhhhhhNhNubj)}(hhh](j)}(hnint spi_write_then_read (struct spi_device *spi, const void *txbuf, unsigned n_tx, void *rxbuf, unsigned n_rx)h]j)}(hmint spi_write_then_read(struct spi_device *spi, const void *txbuf, unsigned n_tx, void *rxbuf, unsigned n_rx)h](j)}(hinth]hint}(hjٝhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj՝hhhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMDubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj՝hhhjhMDubj)}(hspi_write_then_readh]j)}(hspi_write_then_readh]hspi_write_then_read}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubah}(h]h ](j(j)eh"]h$]h&]j-j.uh1jhj՝hhhjhMDubj:)}(hV(struct spi_device *spi, const void *txbuf, unsigned n_tx, void *rxbuf, unsigned n_rx)h](j@)}(hstruct spi_device *spih](j)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hj#hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubh)}(hhh]j)}(h spi_deviceh]h spi_device}(hj4hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&] refdomainhreftypejy reftargetj6modnameN classnameNj}j)}j]j)}jyjsbc.spi_write_then_readasbuh1hhjubj)}(h h]h }(hjThhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjbhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hspih]hspi}(hjohhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjubj@)}(hconst void *txbufh](j)}(hjFh]hconst}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(htxbufh]htxbuf}(hj̞hhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjubj@)}(h unsigned n_txh](j)}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hn_txh]hn_tx}(hjhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjubj@)}(h void *rxbufh](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hj(hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubj)}(hjh]h*}(hj6hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(hrxbufh]hrxbuf}(hjChhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjubj@)}(h unsigned n_rxh](j)}(hunsignedh]hunsigned}(hj\hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjXubj)}(h h]h }(hjjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjXubj)}(hn_rxh]hn_rx}(hjxhhhNhNubah}(h]h ]j!ah"]h$]h&]uh1jhjXubeh}(h]h ]h"]h$]h&]noemphj-j.uh1j?hjubeh}(h]h ]h"]h$]h&]j-j.uh1j9hj՝hhhjhMDubeh}(h]h ]h"]h$]h&]j-j.j5uh1jj6j7hjѝhhhjhMDubah}(h]j̝ah ](j;j<eh"]h$]h&]j@jA)jBhuh1jhjhMDhjΝhhubjD)}(hhh]h)}(h&SPI synchronous write followed by readh]h&SPI synchronous write followed by read}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMDhjhhubah}(h]h ]h"]h$]h&]uh1jChjΝhhhjhMDubeh}(h]h ](hfunctioneh"]h$]h&]jdhjejjfjjgjhjiuh1jhhhhhNhNubjk)}(hXJ**Parameters** ``struct spi_device *spi`` device with which data will be exchanged ``const void *txbuf`` data to be written (need not be DMA-safe) ``unsigned n_tx`` size of txbuf, in bytes ``void *rxbuf`` buffer into which data will be read (need not be DMA-safe) ``unsigned n_rx`` size of rxbuf, in bytes **Context** can sleep **Description** This performs a half duplex MicroWire style transaction with the device, sending txbuf and then reading rxbuf. The return value is zero for success, else a negative errno status code. This call may only be used from a context that may sleep. Parameters to this routine are always copied using a small buffer. Performance-sensitive or bulk transfer code should instead use spi_{async,sync}() calls with DMA-safe buffers. **Return** zero on success, else a negative error code.h](h)}(h**Parameters**h]ju)}(hjğh]h Parameters}(hjƟhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjŸubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMHhjubj)}(hhh](j)}(hD``struct spi_device *spi`` device with which data will be exchanged h](j)}(h``struct spi_device *spi``h]h)}(hjh]hstruct spi_device *spi}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMEhjݟubj)}(hhh]h)}(h(device with which data will be exchangedh]h(device with which data will be exchanged}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMEhjubah}(h]h ]h"]h$]h&]uh1jhjݟubeh}(h]h ]h"]h$]h&]uh1jhjhMEhjڟubj)}(h@``const void *txbuf`` data to be written (need not be DMA-safe) h](j)}(h``const void *txbuf``h]h)}(hjh]hconst void *txbuf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMFhjubj)}(hhh]h)}(h)data to be written (need not be DMA-safe)h]h)data to be written (need not be DMA-safe)}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1hMFhj2ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj1hMFhjڟubj)}(h*``unsigned n_tx`` size of txbuf, in bytes h](j)}(h``unsigned n_tx``h]h)}(hjUh]h unsigned n_tx}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjSubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMGhjOubj)}(hhh]h)}(hsize of txbuf, in bytesh]hsize of txbuf, in bytes}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjjhMGhjkubah}(h]h ]h"]h$]h&]uh1jhjOubeh}(h]h ]h"]h$]h&]uh1jhjjhMGhjڟubj)}(hK``void *rxbuf`` buffer into which data will be read (need not be DMA-safe) h](j)}(h``void *rxbuf``h]h)}(hjh]h void *rxbuf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMHhjubj)}(hhh]h)}(h:buffer into which data will be read (need not be DMA-safe)h]h:buffer into which data will be read (need not be DMA-safe)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMHhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjhMHhjڟubj)}(h*``unsigned n_rx`` size of rxbuf, in bytes h](j)}(h``unsigned n_rx``h]h)}(hjǠh]h unsigned n_rx}(hjɠhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjŠubah}(h]h ]h"]h$]h&]uh1jhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMIhjubj)}(hhh]h)}(hsize of rxbuf, in bytesh]hsize of rxbuf, in bytes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjܠhMIhjݠubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjܠhMIhjڟubeh}(h]h ]h"]h$]h&]uh1jhjubh)}(h **Context**h]ju)}(hjh]hContext}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jthjubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMKhjubh)}(h can sleeph]h can sleep}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMJhjubh)}(h**Description**h]ju)}(hj)h]h Description}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jthj'ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMLhjubh)}(hThis performs a half duplex MicroWire style transaction with the device, sending txbuf and then reading rxbuf. The return value is zero for success, else a negative errno status code. This call may only be used from a context that may sleep.h]hThis performs a half duplex MicroWire style transaction with the device, sending txbuf and then reading rxbuf. The return value is zero for success, else a negative errno status code. This call may only be used from a context that may sleep.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMKhjubh)}(hParameters to this routine are always copied using a small buffer. Performance-sensitive or bulk transfer code should instead use spi_{async,sync}() calls with DMA-safe buffers.h]hParameters to this routine are always copied using a small buffer. Performance-sensitive or bulk transfer code should instead use spi_{async,sync}() calls with DMA-safe buffers.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMPhjubh)}(h **Return**h]ju)}(hj_h]hReturn}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jthj]ubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMThjubh)}(h,zero on success, else a negative error code.h]h,zero on success, else a negative error code.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhP/var/lib/git/docbuild/linux/Documentation/driver-api/spi:52: ./drivers/spi/spi.chMUhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jjhhhhhNhNubeh}(h]serial-peripheral-interface-spiah ]h"]!serial peripheral interface (spi)ah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjK<footnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}jjs nametypes}jsh}(jhjjjjjj j j jjjjjjjC&jH&j'j'jA1jF1j5j5je8jj8j:j:j=j=jO@jT@jBjBjEjEjHjHjKjKj0Nj5NjPjPjSjSj Vj%VjXjXjZjZj\j]j^j^jZaj_ajbjbj\djadjgjgjjjjjljlj'nj,njpjpjrj rjKujPujvjvjyjyj|j}j~j~jbjgj(j-jj#jjjjjjj0j5jNjSjjjjjjjjj̝jѝu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.