Lines Matching refs:dev
37 static bool fsl_dcu_drm_is_volatile_reg(struct device *dev, unsigned int reg) in fsl_dcu_drm_is_volatile_reg() argument
53 static void fsl_dcu_irq_reset(struct drm_device *dev) in fsl_dcu_irq_reset() argument
55 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; in fsl_dcu_irq_reset()
63 struct drm_device *dev = arg; in fsl_dcu_drm_irq() local
64 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; in fsl_dcu_drm_irq()
70 dev_err(dev->dev, "read DCU_INT_STATUS failed\n"); in fsl_dcu_drm_irq()
75 drm_handle_vblank(dev, 0); in fsl_dcu_drm_irq()
82 static int fsl_dcu_irq_install(struct drm_device *dev, unsigned int irq) in fsl_dcu_irq_install() argument
87 fsl_dcu_irq_reset(dev); in fsl_dcu_irq_install()
89 return request_irq(irq, fsl_dcu_drm_irq, 0, dev->driver->name, dev); in fsl_dcu_irq_install()
92 static void fsl_dcu_irq_uninstall(struct drm_device *dev) in fsl_dcu_irq_uninstall() argument
94 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; in fsl_dcu_irq_uninstall()
96 fsl_dcu_irq_reset(dev); in fsl_dcu_irq_uninstall()
97 free_irq(fsl_dev->irq, dev); in fsl_dcu_irq_uninstall()
100 static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) in fsl_dcu_load() argument
102 struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; in fsl_dcu_load()
107 dev_err(dev->dev, "failed to initialize mode setting\n"); in fsl_dcu_load()
111 ret = drm_vblank_init(dev, dev->mode_config.num_crtc); in fsl_dcu_load()
113 dev_err(dev->dev, "failed to initialize vblank\n"); in fsl_dcu_load()
117 ret = fsl_dcu_irq_install(dev, fsl_dev->irq); in fsl_dcu_load()
119 dev_err(dev->dev, "failed to install IRQ handler\n"); in fsl_dcu_load()
125 dev_warn(dev->dev, in fsl_dcu_load()
132 drm_kms_helper_poll_fini(dev); in fsl_dcu_load()
134 drm_mode_config_cleanup(dev); in fsl_dcu_load()
136 dev->dev_private = NULL; in fsl_dcu_load()
141 static void fsl_dcu_unload(struct drm_device *dev) in fsl_dcu_unload() argument
143 drm_atomic_helper_shutdown(dev); in fsl_dcu_unload()
144 drm_kms_helper_poll_fini(dev); in fsl_dcu_unload()
146 drm_mode_config_cleanup(dev); in fsl_dcu_unload()
147 fsl_dcu_irq_uninstall(dev); in fsl_dcu_unload()
149 dev->dev_private = NULL; in fsl_dcu_unload()
168 static int fsl_dcu_drm_pm_suspend(struct device *dev) in fsl_dcu_drm_pm_suspend() argument
170 struct fsl_dcu_drm_device *fsl_dev = dev_get_drvdata(dev); in fsl_dcu_drm_pm_suspend()
189 static int fsl_dcu_drm_pm_resume(struct device *dev) in fsl_dcu_drm_pm_resume() argument
191 struct fsl_dcu_drm_device *fsl_dev = dev_get_drvdata(dev); in fsl_dcu_drm_pm_resume()
199 dev_err(dev, "failed to enable dcu clk\n"); in fsl_dcu_drm_pm_resume()
248 struct device *dev = &pdev->dev; in fsl_dcu_drm_probe() local
258 fsl_dev = devm_kzalloc(dev, sizeof(*fsl_dev), GFP_KERNEL); in fsl_dcu_drm_probe()
262 id = of_match_node(fsl_dcu_of_match, pdev->dev.of_node); in fsl_dcu_drm_probe()
268 base = devm_ioremap_resource(dev, res); in fsl_dcu_drm_probe()
276 dev_err(dev, "failed to get irq\n"); in fsl_dcu_drm_probe()
280 fsl_dev->regmap = devm_regmap_init_mmio(dev, base, in fsl_dcu_drm_probe()
283 dev_err(dev, "regmap init failed\n"); in fsl_dcu_drm_probe()
287 fsl_dev->clk = devm_clk_get(dev, "dcu"); in fsl_dcu_drm_probe()
289 dev_err(dev, "failed to get dcu clock\n"); in fsl_dcu_drm_probe()
294 dev_err(dev, "failed to enable dcu clk\n"); in fsl_dcu_drm_probe()
298 pix_clk_in = devm_clk_get(dev, "pix"); in fsl_dcu_drm_probe()
304 if (of_property_read_bool(dev->of_node, "big-endian")) in fsl_dcu_drm_probe()
309 fsl_dev->pix_clk = clk_register_divider(dev, pix_clk_name, in fsl_dcu_drm_probe()
313 dev_err(dev, "failed to register pix clk\n"); in fsl_dcu_drm_probe()
318 fsl_dev->tcon = fsl_tcon_init(dev); in fsl_dcu_drm_probe()
320 drm = drm_dev_alloc(&fsl_dcu_drm_driver, dev); in fsl_dcu_drm_probe()
326 fsl_dev->dev = dev; in fsl_dcu_drm_probe()
328 fsl_dev->np = dev->of_node; in fsl_dcu_drm_probe()
330 dev_set_drvdata(dev, fsl_dev); in fsl_dcu_drm_probe()