Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
0004  *
0005  *  Library for common functions for Intel SpeedStep v.1 and v.2 support
0006  *
0007  *  BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous*
0008  */
0009 
0010 
0011 
0012 /* processors */
0013 enum speedstep_processor {
0014     SPEEDSTEP_CPU_PIII_C_EARLY = 0x00000001,  /* Coppermine core */
0015     SPEEDSTEP_CPU_PIII_C       = 0x00000002,  /* Coppermine core */
0016     SPEEDSTEP_CPU_PIII_T       = 0x00000003,  /* Tualatin core */
0017     SPEEDSTEP_CPU_P4M      = 0x00000004,  /* P4-M  */
0018 /* the following processors are not speedstep-capable and are not auto-detected
0019  * in speedstep_detect_processor(). However, their speed can be detected using
0020  * the speedstep_get_frequency() call. */
0021     SPEEDSTEP_CPU_PM       = 0xFFFFFF03,  /* Pentium M  */
0022     SPEEDSTEP_CPU_P4D      = 0xFFFFFF04,  /* desktop P4  */
0023     SPEEDSTEP_CPU_PCORE    = 0xFFFFFF05,  /* Core */
0024 };
0025 
0026 /* speedstep states -- only two of them */
0027 
0028 #define SPEEDSTEP_HIGH  0x00000000
0029 #define SPEEDSTEP_LOW   0x00000001
0030 
0031 
0032 /* detect a speedstep-capable processor */
0033 extern enum speedstep_processor speedstep_detect_processor(void);
0034 
0035 /* detect the current speed (in khz) of the processor */
0036 extern unsigned int speedstep_get_frequency(enum speedstep_processor processor);
0037 
0038 
0039 /* detect the low and high speeds of the processor. The callback
0040  * set_state"'s first argument is either SPEEDSTEP_HIGH or
0041  * SPEEDSTEP_LOW; the second argument is zero so that no
0042  * cpufreq_notify_transition calls are initiated.
0043  */
0044 extern unsigned int speedstep_get_freqs(enum speedstep_processor processor,
0045     unsigned int *low_speed,
0046     unsigned int *high_speed,
0047     unsigned int *transition_latency,
0048     void (*set_state) (unsigned int state));