SPI slave de­vice cre­ation by SPI frame­work

OpenSource For You - - LET'S TRY DEVELOPERS -

Af­ter the board driver and PCI driver have reg­is­tered flash in­for­ma­tion (SPI slave de­vice in­for­ma­tion) and have cre­ated and reg­is­tered the SPI mas­ter, the SPI frame­work cre­ates slave SPI de­vices. The slave SPI de­vices are rep­re­sented by struct spi_de­vice.

Dur­ing spi_reg­is­ter_­mas­ter ex­e­cu­tion, the SPI frame­work checks if there is any SPI slave de­vice that is hooked to the same bus num­ber reg­is­tered by the SPI mas­ter. If such a de­vice is found, the SPI frame­work cre­ates slave SPI de­vices and reg­is­ters those de­vices with the de­vice sub­sys­tem. This is done by a call to spi_­match_­mas­ter_­to_board­info() func­tion (from spi_reg­is­ter_­mas­ter func­tion).

SPI slave de­vices can be cre­ated by the SPI frame­work in the fol­low­ing way:

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.