Lines Matching refs:p
126 static void iclkip_params_init(struct iclkip_params *p) in iclkip_params_init() argument
128 memset(p, 0, sizeof(*p)); in iclkip_params_init()
130 p->iclk_virtual_root_freq = 172800 * 1000; in iclkip_params_init()
131 p->iclk_pi_range = 64; in iclkip_params_init()
134 static int lpt_iclkip_freq(struct iclkip_params *p) in lpt_iclkip_freq() argument
136 return DIV_ROUND_CLOSEST(p->iclk_virtual_root_freq, in lpt_iclkip_freq()
137 p->desired_divisor << p->auxdiv); in lpt_iclkip_freq()
140 static void lpt_compute_iclkip(struct iclkip_params *p, int clock) in lpt_compute_iclkip() argument
142 iclkip_params_init(p); in lpt_compute_iclkip()
150 for (p->auxdiv = 0; p->auxdiv < 2; p->auxdiv++) { in lpt_compute_iclkip()
151 p->desired_divisor = DIV_ROUND_CLOSEST(p->iclk_virtual_root_freq, in lpt_compute_iclkip()
152 clock << p->auxdiv); in lpt_compute_iclkip()
153 p->divsel = (p->desired_divisor / p->iclk_pi_range) - 2; in lpt_compute_iclkip()
154 p->phaseinc = p->desired_divisor % p->iclk_pi_range; in lpt_compute_iclkip()
160 if (p->divsel <= 0x7f) in lpt_compute_iclkip()
167 struct iclkip_params p; in lpt_iclkip() local
169 lpt_compute_iclkip(&p, crtc_state->hw.adjusted_mode.crtc_clock); in lpt_iclkip()
171 return lpt_iclkip_freq(&p); in lpt_iclkip()
180 struct iclkip_params p; in lpt_program_iclkip() local
185 lpt_compute_iclkip(&p, clock); in lpt_program_iclkip()
186 drm_WARN_ON(&dev_priv->drm, lpt_iclkip_freq(&p) != clock); in lpt_program_iclkip()
189 drm_WARN_ON(&dev_priv->drm, SBI_SSCDIVINTPHASE_DIVSEL(p.divsel) & in lpt_program_iclkip()
191 drm_WARN_ON(&dev_priv->drm, SBI_SSCDIVINTPHASE_DIR(p.phasedir) & in lpt_program_iclkip()
196 clock, p.auxdiv, p.divsel, p.phasedir, p.phaseinc); in lpt_program_iclkip()
203 temp |= SBI_SSCDIVINTPHASE_DIVSEL(p.divsel); in lpt_program_iclkip()
205 temp |= SBI_SSCDIVINTPHASE_INCVAL(p.phaseinc); in lpt_program_iclkip()
206 temp |= SBI_SSCDIVINTPHASE_DIR(p.phasedir); in lpt_program_iclkip()
213 temp |= SBI_SSCAUXDIV_FINALDIV2SEL(p.auxdiv); in lpt_program_iclkip()
231 struct iclkip_params p; in lpt_get_iclkip() local
237 iclkip_params_init(&p); in lpt_get_iclkip()
248 p.divsel = (temp & SBI_SSCDIVINTPHASE_DIVSEL_MASK) >> in lpt_get_iclkip()
250 p.phaseinc = (temp & SBI_SSCDIVINTPHASE_INCVAL_MASK) >> in lpt_get_iclkip()
254 p.auxdiv = (temp & SBI_SSCAUXDIV_FINALDIV2SEL_MASK) >> in lpt_get_iclkip()
259 p.desired_divisor = (p.divsel + 2) * p.iclk_pi_range + p.phaseinc; in lpt_get_iclkip()
261 return lpt_iclkip_freq(&p); in lpt_get_iclkip()