From ac2f78cb0eca4a2e58be9601d92e733e4693eeaa Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Mon, 7 Feb 2000 01:54:00 +0000 Subject: [PATCH] (mds) stop changing fan 1/2/3 input/output values at module startup, hopefully this will preserve BIOS settings. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@728 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/w83781d.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/kernel/chips/w83781d.c b/kernel/chips/w83781d.c index 8442bd35..51507ce2 100644 --- a/kernel/chips/w83781d.c +++ b/kernel/chips/w83781d.c @@ -1137,12 +1137,14 @@ void w83781d_init_client(struct i2c_client *client) int type = data->type; u8 tmp; + /* save this register */ + i = w83781d_read_value(client, W83781D_REG_BEEP_CONFIG); /* Reset all except Watchdog values and last conversion values This sets fan-divs to 2, among others */ w83781d_write_value(client, W83781D_REG_CONFIG, 0x80); - /* Disable power-on abnormal beep. BIOS should have already turned off but - not all do. Reset value is 0x15, write a 0x95. */ - w83781d_write_value(client, W83781D_REG_BEEP_CONFIG, 0x95); + /* Restore the register and disable power-on abnormal beep. + This saves FAN 1/2/3 input/output values set by BIOS. */ + w83781d_write_value(client, W83781D_REG_BEEP_CONFIG, i | 0x80); /* Disable master beep-enable (reset turns it on). Individual beeps should be reset to off but for some reason disabling this bit helps some people not get beeped */ @@ -1302,6 +1304,11 @@ void w83781d_init_client(struct i2c_client *client) w83781d_write_value(client, W83781D_REG_TEMP3_CONFIG, 0x00); } + /* enable PWM2 control (can't hurt since PWM reg should have been + reset to 0xff) */ + if (type != w83781d) { + w83781d_write_value(client, W83781D_REG_PWMCLK12, 0x19); + } /* Start monitoring */ w83781d_write_value(client, W83781D_REG_CONFIG,