2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-03 15:55:15 +00:00

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

user-space.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2504 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2004-05-02 13:49:14 +00:00
parent 6ac599754a
commit 4ef5ecd429
3 changed files with 6 additions and 9 deletions

View File

@@ -195,8 +195,8 @@ One user has reported problems with fans stopping
occasionally.
Note that the individual beep bits are inverted from the other chips.
That is, in the second entry in the 'beep' file, a '1' bit means
disable, not enable. This may be changed in the future.
The driver now takes care of this so that user-space applications
don't have to know about it.
Known problems:
- Problems with diode/thermistor settings (supported?)

View File

@@ -207,8 +207,8 @@ static inline u8 FAN_TO_REG(long rpm, int div)
#define ALARMS_FROM_REG(val) (val)
#define PWM_FROM_REG(val) (val)
#define PWM_TO_REG(val) (SENSORS_LIMIT((val),0,255))
#define BEEPS_FROM_REG(val) (val)
#define BEEPS_TO_REG(val) ((val) & 0xffffff)
#define BEEPS_FROM_REG(val,type) ((type)==as99127f?(val)^0x7FFF:(val))
#define BEEPS_TO_REG(val,type) ((type)==as99127f?(~(val))&0x7FFF:(val)&0xffffff)
#define BEEP_ENABLE_TO_REG(val) ((val)?1:0)
#define BEEP_ENABLE_FROM_REG(val) ((val)?1:0)
@@ -1711,11 +1711,11 @@ void w83781d_beep(struct i2c_client *client, int operation, int ctl_name,
else if (operation == SENSORS_PROC_REAL_READ) {
w83781d_update_client(client);
results[0] = BEEP_ENABLE_FROM_REG(data->beep_enable);
results[1] = BEEPS_FROM_REG(data->beeps);
results[1] = BEEPS_FROM_REG(data->beeps, data->type);
*nrels_mag = 2;
} else if (operation == SENSORS_PROC_REAL_WRITE) {
if (*nrels_mag >= 2) {
data->beeps = BEEPS_TO_REG(results[1]);
data->beeps = BEEPS_TO_REG(results[1], data->type);
w83781d_write_value(client, W83781D_REG_BEEP_INTS1,
data->beeps & 0xff);
if ((data->type != w83781d) &&

View File

@@ -2100,9 +2100,6 @@ void print_w83781d(const sensors_chip_name *name)
if (!sensors_get_feature(*name,SENSORS_W83781D_BEEPS,&cur)) {
beeps = cur + 0.5;
/* strangely, as99127f beep bits are inverted */
if (!strcmp(name->prefix,"as99127f"))
beeps = ~beeps;
} else {
printf("ERROR: Can't get beep data!\n");
beeps = 0;