2016-08-29 11:03 AM
We have an LIS2DH accelerometer on our board which is running linux 4.1 kernel connected by I2C and I'm trying to get it to work but have had no luck.
Here is what I did:I got the linux driver from here: http://www.st.com/content/st_com/en/products/embedded-software/mems-and-sensors-software/drivers-for-mems/stsw-mems021.htmlAdded lis2dh.h to /include/linux/inputAdded lis2dh_acc.c to /drivers/input/miscAdded this to /drivers/input/misc/Makefile:obj-$(CONFIG_INPUT_LIS2DH) += lis2dh_acc.oIn /drivers/input/misc/Kconfig+config INPUT_LIS2DH+ tristate ''STMicroelectronics LIS2DH''+ depends on INPUT+ help+ Say Y here to enable STMicroelectronics LIS2DH accelerometer module.in the kernel .config file:+CONFIG_INPUT_MISC=y+CONFIG_INPUT_LIS2DH=mIt compiles fine, but when I load it as a module in the running kernel all it does it print the debug message in the driver init function and nothing more. The probe function is never called....What am I missing? #lis2dh #accelerometer