summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorHenry Hsu <Henry.Hsu@quantatw.com>2014-03-06 21:21:00 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-03-11 03:01:27 +0000
commitc4251ad3684ad000d87cc9033d7e08fea9afd776 (patch)
tree084c55f62854d57bcc8a2de6833a8ef3f2aebdbe /board
parente1718d94f87042bf6aae591f956b8c1a32bdc5f1 (diff)
downloadchrome-ec-c4251ad3684ad000d87cc9033d7e08fea9afd776.tar.gz
Glimmer: Add second source fan table
Glimmer use BOARD_VERSION3 to identify two fan module. Each of them have its own thermal table (different rpm) due to keep the same noise. on off RPM(FAN_ID low) RPM(FAN_ID high) 42 35 4000 3950 48 39 4350 4550 63 53 5150 5600 BUG=chrome-os-partner:25076 BRANCH=glimmer TEST=For different fan module, the fan can work with different fan speed as above. Change-Id: If1ee2e8d2931e2193233d933ca01de68d499d8bf Signed-off-by: Henry Hsu <Henry.Hsu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/189032 Reviewed-by: Dave Parker <dparker@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/glimmer/board.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/board/glimmer/board.c b/board/glimmer/board.c
index e2759c951a..e367daff20 100644
--- a/board/glimmer/board.c
+++ b/board/glimmer/board.c
@@ -46,11 +46,9 @@ struct fan_step {
int lv3;
};
-static struct fan_step fan_table = {
- .lv0 = 0,
- .lv1 = 4000,
- .lv2 = 4350,
- .lv3 = 5150,
+static struct fan_step fan_table[2] = {
+ {.lv0 = 0, .lv1 = 4000, .lv2 = 4350, .lv3 = 5150,} ,
+ {.lv0 = 0, .lv1 = 3950, .lv2 = 4550, .lv3 = 5600,}
};
#endif /* CONFIG_FAN_RPM_CUSTOM */
@@ -310,26 +308,33 @@ struct accel_orientation acc_orient = {
#ifdef CONFIG_FAN_RPM_CUSTOM
int fan_percent_to_rpm(int fan, int pct)
{
+ int id;
+
int current_rpm_target = fan_get_rpm_target(fans[fan].ch);
int new_rpm_target = -1;
+ if (gpio_get_level(GPIO_BOARD_VERSION3))
+ id = 1;
+ else
+ id = 0;
+
if (pct < 30)
- new_rpm_target = fan_table.lv0;
+ new_rpm_target = fan_table[id].lv0;
else if (pct < 38)
- new_rpm_target = (current_rpm_target > fan_table.lv0) ?
- fan_table.lv1 : fan_table.lv0;
+ new_rpm_target = (current_rpm_target > fan_table[id].lv0) ?
+ fan_table[id].lv1 : fan_table[id].lv0;
else if (pct < 44)
new_rpm_target = current_rpm_target;
else if (pct < 56)
- new_rpm_target = (current_rpm_target > fan_table.lv0) ?
- current_rpm_target : fan_table.lv1;
+ new_rpm_target = (current_rpm_target > fan_table[id].lv0) ?
+ current_rpm_target : fan_table[id].lv1;
else if (pct < 66)
- new_rpm_target = fan_table.lv2;
+ new_rpm_target = fan_table[id].lv2;
else if (pct < 86)
- new_rpm_target = (current_rpm_target > fan_table.lv0) ?
- current_rpm_target : fan_table.lv2;
+ new_rpm_target = (current_rpm_target > fan_table[id].lv0) ?
+ current_rpm_target : fan_table[id].lv2;
else
- new_rpm_target = fan_table.lv3;
+ new_rpm_target = fan_table[id].lv3;
if (new_rpm_target != current_rpm_target)
cprintf(CC_THERMAL, "[%T Setting fan RPM to %d]\n",