Lines Matching refs:this
59 static void __gfxpll_rreg(struct loongson_gfxpll *this,
63 reg->d = readq(this->mmio);
65 reg->w[0] = readl(this->mmio);
66 reg->w[1] = readl(this->mmio + 4);
72 static int loongson_gfxpll_update(struct loongson_gfxpll * const this,
80 static void loongson_gfxpll_get_rates(struct loongson_gfxpll * const this,
85 struct loongson_gfxpll_parms *pparms = &this->parms;
92 __gfxpll_rreg(this, &gfxpll_reg);
117 static void loongson_gfxpll_print(struct loongson_gfxpll * const this,
121 struct loongson_gfxpll_parms *parms = &this->parms;
134 this->funcs->get_rates(this, &dc, &gmc, &gpu);
143 struct loongson_gfxpll *this = (struct loongson_gfxpll *)data;
145 iounmap(this->mmio);
147 kfree(this);
150 static int loongson_gfxpll_init(struct loongson_gfxpll * const this)
152 struct loongson_gfxpll_parms *pparms = &this->parms;
153 struct drm_printer printer = drm_info_printer(this->ddev->dev);
157 this->mmio = ioremap(this->reg_base, this->reg_size);
158 if (IS_ERR_OR_NULL(this->mmio))
161 this->funcs->print(this, &printer, false);
178 struct loongson_gfxpll *this;
181 this = kzalloc(sizeof(*this), GFP_KERNEL);
182 if (IS_ERR_OR_NULL(this))
185 this->ddev = ddev;
186 this->reg_size = gfx->gfxpll.reg_size;
187 this->reg_base = gfx->conf_reg_base + gfx->gfxpll.reg_offset;
188 this->funcs = &lsdc_gmc_gpu_funcs;
190 ret = this->funcs->init(this);
192 kfree(this);
196 *ppout = this;
198 return drmm_add_action_or_reset(ddev, loongson_gfxpll_fini, this);