MPU-9250 sensor as i2c slave to Ixora Apalis iMX6

Hi,

I want to interface MPU-9250 to Apalis iMX6Q/Ixora board as an I2C slave…

Please help me to configure new I2C slave;

1.Is there ready-made driver code available?

2.What changes needs to be done in kernel and dts file for device detection and communication?

Thanks and regards,

Suju

I want to interface MPU-9250 to Apalis iMX6Q/Ixora board as an I2C slave…

Please help me to configure new I2C slave;

1.Is there ready-made driver code available?

While our BSP does not contain any such driver code you may find some ready-made Linux driver in some Android sources e.g. here which could probably easily be ported.

2.What changes needs to be done in kernel and dts file for device detection and communication?

Have a look at the following Stack Overflow discussion about this topic.

thanks for the quick reply.

Even i was referring the same thread.

As mentioned in the linkredme Board File Modifications for Secondary I2C Configuration is

necessary, so which is our board file? where it is located?

Regards,
Suju

In kernel there is already driver source code for MPU-6050 device;

drivers/iio/imu/inv_mpu6050/

Can i reuse mpu6050 driver source code and modify it for mpu9250 ??

if so what changes needs to be done?

Regards,

Suju

You can refer the datasheet of mpu9250 and mpu6050 along with the existing code and decide what changes to make if any required.

As per the above link MPU9250 driver ported to linux kernel, now how to test the device?

If all the required changes are correctly made, the device should be accessible through /sys/bus/iio as is applicable for all devices covered by Industrial IO subsystem. There seems to be no device tree binding documentation for the MPU6050 either here or here.