diff --git a/allynone.c b/allynone.c index 304cf61..991e3a8 100644 --- a/allynone.c +++ b/allynone.c @@ -26,6 +26,7 @@ int main(int argc, char ** argv) { .default_thermal_profile = -1, .enable_leds_commands = false, .enable_imu = true, + .imu_polling_interface = true, }; load_in_config(&in_settings, configuration_file); diff --git a/config.cfg.default b/config.cfg.default index 2d8ffe9..282f30b 100644 --- a/config.cfg.default +++ b/config.cfg.default @@ -15,4 +15,5 @@ swap_y_z = true; enable_thermal_profiles_switching = true; default_thermal_profile = -1; enable_leds_commands = true; -enable_imu = true; \ No newline at end of file +enable_imu = true; +imu_polling_interface = true; \ No newline at end of file diff --git a/main.c b/main.c index 17d94a4..9446964 100644 --- a/main.c +++ b/main.c @@ -25,6 +25,7 @@ int main(int argc, char ** argv) { .default_thermal_profile = -1, .enable_leds_commands = false, .enable_imu = true, + .imu_polling_interface = true, }; load_in_config(&in_settings, configuration_file); diff --git a/rog_ally.c b/rog_ally.c index 9201b22..f33e056 100644 --- a/rog_ally.c +++ b/rog_ally.c @@ -2046,6 +2046,10 @@ input_dev_composite_t* rog_ally_device_def(const dev_in_settings_t *const conf) if ((bmc15_timer_data.name != NULL) && (strcmp(bmc15_timer_data.name, "bmi323"))) { printf("Old bmc150-accel-i2c for bmi323 device has been selected! Are you running a neptune kernel?\n"); rc71l_composite.dev[rc71l_composite.dev_count++] = &bmc150_timer_dev; + } else if ((conf->imu_polling_interface)) { + if (bmc15_timer_data.name != NULL) { + printf("Forced polling on a %s, suspend/resume issues?\n", bmc15_timer_data.name); + } } else { printf("Using the newer upstreamed bmi323-imu driver\n"); rc71l_composite.dev[rc71l_composite.dev_count++] = &in_iio_dev; diff --git a/settings.c b/settings.c index 3a8da9d..77b2784 100644 --- a/settings.c +++ b/settings.c @@ -83,6 +83,13 @@ void load_in_config(dev_in_settings_t *const out_conf, const char* const filepat fprintf(stderr, "enable_imu (bool) configuration not found. Default value will be used.\n"); } + int imu_polling_interface; + if (config_lookup_bool(&cfg, "imu_polling_interface", &imu_polling_interface) != CONFIG_FALSE) { + out_conf->imu_polling_interface = imu_polling_interface; + } else { + fprintf(stderr, "imu_polling_interface (bool) configuration not found. Default value will be used.\n"); + } + config_destroy(&cfg); load_in_config_err: diff --git a/settings.h b/settings.h index 5576d54..0d66409 100644 --- a/settings.h +++ b/settings.h @@ -12,6 +12,7 @@ typedef struct dev_in_settings { int default_thermal_profile; bool enable_leds_commands; bool enable_imu; + bool imu_polling_interface; } dev_in_settings_t; void load_in_config(dev_in_settings_t *const out_conf, const char* const filepath);