Changeset 2504

Show
Ignore:
Timestamp:
05/02/04 15:49:14 (9 years ago)
Author:
khali
Message:

Inverse beep bits of the as99127f in the driver rather than in the

user-space.

Location:
lm-sensors/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/doc/chips/w83781d

    r2428 r2504  
    196196 
    197197Note that the individual beep bits are inverted from the other chips. 
    198 That is, in the second entry in the 'beep' file, a '1' bit means 
    199 disable, not enable. This may be changed in the future. 
     198The driver now takes care of this so that user-space applications 
     199don't have to know about it. 
    200200 
    201201Known problems: 
  • lm-sensors/trunk/kernel/chips/w83781d.c

    r2437 r2504  
    208208#define PWM_FROM_REG(val) (val) 
    209209#define PWM_TO_REG(val) (SENSORS_LIMIT((val),0,255)) 
    210 #define BEEPS_FROM_REG(val) (val) 
    211 #define BEEPS_TO_REG(val) ((val) & 0xffffff) 
     210#define BEEPS_FROM_REG(val,type) ((type)==as99127f?(val)^0x7FFF:(val)) 
     211#define BEEPS_TO_REG(val,type) ((type)==as99127f?(~(val))&0x7FFF:(val)&0xffffff) 
    212212 
    213213#define BEEP_ENABLE_TO_REG(val)   ((val)?1:0) 
     
    17121712                w83781d_update_client(client); 
    17131713                results[0] = BEEP_ENABLE_FROM_REG(data->beep_enable); 
    1714                 results[1] = BEEPS_FROM_REG(data->beeps); 
     1714                results[1] = BEEPS_FROM_REG(data->beeps, data->type); 
    17151715                *nrels_mag = 2; 
    17161716        } else if (operation == SENSORS_PROC_REAL_WRITE) { 
    17171717                if (*nrels_mag >= 2) { 
    1718                         data->beeps = BEEPS_TO_REG(results[1]); 
     1718                        data->beeps = BEEPS_TO_REG(results[1], data->type); 
    17191719                        w83781d_write_value(client, W83781D_REG_BEEP_INTS1, 
    17201720                                            data->beeps & 0xff); 
  • lm-sensors/trunk/prog/sensors/chips.c

    r2487 r2504  
    21012101  if (!sensors_get_feature(*name,SENSORS_W83781D_BEEPS,&cur)) { 
    21022102    beeps = cur + 0.5; 
    2103     /* strangely, as99127f beep bits are inverted */ 
    2104     if (!strcmp(name->prefix,"as99127f")) 
    2105       beeps = ~beeps; 
    21062103  } else { 
    21072104    printf("ERROR: Can't get beep data!\n");