speedstep-lib.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
  4. *
  5. * Library for common functions for Intel SpeedStep v.1 and v.2 support
  6. *
  7. * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous*
  8. */
  9. /* processors */
  10. enum speedstep_processor {
  11. SPEEDSTEP_CPU_PIII_C_EARLY = 0x00000001, /* Coppermine core */
  12. SPEEDSTEP_CPU_PIII_C = 0x00000002, /* Coppermine core */
  13. SPEEDSTEP_CPU_PIII_T = 0x00000003, /* Tualatin core */
  14. SPEEDSTEP_CPU_P4M = 0x00000004, /* P4-M */
  15. /* the following processors are not speedstep-capable and are not auto-detected
  16. * in speedstep_detect_processor(). However, their speed can be detected using
  17. * the speedstep_get_frequency() call. */
  18. SPEEDSTEP_CPU_PM = 0xFFFFFF03, /* Pentium M */
  19. SPEEDSTEP_CPU_P4D = 0xFFFFFF04, /* desktop P4 */
  20. SPEEDSTEP_CPU_PCORE = 0xFFFFFF05, /* Core */
  21. };
  22. /* speedstep states -- only two of them */
  23. #define SPEEDSTEP_HIGH 0x00000000
  24. #define SPEEDSTEP_LOW 0x00000001
  25. /* detect a speedstep-capable processor */
  26. extern enum speedstep_processor speedstep_detect_processor(void);
  27. /* detect the current speed (in khz) of the processor */
  28. extern unsigned int speedstep_get_frequency(enum speedstep_processor processor);
  29. /* detect the low and high speeds of the processor. The callback
  30. * set_state"'s first argument is either SPEEDSTEP_HIGH or
  31. * SPEEDSTEP_LOW; the second argument is zero so that no
  32. * cpufreq_notify_transition calls are initiated.
  33. */
  34. extern unsigned int speedstep_get_freqs(enum speedstep_processor processor,
  35. unsigned int *low_speed,
  36. unsigned int *high_speed,
  37. unsigned int *transition_latency,
  38. void (*set_state) (unsigned int state));