The required header for SPI stuff in the Linux kernel is <linux/spi/spi.h>. Before talking about the driver structure, let's see how SPI devices are defined in the kernel. An SPI device is represented in the kernel as an instance of spi_device. The instance of the driver that manages them is the struct spi_driver structure.
The driver architecture
The device structure
The struct spi_device structure represents an SPI device, and is defined in include/linux/spi/spi.h:
struct spi_device { struct devicedev; struct spi_master*master; u32 max_speed_hz; u8 chip_select; u8 bits_per_word; u16 mode; int irq; [...] int cs_gpio; /* chip select gpio */ };
Some fields...