diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch new file mode 100644 index 00000000..ca1f37f3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From a93a91746fe70854f5301c526d1eec16312bebc3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Nikolaus Schulz <schulz@macnetix.de> | ||
3 | Date: Wed, 22 Feb 2012 23:18:44 +0100 | ||
4 | Subject: [PATCH 68/73] hwmon: (f75375s) Fix register write order when setting | ||
5 | fans to full speed | ||
6 | |||
7 | commit c1c1a3d012fe5e82a9a025fb4b5a4f8ee67a53f6 upstream. | ||
8 | |||
9 | By hwmon sysfs interface convention, setting pwm_enable to zero sets a fan | ||
10 | to full speed. In the f75375s driver, this need be done by enabling | ||
11 | manual fan control, plus duty mode for the F875387 chip, and then setting | ||
12 | the maximum duty cycle. Fix a bug where the two necessary register writes | ||
13 | were swapped, effectively discarding the setting to full-speed. | ||
14 | |||
15 | Signed-off-by: Nikolaus Schulz <mail@microschulz.de> | ||
16 | Cc: Riku Voipio <riku.voipio@iki.fi> | ||
17 | Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> | ||
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
19 | --- | ||
20 | drivers/hwmon/f75375s.c | 5 +++-- | ||
21 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c | ||
24 | index e4ab491..040a820 100644 | ||
25 | --- a/drivers/hwmon/f75375s.c | ||
26 | +++ b/drivers/hwmon/f75375s.c | ||
27 | @@ -304,8 +304,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | ||
28 | case 0: /* Full speed */ | ||
29 | fanmode |= (3 << FAN_CTRL_MODE(nr)); | ||
30 | data->pwm[nr] = 255; | ||
31 | - f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), | ||
32 | - data->pwm[nr]); | ||
33 | break; | ||
34 | case 1: /* PWM */ | ||
35 | fanmode |= (3 << FAN_CTRL_MODE(nr)); | ||
36 | @@ -318,6 +316,9 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) | ||
37 | } | ||
38 | f75375_write8(client, F75375_REG_FAN_TIMER, fanmode); | ||
39 | data->pwm_enable[nr] = val; | ||
40 | + if (val == 0) | ||
41 | + f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr), | ||
42 | + data->pwm[nr]); | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | -- | ||
47 | 1.7.7.4 | ||
48 | |||