/* ladder_enable_device - setup for the governor @dev: the CPU  */
static int ladder_enable_device(struct cpuidle_device *dev)
/* ladder_enable_device - setup for the governor @dev: the CPU  */
static int ladder_enable_device(struct cpuidle_device *dev)
{
	int i;
	struct ladder_device *ldev = &per_cpu(ladder_devices, dev->cpu);
	struct ladder_device_state *lstate;
	struct cpuidle_state *state;
	ldev->last_state_idx = CPUIDLE_DRIVER_STATE_START;
	for (i = 0; i < dev->state_count; i++) {
		state = &dev->states[i];
		lstate = &ldev->states[i];
		lstate->stats.promotion_count = 0;
		lstate->stats.demotion_count = 0;
		lstate->threshold.promotion_count = PROMOTION_COUNT;
		lstate->threshold.demotion_count = DEMOTION_COUNT;
		if (i < dev->state_count - 1)
			lstate->threshold.promotion_time = state->exit_latency;
		if (i > 0)
			lstate->threshold.demotion_time = state->exit_latency;
	}
	return 0;
}