pm: fix calculation of maximum of two frequencies
pm: fix calculation of maximum of two frequencies

The old code calculated MAX() of two enum values, but CPU frequency
enum values are not ordered (2MHz goes after 240MHz). This caused
incorrect configuration to be set.

mashaoze/esp-idf,espressif/esp-idf,armada-ai/esp-idf,www220/esp-idf,armada-ai/esp-idf,mashaoze/esp-idf,www220/esp-idf,mashaoze/esp-idf,www220/esp-idf,www220/esp-idf,espressif/esp-idf,espressif/esp-idf,armada-ai/esp-idf,mashaoze/esp-idf,espressif/esp-idf,www220/esp-idf,armada-ai/esp-idf,mashaoze/esp-idf