Lines Matching full:this

18  * This structure is same for ls7a2000, ls7a1000 and ls2k2000.
104 struct lsdc_pixpll *this = (struct lsdc_pixpll *)data; in lsdc_pixel_pll_free() local
106 iounmap(this->mmio); in lsdc_pixel_pll_free()
108 kfree(this->priv); in lsdc_pixel_pll_free()
116 * @this: point to the object where this function is called from
118 static int lsdc_pixel_pll_setup(struct lsdc_pixpll * const this) in lsdc_pixel_pll_setup() argument
122 this->mmio = ioremap(this->reg_base, this->reg_size); in lsdc_pixel_pll_setup()
123 if (!this->mmio) in lsdc_pixel_pll_setup()
128 iounmap(this->mmio); in lsdc_pixel_pll_setup()
134 this->priv = pparms; in lsdc_pixel_pll_setup()
136 return drmm_add_action_or_reset(this->ddev, lsdc_pixel_pll_free, this); in lsdc_pixel_pll_setup()
143 * @this: point to the object where this function is called from
149 static int lsdc_pixpll_find(struct lsdc_pixpll * const this, in lsdc_pixpll_find() argument
169 drm_dbg_kms(this->ddev, "pixel clock %u: miss\n", clock); in lsdc_pixpll_find()
185 * @this: point to the object from where this function is called
192 static int lsdc_pixel_pll_compute(struct lsdc_pixpll * const this, in lsdc_pixel_pll_compute() argument
196 struct lsdc_pixpll_parms *pparms = this->priv; in lsdc_pixel_pll_compute()
203 if (!lsdc_pixpll_find(this, clock, pout)) in lsdc_pixel_pll_compute()
244 drm_dbg(this->ddev, "can't find suitable params for %u khz\n", clock); in lsdc_pixel_pll_compute()
251 static void __pixpll_rreg(struct lsdc_pixpll *this, in __pixpll_rreg() argument
255 dst->d = readq(this->mmio); in __pixpll_rreg()
257 dst->w[0] = readl(this->mmio); in __pixpll_rreg()
258 dst->w[1] = readl(this->mmio + 4); in __pixpll_rreg()
262 static void __pixpll_wreg(struct lsdc_pixpll *this, in __pixpll_wreg() argument
266 writeq(src->d, this->mmio); in __pixpll_wreg()
268 writel(src->w[0], this->mmio); in __pixpll_wreg()
269 writel(src->w[1], this->mmio + 4); in __pixpll_wreg()
273 static void __pixpll_ops_powerup(struct lsdc_pixpll * const this) in __pixpll_ops_powerup() argument
277 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_powerup()
281 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_powerup()
284 static void __pixpll_ops_powerdown(struct lsdc_pixpll * const this) in __pixpll_ops_powerdown() argument
288 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_powerdown()
292 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_powerdown()
295 static void __pixpll_ops_on(struct lsdc_pixpll * const this) in __pixpll_ops_on() argument
299 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_on()
303 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_on()
306 static void __pixpll_ops_off(struct lsdc_pixpll * const this) in __pixpll_ops_off() argument
310 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_off()
314 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_off()
317 static void __pixpll_ops_bypass(struct lsdc_pixpll * const this) in __pixpll_ops_bypass() argument
321 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_bypass()
325 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_bypass()
328 static void __pixpll_ops_unbypass(struct lsdc_pixpll * const this) in __pixpll_ops_unbypass() argument
332 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_unbypass()
336 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_unbypass()
339 static void __pixpll_ops_untoggle_param(struct lsdc_pixpll * const this) in __pixpll_ops_untoggle_param() argument
343 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_untoggle_param()
347 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_untoggle_param()
350 static void __pixpll_ops_set_param(struct lsdc_pixpll * const this, in __pixpll_ops_set_param() argument
355 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_set_param()
361 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_set_param()
364 static void __pixpll_ops_toggle_param(struct lsdc_pixpll * const this) in __pixpll_ops_toggle_param() argument
368 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_toggle_param()
372 __pixpll_wreg(this, &pixpll_reg); in __pixpll_ops_toggle_param()
375 static void __pixpll_ops_wait_locked(struct lsdc_pixpll * const this) in __pixpll_ops_wait_locked() argument
381 __pixpll_rreg(this, &pixpll_reg); in __pixpll_ops_wait_locked()
389 drm_dbg(this->ddev, "%u loop waited\n", counter); in __pixpll_ops_wait_locked()
395 * @this: point to the object from which this function is called
400 static int lsdc_pixpll_update(struct lsdc_pixpll * const this, in lsdc_pixpll_update() argument
403 __pixpll_ops_bypass(this); in lsdc_pixpll_update()
405 __pixpll_ops_off(this); in lsdc_pixpll_update()
407 __pixpll_ops_powerdown(this); in lsdc_pixpll_update()
409 __pixpll_ops_toggle_param(this); in lsdc_pixpll_update()
411 __pixpll_ops_set_param(this, pin); in lsdc_pixpll_update()
413 __pixpll_ops_untoggle_param(this); in lsdc_pixpll_update()
415 __pixpll_ops_powerup(this); in lsdc_pixpll_update()
419 __pixpll_ops_wait_locked(this); in lsdc_pixpll_update()
421 __pixpll_ops_on(this); in lsdc_pixpll_update()
423 __pixpll_ops_unbypass(this); in lsdc_pixpll_update()
428 static unsigned int lsdc_pixpll_get_freq(struct lsdc_pixpll * const this) in lsdc_pixpll_get_freq() argument
430 struct lsdc_pixpll_parms *ppar = this->priv; in lsdc_pixpll_get_freq()
434 __pixpll_rreg(this, &pix_pll_reg); in lsdc_pixpll_get_freq()
445 static void lsdc_pixpll_print(struct lsdc_pixpll * const this, in lsdc_pixpll_print() argument
448 struct lsdc_pixpll_parms *parms = this->priv; in lsdc_pixpll_print()
456 * we take this as default, create a new instance if a different model is
469 int lsdc_pixpll_init(struct lsdc_pixpll * const this, in lsdc_pixpll_init() argument
477 this->ddev = ddev; in lsdc_pixpll_init()
478 this->reg_size = 8; in lsdc_pixpll_init()
479 this->reg_base = gfx->conf_reg_base + gfx->pixpll[index].reg_offset; in lsdc_pixpll_init()
480 this->funcs = &__pixpll_default_funcs; in lsdc_pixpll_init()
482 return this->funcs->setup(this); in lsdc_pixpll_init()