* This function will update the system clock frequency when idle */
| 170 | * This function will update the system clock frequency when idle |
| 171 | */ |
| 172 | static void _pm_frequency_scaling(struct rt_pm *pm) |
| 173 | { |
| 174 | rt_base_t level = 0; |
| 175 | |
| 176 | if (pm->flags & RT_PM_FREQUENCY_PENDING) |
| 177 | { |
| 178 | level = rt_hw_interrupt_disable(); |
| 179 | /* change system runing mode */ |
| 180 | if(pm->ops->run != RT_NULL) |
| 181 | { |
| 182 | pm->ops->run(pm, pm->run_mode); |
| 183 | } |
| 184 | /* changer device frequency */ |
| 185 | _pm_device_frequency_change(pm->run_mode); |
| 186 | pm->flags &= ~RT_PM_FREQUENCY_PENDING; |
| 187 | rt_hw_interrupt_enable(level); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * judge sleep mode from sleep request |
no test coverage detected