Notice that we have set the pin to active low to make sure that CS is low when the SPI device is selected. Now we can configure the SPI port: struct spi_config config; struct spi_cs_control cs_ctrl = ...