Changeset 3226

Show
Ignore:
Timestamp:
01/10/06 12:17:17 (3 years ago)
Author:
khali
Message:

Add 2.4 kernel and user-space support for the Winbond W83687THF
chip. Needs testing.

Files:

Legend:

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

    r3169 r3226  
    9898  VIA Technologies VT1211, VT8231 and VT82C686A/B embedded sensors 
    9999  Winbond W83781D, W83782D, W83783S, W83791D, W83792D, 
    100           W83627HF, W83627THF, W83637HF, and W83697HF 
     100          W83627HF, W83627THF, W83637HF, W83687THF and W83697HF 
    101101 
    102102 
  • lm-sensors/trunk/doc/chips/SUMMARY

    r3183 r3226  
    236236w83627hf 
    237237        w83627hf        3       9       3       2 pwm   no      yes (LPC) 
    238         w83627thf       3       7       3       3 pwm no      yes (LPC) 
     238        w83627thf       3       7       3       3 dac no      yes (LPC) 
    239239        w83637hf        3       7       2       3 pwm   no      yes (LPC) 
     240        w83687thf       3       7       3       3 pw/da no      yes (LPC) 
    240241        w83697hf        2       8       2       2 pwm   no      yes (LPC) 
    241242 
  • lm-sensors/trunk/doc/chips/w83627hf

    r3222 r3226  
    2121    Addresses scanned: ISA address retrieved from Super I/O registers 
    2222    Datasheet: http://www.winbond.com/PDF/sheet/w83637hf.pdf 
     23  * Winbond W83687THF 
     24    Prefix: 'w83687thf' 
     25    Addresses scanned: ISA address retrieved from Super I/O registers 
     26    Datasheet: Provided by Winbond on request 
    2327 
    2428Authors: Frodo Looijaard <frodol@dds.nl>, Philip Edelbrock <phil@netroedge.com>, 
     
    4751  List of adapter,address pairs which are unquestionably assumed to contain 
    4852  a `w83637hf' chip 
     53* force_w83687thf: short array (min = 1, max = 48) 
     54  List of adapter,address pairs which are unquestionably assumed to contain 
     55  a `w83687thf' chip 
    4956* ignore: short array (min = 1, max = 48) 
    5057  List of adapter,address pairs not to scan 
     
    6471 
    6572This driver implements support for ISA accesses *only* for 
    66 the Winbond W83627HF, W83627THF, W83697HF and W83637HF Super I/O chips. 
    67 We will refer to them collectively as Winbond chips. 
     73the Winbond W83627HF, W83627THF, W83697HF, W83637HF and W83687THF 
     74Super I/O chips. We will refer to them collectively as Winbond chips. 
    6875 
    6976This driver supports ISA accesses, which should be more reliable 
  • lm-sensors/trunk/kernel/chips/w83627hf.c

    r3205 r3226  
    2828    w83627thf   7       3       3       3       0x90    0x5ca3  no      yes(LPC) 
    2929    w83637hf    7       3       3       3       0x80    0x5ca3  no      yes(LPC) 
     30    w83687thf   7       3       3       3       0x90    0x5ca3  no      yes(LPC) 
    3031    w83697hf    8       2       2       2       0x60    0x5ca3  no      yes(LPC) 
    3132 
     
    6465 
    6566/* Insmod parameters */ 
    66 SENSORS_INSMOD_4(w83627hf, w83627thf, w83697hf, w83637hf); 
     67SENSORS_INSMOD_5(w83627hf, w83627thf, w83697hf, w83637hf, w83687thf); 
    6768 
    6869static int init = 1; 
     
    9899#define W83627THF_GPIO5_DR      0xf4 /* w83627thf only */ 
    99100 
     101#define W83687THF_VID_EN        0x29 /* w83687thf only */ 
     102#define W83687THF_VID_CFG       0xF0 /* w83687thf only */ 
     103#define W83687THF_VID_DATA      0xF1 /* w83687thf only */ 
     104 
    100105static inline void 
    101106superio_outb(int reg, int val) 
     
    136141#define W697_DEVID 0x60 
    137142#define W637_DEVID 0x70 
     143#define W687THF_DEVID 0x85 
    138144#define WINB_ACT_REG 0x30 
    139145#define WINB_BASE_REG 0x60 
     
    195201#define W83627HF_REG_PWM2 0x5B 
    196202 
    197 #define W83627THF_REG_PWM1              0x01    /* 697HF and 637HF too */ 
    198 #define W83627THF_REG_PWM2              0x03    /* 697HF and 637HF too */ 
    199 #define W83627THF_REG_PWM3              0x11    /* 637HF too */ 
    200  
    201 #define W83627THF_REG_VRM_OVT_CFG       0x18    /* 637HF too */ 
     203#define W83627THF_REG_PWM1              0x01    /* 697HF/637HF/687THF too */ 
     204#define W83627THF_REG_PWM2              0x03    /* 697HF/637HF/687THF too */ 
     205#define W83627THF_REG_PWM3              0x11    /* 637HF/687THF too */ 
     206 
     207#define W83627THF_REG_VRM_OVT_CFG       0x18    /* 637HF/687THF too */ 
    202208 
    203209static const u8 regpwm_627hf[] = { W83627HF_REG_PWM1, W83627HF_REG_PWM2 }; 
     
    315321                                   Other Betas unimplemented */ 
    316322        u8 vrm; 
    317         u8 vrm_ovt;             /* Register value, 627thf & 637hf only */ 
     323        u8 vrm_ovt;             /* Register value, 627THF/637HF/687THF only */ 
    318324}; 
    319325 
     
    364370/* The /proc/sys entries */ 
    365371/* WARNING these are copied from w83781d.c and have not been renamed. 
    366    Note that the 627hf and 697hf are supported by both drivers. 
     372   Note that the 627hf is supported by both drivers. 
    367373   Do not make incompatible changes here or we will have errors 
    368374   in the generated file ../include/sensors.h !!! 
     
    523529 
    524530/* no in5 and in6 */ 
    525 /* We use this one for W83637HF too */ 
     531/* We use this one for W83637HF and W83687THF too */ 
    526532static ctl_table w83627thf_dir_table_template[] = { 
    527533        {W83781D_SYSCTL_IN0, "in0", NULL, 0, 0644, NULL, &i2c_proc_real, 
     
    595601        superio_enter(); 
    596602        val= superio_inb(DEVID); 
    597         if(val != W627_DEVID && val !=W627THF_DEVID && val != W697_DEVID && val != W637_DEVID) { 
     603        if (val != W627_DEVID && val != W627THF_DEVID && val != W697_DEVID 
     604         && val != W637_DEVID && val != W687THF_DEVID) { 
    598605                superio_exit(); 
    599606                return -ENODEV; 
     
    654661        else if(val == W637_DEVID) 
    655662                kind = w83637hf; 
     663        else if (val == W687THF_DEVID) 
     664                kind = w83687thf; 
    656665 
    657666        superio_select(W83627HF_LD_HWM); 
     
    690699                type_name = "w83637hf"; 
    691700                client_name = "W83637HF chip"; 
     701        } else if (kind == w83687thf) { 
     702                type_name = "w83687thf"; 
     703                client_name = "W83687THF chip"; 
    692704        } else { 
    693705                goto ERROR1; 
     
    715727                                (kind == w83627hf) ? 
    716728                                   w83627hf_dir_table_template : 
    717                                    /* w83627thf table also used for 637 */ 
     729                                   /* w83627thf table also used for 637HF 
     730                                      and 687THF */ 
    718731                                   w83627thf_dir_table_template, 
    719732                                THIS_MODULE)) < 0) { 
     
    835848} 
    836849 
     850static int w83687thf_read_vid(struct i2c_client *client) 
     851{ 
     852        int res = 0xff; 
     853 
     854        superio_enter(); 
     855        superio_select(W83627HF_LD_HWM); 
     856 
     857        /* Make sure these GPIO pins are enabled */ 
     858        if (!(superio_inb(W83687THF_VID_EN) & (1 << 2))) { 
     859#ifdef DEBUG 
     860                printk(KERN_DEBUG "w83627hf: VID disabled, no VID " 
     861                       "function\n"); 
     862#endif 
     863                goto exit; 
     864        } 
     865 
     866        /* Make sure the pins are configured for input */ 
     867        if (!(superio_inb(W83687THF_VID_CFG) & (1 << 4))) { 
     868#ifdef DEBUG 
     869                printk(KERN_DEBUG "w83627hf: VID configured as output, " 
     870                       "no VID function\n"); 
     871#endif 
     872                goto exit; 
     873        } 
     874 
     875        res = superio_inb(W83687THF_VID_DATA) & 0x3f; 
     876 
     877exit: 
     878        superio_exit(); 
     879        return res; 
     880} 
     881 
    837882static int w83627hf_write_value(struct i2c_client *client, u16 reg, u16 value) 
    838883{ 
     
    889934        } else if (w83627thf == data->type) { 
    890935                data->vid = w83627thf_read_gpio5(client); 
     936        } else if (w83687thf == data->type) { 
     937                data->vid = w83687thf_read_vid(client); 
    891938        } 
    892939 
    893940        /* Read VRM & OVT Config only once */ 
    894         if (w83627thf == data->type || w83637hf == data->type) 
     941        if (w83627thf == data->type || w83637hf == data->type 
     942         || w83687thf == data->type) 
    895943                data->vrm_ovt = 
    896944                        w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG); 
     
    9601008                        /* skip missing sensors */ 
    9611009                        if (((data->type == w83697hf) && (i == 1)) || 
    962                             ((data->type == w83627thf || data->type == w83637hf) && 
    963                              (i == 5 || i == 6))) 
     1010                            ((data->type == w83627thf || data->type == w83637hf 
     1011                              || data->type == w83687thf) && (i == 5 || i == 6))) 
    9641012                                continue; 
    9651013                        data->in[i] = 
  • lm-sensors/trunk/lib/chips.c

    r3194 r3226  
    55695569                /* Cheat on 83637HF for now - no separate #defines */ 
    55705570 { SENSORS_W83637HF_PREFIX, w83782d_features }, 
     5571 { SENSORS_W83687THF_PREFIX, w83782d_features }, /* Same as W83627THF */ 
    55715572 { SENSORS_W83791D_PREFIX, w83791d_features }, 
    55725573 { SENSORS_W83792D_PREFIX, w83792d_features }, 
  • lm-sensors/trunk/lib/chips.h

    r3194 r3226  
    576576#define SENSORS_W83627THF_PREFIX "w83627thf" 
    577577#define SENSORS_W83637HF_PREFIX "w83637hf" 
     578#define SENSORS_W83687THF_PREFIX "w83687thf" 
    578579 
    579580#define SENSORS_W83791D_PREFIX "w83791d" 
  • lm-sensors/trunk/mkpatch/Config.in

    r3169 r3226  
    5252    dep_tristate '  Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F' CONFIG_SENSORS_W83781D $CONFIG_I2C $CONFIG_I2C_PROC 
    5353    dep_tristate '  Winbond W83792D' CONFIG_SENSORS_W83792D $CONFIG_I2C $CONFIG_I2C_PROC 
    54     dep_tristate '  Winbond W83627HF, W83627THF, W83697HF' CONFIG_SENSORS_W83627HF $CONFIG_I2C $CONFIG_I2C_PROC $CONFIG_I2C_ISA 
     54    dep_tristate '  Winbond W83627HF, W83627THF, W83637HF, W83687THF, W83697HF' CONFIG_SENSORS_W83627HF $CONFIG_I2C $CONFIG_I2C_PROC $CONFIG_I2C_ISA 
    5555    dep_tristate '  Winbond W83L785TS-S' CONFIG_SENSORS_W83L785TS $CONFIG_I2C $CONFIG_I2C_PROC 
    5656    bool 'Other I2C devices' CONFIG_SENSORS_OTHER  
  • lm-sensors/trunk/mkpatch/mkpatch.pl

    r3169 r3226  
    717717  http://www.lm-sensors.nu/ 
    718718 
    719 Winbond W83627HF, W83627THF, W83637HF, W83697HF 
     719Winbond W83627HF, W83627THF, W83637HF, W83687THF, W83697HF 
    720720CONFIG_SENSORS_W83627HF 
    721721  If you say yes here you get support for the Winbond W836x7 series 
    722   of sensor chips: the W83627HF, W83627THF, W83637HF and W83697HF. 
    723   This can also be built as a module which can be inserted and removed 
    724   while the kernel is running. 
     722  of sensor chips: the W83627HF, W83627THF, W83637HF, W83687THF and 
     723  W83697HF. This can also be built as a module which can be inserted 
     724  and removed while the kernel is running. 
    725725 
    726726  You will also need the latest user-space utilities: you can find 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r3207 r3226  
    18081808      { 
    18091809        name => "Winbond W83687THF Super IO Sensors", 
    1810         driver => "to-be-written", # w83627hf 
    1811         # A datasheet would be needed to confirm this 
     1810        driver => "w83627hf", 
    18121811        devid => 0x85, 
    18131812        logdev => 0x0b, 
  • lm-sensors/trunk/prog/sensors/chips.c

    r3194 r3226  
    21942194          (!strcmp(name->prefix,"w83627hf")) || 
    21952195          (!strcmp(name->prefix,"w83637hf")) || 
    2196           (!strcmp(name->prefix,"w83627thf")); 
     2196          (!strcmp(name->prefix, "w83627thf")) || 
     2197          (!strcmp(name->prefix, "w83687thf")); 
    21972198  is83s = !strcmp(name->prefix,"w83783s"); 
    21982199  is627thf = (!strcmp(name->prefix,"w83627thf")) || 
    2199              (!strcmp(name->prefix,"w83637hf")); 
     2200             (!strcmp(name->prefix, "w83637hf")) || 
     2201             (!strcmp(name->prefix, "w83687thf")); 
    22002202  is697hf  = !strcmp(name->prefix,"w83697hf"); 
    22012203 
  • lm-sensors/trunk/prog/sensors/main.c

    r3169 r3226  
    369369        { "w83637hf", print_w83781d }, 
    370370        { "w83697hf", print_w83781d }, 
     371        { "w83687thf", print_w83781d }, 
    371372        { "w83627ehf", print_w83627ehf }, 
    372373        { "w83791d", print_w83781d },