cancel
Showing results for 
Search instead for 
Did you mean: 

AIS2IH - iio driver linking with linux env

DhanushKumar__
Associate

Hey,

I have been using the AIS2IH accelerometer senson in my TI's am652 linux based board.
i found the linux iio driver for this in the github of ST.

click to view the supported driver for ais2ih.

Click to view the driver files (named as lis2dw12). 

i copied the files (lis2dw12.h,lis2dw12_core.c,lis2dw12_spi.c,lis2dw12.i2c,lis2dw12_buffer.c,lis2dw12_embfunc.c) to my linux (drivers/iio) directory. i created Kconfig and Makefile and also defined in the devicetree and in defconfig and built an image in jenkins and the image built was success without any errors.

but the module file for the ais2ih is not present in the linux board in /lib/modules/<username>/kernel/drivers/iio  inside this in accel folder i have all the driver files but the accel folder itself missing and i dont know how to make that accel folder to show up.

can you give me a solution to add this driver to my linux environment board so that i can make ais2ih sensor to work.

give me a complete solution asap.

Thank you.

Kconfig

 

 

 

config IIO_ST_LIS2DW12
	tristate "STMicroelectronics LIS2DW12/IIS2DLPC/AIS2IH Accelerometer Driver"
	depends on (I2C || SPI)
	select IIO_BUFFER
	select IIO_KFIFO_BUF
	select IIO_ST_LIS2DW12_I2C if (I2C)
	select IIO_ST_LIS2DW12_SPI if (SPI)
	help
	  Say yes here to build support for the LIS2DW12, IIS2DLPC and AIS2IH accelerometer.

	  This driver can also be built as a module. If so, will be created
	  these modules:
	  - st_lis2dw12 (core functions for the driver [it is mandatory]);
	  - st_lis2dw12_i2c (necessary for the I2C devices [optional*]);
	  - st_lis2dw12_spi (necessary for the SPI devices [optional*]);

	  (*) one of these is necessary to do something.

config IIO_ST_LIS2DW12_I2C
	tristate
	depends on IIO_ST_LIS2DW12
	depends on I2C

config IIO_ST_LIS2DW12_SPI
	tristate
	depends on IIO_ST_LIS2DW12
	depends on SPI

config IIO_ST_LIS2DW12_EN_BASIC_FEATURES
        bool "Enable internal basic features event detection"
        depends on IIO_ST_LIS2DW12
        help
         Enable internal event detection features like: wake-up, tap and double
         tap. If this feature is enabled it is necessary to extend the
         iio_chan_type_name_spec array in industrialio-core.c by adding the
         custom sensor-types used by this driver.

 

 

 

Makefile

 

 

 

obj-$(CONFIG_IIO_ST_LIS2DW12) += st_lis2dw12.o
st_lis2dw12-y:= st_lis2dw12_core.o st_lis2dw12_buffer.o
st_lis2dw12-$(CONFIG_IIO_ST_LIS2DW12_EN_BASIC_FEATURES) += st_lis2dw12_embfunc.o

obj-$(CONFIG_IIO_ST_LIS2DW12_I2C) += st_lis2dw12_i2c.o
obj-$(CONFIG_IIO_ST_LIS2DW12_SPI) += st_lis2dw12_spi.o

 

 

 

 Device tree 

 

 

 

&main_i2c2 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&main_i2c2_pins_default>;
	clock-frequency = <400000>;

      	temp@4a {
        	compatible = "ti,tmp100";
        	reg = <0x4a>;
        	vs-supply = <&vcc_3v3_sys>;
      	};

	ina231@40 {
        	compatible = "ti,ina231";
        	reg = <0x40>;
    	};

	ais2ih-accel@19 {
        	compatible = "st,lis2dw12", "st,ais2ih";
        	reg = <0x19>;
        	st,drdy-int-pin = <1>;
        	wakeup-source;
	};

};

 

 

 

 Defconfig

 

 

 

# Accelerometers
#
# CONFIG_ADIS16203 is not set
# CONFIG_ADIS16240 is not set
CONFIG_IIO_ST_LIS2DW12=y
CONFIG_IIO_ST_LIS2DW12_I2C=y
CONFIG_IIO_ST_LIS2DW12_SPI=y
# end of Accelerometers

 

 

 

0 REPLIES 0