Hello, starting from standard kernel module from MangoH (here is original code), I'm tring to enable both INTerrupts of BMI160, INT1 must signal anymotion/significant motion INT2 must signal Step Detect I've added parts in bold to following code, but it seems not working.. someone maybe already done and can help. Regads, Gian static int bmi160_setup_sigmot_int(struct bmi160_data *data) { int ret = 0; Route any motion/significant motion interrupt to int1 ret = regmap_write( data->regmap, BMI160_REG_INT_MAP_0, BMI160_INT_MAP_0_INT1_ANYM_SIGMOT); //route anymotion to INT1 if (ret < 0) return ret; ret = regmap_write( data->regmap, BMI160_REG_INT_MAP_1, 0); if (ret < 0) return ret; //Route Single Tap interrupt to int2 ret = regmap_write( data->regmap, BMI160_REG_INT_MAP_2, BMI160_INT_MAP_2_INT2_STAP); //route single tap to INT2 if (ret < 0) return ret; ret = regmap_write( data->regmap, BMI160_REG_INT_LATCH, (FIELD_PREP(BMI160_INT_LATCH_MODE, BMI160_INT_LATCH_MODE_TMP_2560_MS))); if (ret < 0) return ret; //Enable edge interrupt on INT1 pin ret = regmap_write( data->regmap, BMI160_REG_INT_OUT_CTRL, (BMI160_INT_OUT_CTRL_INT1_EDGE | BMI160_INT_OUT_CTRL_INT1_LVL | BMI160_INT_OUT_CTRL_INT1_OUTPUT_EN)); if (ret < 0) return ret; // Enable edge interrupt on INT2 pin ret = regmap_write( data->regmap, BMI160_REG_INT_OUT_CTRL, (BMI160_INT_OUT_CTRL_INT2_EDGE | BMI160_INT_OUT_CTRL_INT2_LVL | BMI160_INT_OUT_CTRL_INT2_OUTPUT_EN)); if (ret < 0) return ret; ret = regmap_write( data->regmap, BMI160_REG_INT_EN_0, (BMI160_INT_EN_0_ANYM_X| BMI160_INT_EN_0_ANYM_Y| BMI160_INT_EN_0_ANYM_Z)); if (ret < 0) return ret; return ret; }
... View more