Lines Matching refs:mxsfb
75 void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb) in mxsfb_enable_axi_clk() argument
77 if (mxsfb->clk_axi) in mxsfb_enable_axi_clk()
78 clk_prepare_enable(mxsfb->clk_axi); in mxsfb_enable_axi_clk()
81 void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb) in mxsfb_disable_axi_clk() argument
83 if (mxsfb->clk_axi) in mxsfb_disable_axi_clk()
84 clk_disable_unprepare(mxsfb->clk_axi); in mxsfb_disable_axi_clk()
115 static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb) in mxsfb_attach_bridge() argument
117 struct drm_device *drm = mxsfb->drm; in mxsfb_attach_bridge()
138 ret = drm_bridge_attach(&mxsfb->encoder, bridge, NULL, 0); in mxsfb_attach_bridge()
142 mxsfb->bridge = bridge; in mxsfb_attach_bridge()
149 mxsfb->connector = drm_connector_list_iter_next(&iter); in mxsfb_attach_bridge()
158 struct mxsfb_drm_private *mxsfb = drm->dev_private; in mxsfb_irq_handler() local
161 reg = readl(mxsfb->base + LCDC_CTRL1); in mxsfb_irq_handler()
164 drm_crtc_handle_vblank(&mxsfb->crtc); in mxsfb_irq_handler()
166 writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR); in mxsfb_irq_handler()
173 struct mxsfb_drm_private *mxsfb = drm->dev_private; in mxsfb_irq_disable() local
175 mxsfb_enable_axi_clk(mxsfb); in mxsfb_irq_disable()
178 writel(CTRL1_CUR_FRAME_DONE_IRQ_EN, mxsfb->base + LCDC_CTRL1 + REG_CLR); in mxsfb_irq_disable()
179 writel(CTRL1_CUR_FRAME_DONE_IRQ, mxsfb->base + LCDC_CTRL1 + REG_CLR); in mxsfb_irq_disable()
181 mxsfb_disable_axi_clk(mxsfb); in mxsfb_irq_disable()
196 struct mxsfb_drm_private *mxsfb = dev->dev_private; in mxsfb_irq_uninstall() local
199 free_irq(mxsfb->irq, dev); in mxsfb_irq_uninstall()
206 struct mxsfb_drm_private *mxsfb; in mxsfb_load() local
210 mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL); in mxsfb_load()
211 if (!mxsfb) in mxsfb_load()
214 mxsfb->drm = drm; in mxsfb_load()
215 drm->dev_private = mxsfb; in mxsfb_load()
216 mxsfb->devdata = devdata; in mxsfb_load()
219 mxsfb->base = devm_ioremap_resource(drm->dev, res); in mxsfb_load()
220 if (IS_ERR(mxsfb->base)) in mxsfb_load()
221 return PTR_ERR(mxsfb->base); in mxsfb_load()
223 mxsfb->clk = devm_clk_get(drm->dev, NULL); in mxsfb_load()
224 if (IS_ERR(mxsfb->clk)) in mxsfb_load()
225 return PTR_ERR(mxsfb->clk); in mxsfb_load()
227 mxsfb->clk_axi = devm_clk_get(drm->dev, "axi"); in mxsfb_load()
228 if (IS_ERR(mxsfb->clk_axi)) in mxsfb_load()
229 mxsfb->clk_axi = NULL; in mxsfb_load()
231 mxsfb->clk_disp_axi = devm_clk_get(drm->dev, "disp_axi"); in mxsfb_load()
232 if (IS_ERR(mxsfb->clk_disp_axi)) in mxsfb_load()
233 mxsfb->clk_disp_axi = NULL; in mxsfb_load()
244 ret = mxsfb_kms_init(mxsfb); in mxsfb_load()
257 drm_crtc_vblank_off(&mxsfb->crtc); in mxsfb_load()
259 ret = mxsfb_attach_bridge(mxsfb); in mxsfb_load()
278 mxsfb->irq = ret; in mxsfb_load()
281 ret = mxsfb_irq_install(drm, mxsfb->irq); in mxsfb_load()