Changeset 800

Show
Ignore:
Timestamp:
05/06/00 22:58:10 (9 years ago)
Author:
mds
Message:

(mds) fix sensor selection for sensor2/sensor3.

Enable VBAT (in8) monitoring.

Files:

Legend:

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

    r798 r800  
    1919  Module via686a: Enable sensors if not enabled by BIOS 
    2020  Module w83781d: Improve w83783s support, w83627hf always has 2 pwm 
     21  Module w83781d: Fix sensor2&3 selection, enable VBAT (in8) monitoring 
    2122  Program isadump: Add Winbond-style bank selection 
    2223  Program sensors-detect: Fix i801 detection 
  • lm-sensors/trunk/kernel/chips/w83781d.c

    r797 r800  
    22    w83781d.c - Part of lm_sensors, Linux kernel modules for hardware 
    33                monitoring 
    4     Copyright (c) 1998, 1999  Frodo Looijaard <frodol@dds.nl>, 
     4    Copyright (c) 1998, 1999, 2000  Frodo Looijaard <frodol@dds.nl>, 
    55    Philip Edelbrock <phil@netroedge.com>, 
    66    and Mark Studebaker <mdsxyz123@yahoo.com> 
     
    2727    as99127f    9       3       2-4     3       0x20    0x12c3  yes     no 
    2828    w83781d     7       3       0       3       0x10    0x5ca3  yes     yes 
    29     w83627hf    9       3       2-4   3       0x20    0x5ca3  yes     yes(LPC) 
     29    w83627hf    9       3       2     3       0x20    0x5ca3  yes     yes(LPC) 
    3030    w83782d     9       3       2-4     3       0x30    0x5ca3  yes     yes 
    3131    w83783s     5-6     3       2       1-2     0x40    0x5ca3  yes     no 
     
    106106#define W83781D_REG_ALARM1 0x41 
    107107#define W83781D_REG_ALARM2 0x42 
    108 #define W83781D_REG_ALARM3 0x450        /* W83782D only */ 
     108#define W83781D_REG_ALARM3 0x450        /* not on W83781D */ 
    109109 
    110110#define W83781D_REG_BEEP_CONFIG 0x4D 
     
    124124 
    125125/* PWM 782D (1-4) and 783S (1-2) only */ 
    126 #define W83781D_REG_PWM1 0x5B   /* 782d and 783s datasheets disagree */ 
    127                                 /* on which is which. */ 
    128 #define W83781D_REG_PWM2 0x5A   /* We follow the 782d convention here */ 
     126#define W83781D_REG_PWM1 0x5B   /* 782d and 783s/627hf datasheets disagree */ 
     127                                /* on which is which; */ 
     128#define W83781D_REG_PWM2 0x5A   /* We follow the 782d convention here, */ 
     129                                /* However 782d is probably wrong. */ 
    129130#define W83781D_REG_PWM3 0x5E 
    130131#define W83781D_REG_PWM4 0x5F 
     
    141142/* The following are undocumented in the data sheets however we 
    142143   received the information in an email from Winbond tech support */ 
    143 /* Sensor selection 782D/783S only */ 
     144/* Sensor selection - not on 781d */ 
    144145#define W83781D_REG_SCFG1 0x5D 
    145146static const u8 BIT_SCFG1[] = { 0x02, 0x04, 0x08 }; 
    146147#define W83781D_REG_SCFG2 0x59 
    147 static const u8 BIT_SCFG2[] = { 0x10, 0x04, 0x08 }; 
     148static const u8 BIT_SCFG2[] = { 0x10, 0x20, 0x40 }; 
    148149#define W83781D_DEFAULT_BETA 3435 
    149150 
     
    10551056} 
    10561057 
    1057 /* The SMBus locks itself, usually, but nothing may access the Winbond between 
    1058    bank switches. ISA access must always be locked explicitly!  
    1059    We ignore the W83781D BUSY flag at this moment - it could lead to deadlocks, 
    1060    would slow down the W83781D access and should not be necessary.  
    1061    There are some ugly typecasts here, but the good news is - they should 
    1062    nowhere else be necessary! */ 
    10631058int w83781d_write_value(struct i2c_client *client, u16 reg, u16 value) 
    10641059{ 
     
    11781173   Data sheet documentation is sparse. 
    11791174   We also assume that it is only for the 781D although I suspect 
    1180    that the 782D/783D support it as well.... 
     1175   that the others support it as well.... 
    11811176*/ 
    11821177 
     
    12551250                w83781d_write_value(client, W83781D_REG_IN_MAX(8), 
    12561251                                    IN_TO_REG(W83781D_INIT_IN_MAX_8)); 
     1252                w83781d_write_value(client, W83781D_REG_VBAT, 
     1253                    (w83781d_read_value(client, W83781D_REG_VBAT) | 0x01)); 
    12571254        } 
    12581255        w83781d_write_value(client, W83781D_REG_FAN_MIN(1),