fix(MP/kernel): period is only over 0
This commit is contained in:
@@ -37,12 +37,17 @@ static uint32_t cb_get_period(void) {
|
|||||||
return current_period;
|
return current_period;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cb_set_period(uint32_t freq) {
|
static void cb_set_period(uint32_t period_ms) {
|
||||||
/* Allow period changes only in Manual mode */
|
/* Allow period changes only in Manual mode */
|
||||||
if (current_mode == 0) {
|
if (current_mode == 0) {
|
||||||
current_period = freq;
|
if (period_ms > 0) {
|
||||||
regulator_cbs.adjust_period(current_period);
|
current_period = period_ms;
|
||||||
pr_info("regulator: Manual period set to %u ms\n", current_period);
|
regulator_cbs.adjust_period(current_period);
|
||||||
|
pr_info("regulator: Manual period set to %u ms\n", current_period);
|
||||||
|
} else {
|
||||||
|
pr_warn("regulator: Period must be greater than 0\n");
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
pr_warn("regulator: Cannot set period manually in auto mode\n");
|
pr_warn("regulator: Cannot set period manually in auto mode\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user