How to write a Linux kernel device driver for custom hardware (I2C/SPI/GPIO)?
Q: How to write a Linux kernel device driver for custom hardware (I2C/SPI/GPIO)? Answer For I2C/SPI kernel drivers: use the Linux kernel subsystem APIs. I2C: implement struct i2c_device_id table and probe()/remove() functions using i2c_master_send()/i2c_master_recv(). SPI: use struct spi_device with spi_write_then_read()…
