aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm_pid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/windfarm_pid.c')
-rw-r--r--drivers/macintosh/windfarm_pid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/macintosh/windfarm_pid.c b/drivers/macintosh/windfarm_pid.c
index 2e803b368757..0842432e27ad 100644
--- a/drivers/macintosh/windfarm_pid.c
+++ b/drivers/macintosh/windfarm_pid.c
@@ -88,8 +88,8 @@ EXPORT_SYMBOL_GPL(wf_cpu_pid_init);
88 88
89s32 wf_cpu_pid_run(struct wf_cpu_pid_state *st, s32 new_power, s32 new_temp) 89s32 wf_cpu_pid_run(struct wf_cpu_pid_state *st, s32 new_power, s32 new_temp)
90{ 90{
91 s64 error, integ, deriv, prop; 91 s64 integ, deriv, prop;
92 s32 target, sval, adj; 92 s32 error, target, sval, adj;
93 int i, hlen = st->param.history_len; 93 int i, hlen = st->param.history_len;
94 94
95 /* Calculate error term */ 95 /* Calculate error term */
@@ -117,7 +117,7 @@ s32 wf_cpu_pid_run(struct wf_cpu_pid_state *st, s32 new_power, s32 new_temp)
117 integ += st->errors[(st->index + hlen - i) % hlen]; 117 integ += st->errors[(st->index + hlen - i) % hlen];
118 integ *= st->param.interval; 118 integ *= st->param.interval;
119 integ *= st->param.gr; 119 integ *= st->param.gr;
120 sval = st->param.tmax - ((integ >> 20) & 0xffffffff); 120 sval = st->param.tmax - (s32)(integ >> 20);
121 adj = min(st->param.ttarget, sval); 121 adj = min(st->param.ttarget, sval);
122 122
123 DBG("integ: %lx, sval: %lx, adj: %lx\n", integ, sval, adj); 123 DBG("integ: %lx, sval: %lx, adj: %lx\n", integ, sval, adj);
@@ -129,7 +129,7 @@ s32 wf_cpu_pid_run(struct wf_cpu_pid_state *st, s32 new_power, s32 new_temp)
129 deriv *= st->param.gd; 129 deriv *= st->param.gd;
130 130
131 /* Calculate proportional term */ 131 /* Calculate proportional term */
132 prop = (new_temp - adj); 132 prop = st->last_delta = (new_temp - adj);
133 prop *= st->param.gp; 133 prop *= st->param.gp;
134 134
135 DBG("deriv: %lx, prop: %lx\n", deriv, prop); 135 DBG("deriv: %lx, prop: %lx\n", deriv, prop);