Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363038
b: refs/heads/master
c: 47ece96
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck committed Apr 8, 2013
1 parent 4e4f123 commit 6b833e1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c25d954d37b7c18606d7ef99122424552b86ef2
refs/heads/master: 47ece9645f288d46420d64dab90a182bde87bbbb
28 changes: 28 additions & 0 deletions trunk/drivers/hwmon/nct6775.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ static unsigned short force_id;
module_param(force_id, ushort, 0);
MODULE_PARM_DESC(force_id, "Override the detected device ID");

static unsigned short fan_debounce;
module_param(fan_debounce, ushort, 0);
MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal");

#define DRVNAME "nct6775"

/*
Expand Down Expand Up @@ -183,6 +187,8 @@ static const u16 NCT6775_REG_IN[] = {
#define NCT6775_REG_FANDIV1 0x506
#define NCT6775_REG_FANDIV2 0x507

#define NCT6775_REG_CR_FAN_DEBOUNCE 0xf0

static const u16 NCT6775_REG_ALARM[NUM_REG_ALARM] = { 0x459, 0x45A, 0x45B };

/* 0..15 voltages, 16..23 fans, 24..31 temperatures */
Expand Down Expand Up @@ -2110,6 +2116,28 @@ static int nct6775_probe(struct platform_device *pdev)
*/
superio_select(sio_data->sioreg, NCT6775_LD_VID);
data->vid = superio_inb(sio_data->sioreg, 0xe3);

if (fan_debounce) {
u8 tmp;

superio_select(sio_data->sioreg, NCT6775_LD_HWM);
tmp = superio_inb(sio_data->sioreg,
NCT6775_REG_CR_FAN_DEBOUNCE);
switch (data->kind) {
case nct6775:
tmp |= 0x1e;
break;
case nct6776:
case nct6779:
tmp |= 0x3e;
break;
}
superio_outb(sio_data->sioreg, NCT6775_REG_CR_FAN_DEBOUNCE,
tmp);
dev_info(&pdev->dev, "Enabled fan debounce for chip %s\n",
data->name);
}

superio_exit(sio_data->sioreg);

err = device_create_file(dev, &dev_attr_cpu0_vid);
Expand Down

0 comments on commit 6b833e1

Please sign in to comment.