Esempio n. 1
0
void cpufreq_restore_default_governor(void)
{
	cpufreq_set_governor(cpufreq_gov_default);
}
Esempio n. 2
0
void cpufreq_set_conservative_governor(void)
{
	cpufreq_set_governor(cpufreq_gov_conservative);
}
Esempio n. 3
0
void internal_set_pm_features(int ac_status)
{
  static int noflushd    = -1;

  if (fast_charge_mode) ac_status=0;
  if (ac_status)
  { /* we are on AC power */
    /* Stop noflushd damon (disable HD spindown) */
    if (use_noflushd && noflushd)
    {
      system("/etc/init.d/noflushd stop >/dev/null 2>/dev/null");
      noflushd = 0;
    }

		/* Set CPU governor to 'performance' (or whatever our master chose when online) */
		if (use_cpufreq)
			if (!cpufreq_set_governor(cpufreq_online_governor))
				fprintf(stderr, "failed setting '%s' CPUfreq governor!\n", cpufreq_online_governor);

    if (machine == COMPAL)
    {
      /* Set LCD to maximum brightness */
			compal_set_lcd_brightness(COMPAL_LCD_MAX);
    }
    if (machine == TOSHIBA)
    {
      /* Set LCD to maximum brightness */
			toshiba_set_lcd_brightness(TOSHIBA_LCD_MAX, use_toshiba_hardware);
      /* Start fan */
      if (use_toshiba_hardware && (pm_type != PM_ACPI)) toshiba_set_fan_status(1);
      return;
    }
    if (pm_type == PM_ACPI)
    {
      /* Set generic ACPI features here... */
      return;
    }
  }
  else
  { /* we are on battery power */
    if (use_noflushd && (!noflushd || noflushd == -1))
    {
      /* Start noflushd damon (enable HD spindown) */
      system("/etc/init.d/noflushd start >/dev/null 2>/dev/null");
      noflushd = 1;
    }
		/* Set CPU governor to 'ondemand' (or whatever our master chose when offline) */
		if (use_cpufreq)
			if (!cpufreq_set_governor(cpufreq_offline_governor))
				fprintf(stderr, "failed setting '%s' CPUfreq governor!\n", cpufreq_offline_governor);

    if (machine == COMPAL)
    {
      /* Set LCD to minimum brightness */
			compal_set_lcd_brightness(COMPAL_LCD_MIN);
    }
    if (machine == TOSHIBA)
    {
      /* Set LCD to minimum brightness */
			toshiba_set_lcd_brightness(TOSHIBA_LCD_MIN, use_toshiba_hardware);
      /* Stop fan */
      if (use_toshiba_hardware && (pm_type != PM_ACPI)) toshiba_set_fan_status(0);
      return;
    }
    if (pm_type == PM_ACPI)
    {
      /* Set generic ACPI features here... */
      return;
    }
  }

}