Fix sleep issie: allow using IMU polling interface in bmi323-imu too

This commit is contained in:
Denis 2024-01-15 03:43:35 +01:00
parent c8e81eb272
commit 8c8a488466
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03
6 changed files with 16 additions and 1 deletions

View file

@ -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);

View file

@ -15,4 +15,5 @@ swap_y_z = true;
enable_thermal_profiles_switching = true;
default_thermal_profile = -1;
enable_leds_commands = true;
enable_imu = true;
enable_imu = true;
imu_polling_interface = true;

1
main.c
View file

@ -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);

View file

@ -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;

View file

@ -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:

View file

@ -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);