I got a adafruit BME280 sensor board and I wired it to the raspberry pi zero via spi. According to the datasheet I can read sensor data from the device via the userspace spi interface. Everything works fine from userspace.
I discovered, that there is a kernel module for this sensor available utilizing the iio subsystem. And it implements the algorithms from the datasheet. A naive modprobe bcmp280_spi
loaded the module:
# lsmod
Module Size Used by
bmp280_spi 3451 0
bmp280 11976 1 bmp280_spi
industrialio 50711 1 bmp280
spidev 7034 0
...
But there is nothing to interface with:
# tree /sys/bus/iio/
/sys/bus/iio/
|-- devices
|-- drivers
|-- drivers_autoprobe
|-- drivers_probe
`-- uevent
2 directories, 3 files
Could someone help me with setting up the BMP280 SPI Kernel Module for the raspberry pi zero? I guess I need a device tree overlay, but I can't find any documentation how to interface this sensor module correctly. The raspberry pi includes a configuration for i2c but I want to use spi.