I am using BMC150 magnetometer sensor on Hikey 620. I had success through I2C, but having difficulty with SPI (Driver located here : bmc150_magn_spi.c - drivers/iio/magnetometer/bmc150_magn_spi.c - Linux source code (v5.15.12) - Bootlin) .
I have enabled
CONFIG_SPI=y
CONFIG_sPI_MASTER=y
CONFIG_SPI_DESIGNWARE=y
CONFIG_SPI_DW_PCI=y
CONFIG_SPI_DW_MMIO=y
CONFIG_SPI_PL022=y
CONFIG_SPI_SPIDEV=y
and
CONFIG_BMC150_MAGN=m
CONFIG_BMC150_MAGN_SPI=m
in the kernel config.
and did the following change in device tree
spi0: spi@f7106000 {
status = "ok";
+
+ magn@0 {
+ compatible = "spidev";
+ spi-max-frequency = <500000>;
+ reg=<0>;
+ status = "ok";
+ };
};
But still I do not see the sensor modules getting loaded (even when I set compatible string as “bmc150”). I though see the following (when compatible string is set to “spidev”).
/ # ls /dev/spidev0.0 -la
crw------- 1 0 0 153, 0 Jan 1 00:00 /dev/spidev0.0
Please guide. I am using kernel 4.15.3 forked from https://github.com/suihkulokki/linux