'\" t .\" Title: spi_register_master .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Serial Peripheral Interface (SPI) .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "SPI_REGISTER_MASTER" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Serial Peripheral Interface (S" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" spi_register_master \- register SPI master controller .SH "SYNOPSIS" .HP \w'int\ spi_register_master('u .BI "int spi_register_master(struct\ spi_master\ *\ " "master" ");" .SH "ARGUMENTS" .PP \fImaster\fR .RS 4 initialized master, originally from \fBspi_alloc_master\fR .RE .SH "CONTEXT" .PP can sleep .SH "DESCRIPTION" .PP SPI master controllers connect to their drivers using some non\-SPI bus, such as the platform bus\&. The final stage of \fBprobe\fR in that code includes calling \fBspi_register_master\fR to hook up to this SPI bus glue\&. .PP SPI controllers use board specific (often SOC specific) bus numbers, and board\-specific addressing for SPI devices combines those numbers with chip select numbers\&. Since SPI does not directly support dynamic device identification, boards need configuration tables telling which chip is at which address\&. .PP This must be called from context that can sleep\&. It returns zero on success, else a negative error code (dropping the master\*(Aqs refcount)\&. After a successful return, the caller is responsible for calling \fBspi_unregister_master\fR\&. .SH "RETURN" .PP zero on success, else a negative error code\&. .SH "COPYRIGHT" .br