intel_pstate: fix pid_reset to use fixed point values
authorDirk Brandewie <dirk.j.brandewie@intel.com>
Wed, 12 Feb 2014 18:01:05 +0000 (10:01 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 1 Mar 2014 23:35:19 +0000 (00:35 +0100)
commit d253d2a526 (Improve accuracy by not truncating until final
result), changed internal variables of the PID to be fixed point
numbers. Update the pid_reset() to reflect this change.

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c

index 41f9eb295f0c2dd2cfdd32ba87dc09085b068ef7..9ab109c0f90c95b2c7b1f6ddc475658b2ae92564 100644 (file)
@@ -153,7 +153,7 @@ static inline void pid_reset(struct _pid *pid, int setpoint, int busy,
        pid->setpoint = setpoint;
        pid->deadband  = deadband;
        pid->integral  = int_tofp(integral);
-       pid->last_err  = setpoint - busy;
+       pid->last_err  = int_tofp(setpoint) - int_tofp(busy);
 }
 
 static inline void pid_p_gain_set(struct _pid *pid, int percent)