Changeset 4390

Show
Ignore:
Timestamp:
05/08/07 12:36:06 (2 years ago)
Author:
khali
Message:

Add user-space support for the applesmc driver. Patch contributed by
Soeren Sonnenburg.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CHANGES

    r4389 r4390  
    77  Library: Clean up pwm symbol names translation 
    88           Add dme1737 support 
     9           Add applesmc support 
    910  Man page sensors.conf.5: Update the chip statement section 
    1011  Module i2c-nforce2: Add nForce MCP61, MCP65 support (2.6 backport) 
     
    1617  Program sensors: Drop ddcmon and eeprom support 
    1718                   Add dme1737 support 
     19                   Add applesmc support 
    1820  Program sensors-detect: Stop Super-I/O probe after first family success 
    1921                          Fix SMSC DME1737 detection 
  • lm-sensors/trunk/lib/chips.c

    r4355 r4390  
    60496049}; 
    60506050 
     6051static sensors_chip_feature applesmc_features[] = 
     6052  { 
     6053    { { SENSORS_APPLESMC_TEMP(0), "temp1", NOMAP, NOMAP, R },  
     6054                                NOSYSCTL, VALUE(1), 3 }, 
     6055    { { SENSORS_APPLESMC_TEMP(1), "temp2", NOMAP, NOMAP, R },  
     6056                                NOSYSCTL, VALUE(1), 3 }, 
     6057    { { SENSORS_APPLESMC_TEMP(2), "temp3", NOMAP, NOMAP, R },  
     6058                                NOSYSCTL, VALUE(1), 3 }, 
     6059    { { SENSORS_APPLESMC_TEMP(3), "temp4", NOMAP, NOMAP, R },  
     6060                                NOSYSCTL, VALUE(1), 3 }, 
     6061    { { SENSORS_APPLESMC_TEMP(4), "temp5", NOMAP, NOMAP, R },  
     6062                                NOSYSCTL, VALUE(1), 3 }, 
     6063    { { SENSORS_APPLESMC_TEMP(5), "temp6", NOMAP, NOMAP, R },  
     6064                                NOSYSCTL, VALUE(1), 3 }, 
     6065    { { SENSORS_APPLESMC_TEMP(6), "temp7", NOMAP, NOMAP, R },  
     6066                                NOSYSCTL, VALUE(1), 3 }, 
     6067    { { SENSORS_APPLESMC_TEMP(7), "temp8", NOMAP, NOMAP, R },  
     6068                                NOSYSCTL, VALUE(1), 3 }, 
     6069    { { SENSORS_APPLESMC_TEMP(8), "temp9", NOMAP, NOMAP, R },  
     6070                                NOSYSCTL, VALUE(1), 3 }, 
     6071    { { SENSORS_APPLESMC_TEMP(9), "temp10", NOMAP, NOMAP, R },  
     6072                                NOSYSCTL, VALUE(1), 3 }, 
     6073    { { SENSORS_APPLESMC_TEMP(10), "temp11", NOMAP, NOMAP, R },  
     6074                                NOSYSCTL, VALUE(1), 3 }, 
     6075    { { SENSORS_APPLESMC_TEMP(11), "temp12", NOMAP, NOMAP, R },  
     6076                                NOSYSCTL, VALUE(1), 3 }, 
     6077    { { SENSORS_APPLESMC_FAN(0), "fan1", NOMAP, NOMAP, R },  
     6078                                NOSYSCTL, VALUE(2), 0 }, 
     6079    { { SENSORS_APPLESMC_FAN(1), "fan2", NOMAP, NOMAP, R },  
     6080                                NOSYSCTL, VALUE(2), 0 }, 
     6081    { { SENSORS_APPLESMC_FAN_MIN(0), "fan1_min", SENSORS_APPLESMC_FAN(0),  
     6082                  SENSORS_APPLESMC_FAN(0), R }, NOSYSCTL, VALUE(1), 0 }, 
     6083    { { SENSORS_APPLESMC_FAN_MIN(1), "fan2_min", SENSORS_APPLESMC_FAN(1), 
     6084                  SENSORS_APPLESMC_FAN(1), R }, NOSYSCTL, VALUE(1), 0 }, 
     6085    { { SENSORS_APPLESMC_FAN_MAX(0), "fan1_max", SENSORS_APPLESMC_FAN(0),  
     6086                  SENSORS_APPLESMC_FAN(0), R }, NOSYSCTL, VALUE(1), 0 }, 
     6087    { { SENSORS_APPLESMC_FAN_MAX(1), "fan2_max", SENSORS_APPLESMC_FAN(1), 
     6088                  SENSORS_APPLESMC_FAN(1), R }, NOSYSCTL, VALUE(1), 0 }, 
     6089    { { SENSORS_APPLESMC_FAN_SAFE(0), "fan1_safe", SENSORS_APPLESMC_FAN(0), 
     6090                  SENSORS_APPLESMC_FAN(0), R }, NOSYSCTL, VALUE(1), 0 }, 
     6091    { { SENSORS_APPLESMC_FAN_SAFE(1), "fan2_safe", SENSORS_APPLESMC_FAN(1), 
     6092                  SENSORS_APPLESMC_FAN(1), R }, NOSYSCTL, VALUE(1), 0 }, 
     6093    { { 0 }, 0 } 
     6094  }; 
     6095 
    60516096sensors_chip_features sensors_chip_features_list[] = 
    60526097{ 
     
    61626207 { SENSORS_CORETEMP_PREFIX, coretemp_features }, 
    61636208 { SENSORS_DME1737_PREFIX, dme1737_features }, 
     6209 { SENSORS_APPLESMC_PREFIX, applesmc_features }, 
    61646210 { 0 } 
    61656211}; 
  • lm-sensors/trunk/lib/chips.h

    r4355 r4390  
    22932293#define SENSORS_DME1737_VRM                     (0xf1) /* RW */ 
    22942294 
     2295/* applesmc */ 
     2296 
     2297#define SENSORS_APPLESMC_PREFIX "applesmc" 
     2298 
     2299/* temp n from 0 to 11 */ 
     2300#define SENSORS_APPLESMC_TEMP(n)                (0x01 + (n)) /* R */ 
     2301 
     2302/* fan n from 0 to 1 */ 
     2303#define SENSORS_APPLESMC_FAN(n)                 (0x21 + (n)) /* R */ 
     2304#define SENSORS_APPLESMC_FAN_MIN(n)             (0x41 + (n)) /* R */ 
     2305#define SENSORS_APPLESMC_FAN_MAX(n)             (0x61 + (n)) /* R */ 
     2306#define SENSORS_APPLESMC_FAN_SAFE(n)            (0x81 + (n)) /* R */ 
     2307 
    22952308#endif /* def LIB_SENSORS_CHIPS_H */ 
  • lm-sensors/trunk/prog/sensors/chips.c

    r4377 r4390  
    60426042} 
    60436043 
     6044void print_applesmc(const sensors_chip_name *name) 
     6045{ 
     6046        char *label; 
     6047        double cur, min, max, safe; 
     6048        int valid; 
     6049        int i; 
     6050 
     6051        for (i = 0; i < 12; i++) { 
     6052                if (!sensors_get_label_and_valid(*name, SENSORS_APPLESMC_TEMP(i), &label, &valid) 
     6053                 && !sensors_get_feature(*name, SENSORS_APPLESMC_TEMP(i), &cur)) { 
     6054                        if (valid) { 
     6055                                print_label(label, 10); 
     6056                                print_temp_info(cur, 0, 0, SINGLE, 0, 0); 
     6057                                printf("\n"); 
     6058                        } 
     6059                } 
     6060                free(label); 
     6061        } 
     6062 
     6063        for (i = 0; i < 2; i++) { 
     6064                if (!sensors_get_label_and_valid(*name, SENSORS_APPLESMC_FAN(i), &label, &valid) 
     6065                 && !sensors_get_feature(*name, SENSORS_APPLESMC_FAN(i), &cur) 
     6066                 && !sensors_get_feature(*name, SENSORS_APPLESMC_FAN_MIN(i), &min) 
     6067                 && !sensors_get_feature(*name, SENSORS_APPLESMC_FAN_MAX(i), &max) 
     6068                 && !sensors_get_feature(*name, SENSORS_APPLESMC_FAN_SAFE(i), &safe)) { 
     6069                        if (valid) { 
     6070                                print_label(label, 10); 
     6071                                printf("%4.0f RPM (safe = %4.0f RPM, min = %4.0f RPM, max = %4.0f RPM)\n", 
     6072                                       cur, safe, min, max); 
     6073                        } 
     6074                } 
     6075                free(label); 
     6076        } 
     6077} 
     6078 
    60446079void print_unknown_chip(const sensors_chip_name *name) 
    60456080{ 
  • lm-sensors/trunk/prog/sensors/chips.h

    r4355 r4390  
    7878extern void print_coretemp(const sensors_chip_name *name); 
    7979extern void print_dme1737(const sensors_chip_name *name); 
     80extern void print_applesmc(const sensors_chip_name *name); 
    8081 
    8182#endif /* def PROG_SENSORS_CHIPS_H */ 
  • lm-sensors/trunk/prog/sensors/main.c

    r4355 r4390  
    423423        { "coretemp", print_coretemp }, 
    424424        { "dme1737", print_dme1737 }, 
     425        { "applesmc", print_applesmc }, 
    425426        { NULL, NULL } 
    426427};