• Home
  • Raw
  • Download

Lines Matching refs:pid

83 	struct _pid pid;  member
132 static inline void pid_reset(struct _pid *pid, int setpoint, int busy, in pid_reset() argument
134 pid->setpoint = setpoint; in pid_reset()
135 pid->deadband = deadband; in pid_reset()
136 pid->integral = int_tofp(integral); in pid_reset()
137 pid->last_err = setpoint - busy; in pid_reset()
140 static inline void pid_p_gain_set(struct _pid *pid, int percent) in pid_p_gain_set() argument
142 pid->p_gain = div_fp(int_tofp(percent), int_tofp(100)); in pid_p_gain_set()
145 static inline void pid_i_gain_set(struct _pid *pid, int percent) in pid_i_gain_set() argument
147 pid->i_gain = div_fp(int_tofp(percent), int_tofp(100)); in pid_i_gain_set()
150 static inline void pid_d_gain_set(struct _pid *pid, int percent) in pid_d_gain_set() argument
153 pid->d_gain = div_fp(int_tofp(percent), int_tofp(100)); in pid_d_gain_set()
156 static signed int pid_calc(struct _pid *pid, int busy) in pid_calc() argument
162 err = pid->setpoint - busy; in pid_calc()
165 if (abs(err) <= pid->deadband) in pid_calc()
168 pterm = mul_fp(pid->p_gain, fp_error); in pid_calc()
170 pid->integral += fp_error; in pid_calc()
174 if (pid->integral > integral_limit) in pid_calc()
175 pid->integral = integral_limit; in pid_calc()
176 if (pid->integral < -integral_limit) in pid_calc()
177 pid->integral = -integral_limit; in pid_calc()
179 dterm = mul_fp(pid->d_gain, (err - pid->last_err)); in pid_calc()
180 pid->last_err = err; in pid_calc()
182 result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm; in pid_calc()
189 pid_p_gain_set(&cpu->pid, cpu->pstate_policy->p_gain_pct); in intel_pstate_busy_pid_reset()
190 pid_d_gain_set(&cpu->pid, cpu->pstate_policy->d_gain_pct); in intel_pstate_busy_pid_reset()
191 pid_i_gain_set(&cpu->pid, cpu->pstate_policy->i_gain_pct); in intel_pstate_busy_pid_reset()
193 pid_reset(&cpu->pid, in intel_pstate_busy_pid_reset()
484 struct _pid *pid; in intel_pstate_adjust_busy_pstate() local
488 pid = &cpu->pid; in intel_pstate_adjust_busy_pstate()
491 ctl = pid_calc(pid, busy_scaled); in intel_pstate_adjust_busy_pstate()