Matt DeVillier (matt.devillier@gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12799
-gerrit
commit 2f6ab98ca238e3743e2f5837f27f54ccda7b0a54 Author: Ted Kuo tedkuo@ami.com.tw Date: Fri Mar 27 18:59:07 2015 +0800
superio/it8772f: Add register to set the default value of FAN speed
Original-Signed-off-by: Ted Kuo tedkuo@ami.com.tw
Change-Id: I70d7b572e9ae030136a39fb6fa933f486d559aef Original-Reviewed-on: https://chromium-review.googlesource.com/262832 Original-Reviewed-by: Shawn N shawnn@chromium.org Original-Commit-Queue: Ted Kuo tedkuo@ami.com.tw Original-Tested-by: Ted Kuo tedkuo@ami.com.tw Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- src/superio/ite/it8772f/chip.h | 6 ++++++ src/superio/ite/it8772f/superio.c | 22 ++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/src/superio/ite/it8772f/chip.h b/src/superio/ite/it8772f/chip.h index 2ceeee0..1d84850 100644 --- a/src/superio/ite/it8772f/chip.h +++ b/src/superio/ite/it8772f/chip.h @@ -48,6 +48,12 @@ struct superio_ite_it8772f_config { u8 fan1_enable; u8 fan2_enable; u8 fan3_enable; + + /* + * Default FAN speed + */ + u8 fan2_speed; + u8 fan3_speed; };
#endif /* SUPERIO_ITE_IT8772F_CHIP_H */ diff --git a/src/superio/ite/it8772f/superio.c b/src/superio/ite/it8772f/superio.c index cac6898..2b891b2 100644 --- a/src/superio/ite/it8772f/superio.c +++ b/src/superio/ite/it8772f/superio.c @@ -137,7 +137,7 @@ static void it8772f_enable_tmpin(struct resource *res, int tmpin, /* * Setup a FAN PWM interface for software control */ -static void it8772f_enable_fan(struct resource *res, int fan) +static void it8772f_enable_fan(struct resource *res, int fan, u8 fan_speed) { u8 reg;
@@ -165,8 +165,10 @@ static void it8772f_enable_fan(struct resource *res, int fan) /* Disable Smoothing */ it8772f_envc_write(res, IT8772F_FAN_CTL2_AUTO_MODE, IT8772F_FAN_CTL_AUTO_SMOOTHING_DIS); - /* Set a default medium fan speed */ - it8772f_envc_write(res, IT8772F_FAN_CTL2_PWM_START, 0x80); + /* Set a default fan speed */ + if (fan_speed) + it8772f_envc_write(res, IT8772F_FAN_CTL2_PWM_START, + fan_speed); break; case 3: /* Enable software operation */ @@ -175,8 +177,10 @@ static void it8772f_enable_fan(struct resource *res, int fan) /* Disable Smoothing */ it8772f_envc_write(res, IT8772F_FAN_CTL3_AUTO_MODE, IT8772F_FAN_CTL_AUTO_SMOOTHING_DIS); - /* Set a default medium fan speed */ - it8772f_envc_write(res, IT8772F_FAN_CTL3_PWM_START, 0x80); + /* Set a default fan speed */ + if (fan_speed) + it8772f_envc_write(res, IT8772F_FAN_CTL3_PWM_START, + fan_speed); break; } } @@ -206,11 +210,13 @@ static void it8772f_init(struct device *dev)
/* Enable FANx if configured */ if (conf->fan1_enable) - it8772f_enable_fan(res, 1); + it8772f_enable_fan(res, 1, 0); if (conf->fan2_enable) - it8772f_enable_fan(res, 2); + it8772f_enable_fan(res, 2, + conf->fan2_speed ? conf->fan2_speed : 0x80); if (conf->fan3_enable) - it8772f_enable_fan(res, 3); + it8772f_enable_fan(res, 3, + conf->fan3_speed ? conf->fan3_speed : 0x80);
/* * System may get wrong temperature data when SIO is in