/* Manages the sleep mode following the UHP state.  */
static void uhd_sleep_mode(enum uhd_uhp_state_enum new_state)
/* Manages the sleep mode following the UHP state.  */
static void uhd_sleep_mode(enum uhd_uhp_state_enum new_state)
{
	enum sleepmgr_mode sleep_mode[] = {
		SLEEPMGR_ACTIVE,
		SLEEPMGR_ACTIVE,
		SLEEPMGR_ACTIVE,
		SLEEPMGR_ACTIVE,
		SLEEPMGR_ACTIVE,
		SLEEPMGR_ACTIVE,
	};
	static enum uhd_uhp_state_enum uhd_state = UHD_STATE_OFF;
	if (uhd_state == new_state) {
		return;
	}
	if (new_state != UHD_STATE_OFF) {
		sleepmgr_lock_mode(sleep_mode[new_state]);
	}
	if (uhd_state != UHD_STATE_OFF) {
		sleepmgr_unlock_mode(sleep_mode[uhd_state]);
	}
	uhd_state = new_state;
}