Lines Matching refs:drm
36 drm_err(&kmb->drm, "Failed to enable LCD clock: %d\n", ret); in kmb_display_clk_enable()
50 drm_err(&kmb->drm, "clk_get() failed clk_lcd\n"); in kmb_initialize_clocks()
56 drm_err(&kmb->drm, "clk_get() failed clk_pll0 "); in kmb_initialize_clocks()
60 drm_info(&kmb->drm, "system clk = %d Mhz", kmb->sys_clk_mhz); in kmb_initialize_clocks()
67 drm_err(&kmb->drm, "failed to set to clk_lcd to %d\n", in kmb_initialize_clocks()
71 drm_dbg(&kmb->drm, "clk_lcd = %ld\n", clk_get_rate(kmb->kmb_clk.clk_lcd)); in kmb_initialize_clocks()
79 drm_err(&kmb->drm, "failed to get msscam syscon"); in kmb_initialize_clocks()
94 static void __iomem *kmb_map_mmio(struct drm_device *drm, in kmb_map_mmio() argument
103 drm_err(drm, "failed to get resource for %s", name); in kmb_map_mmio()
106 mem = devm_ioremap_resource(drm->dev, res); in kmb_map_mmio()
108 drm_err(drm, "failed to ioremap %s registers", name); in kmb_map_mmio()
112 static int kmb_hw_init(struct drm_device *drm, unsigned long flags) in kmb_hw_init() argument
114 struct kmb_drm_private *kmb = to_kmb(drm); in kmb_hw_init()
115 struct platform_device *pdev = to_platform_device(drm->dev); in kmb_hw_init()
120 kmb->lcd_mmio = kmb_map_mmio(drm, pdev, "lcd"); in kmb_hw_init()
122 drm_err(&kmb->drm, "failed to map LCD registers\n"); in kmb_hw_init()
143 drm_err(&kmb->drm, "irq_lcd not found"); in kmb_hw_init()
148 ret = of_reserved_mem_device_init(drm->dev); in kmb_hw_init()
159 of_reserved_mem_device_release(drm->dev); in kmb_hw_init()
170 static int kmb_setup_mode_config(struct drm_device *drm) in kmb_setup_mode_config() argument
173 struct kmb_drm_private *kmb = to_kmb(drm); in kmb_setup_mode_config()
175 ret = drmm_mode_config_init(drm); in kmb_setup_mode_config()
178 drm->mode_config.min_width = KMB_FB_MIN_WIDTH; in kmb_setup_mode_config()
179 drm->mode_config.min_height = KMB_FB_MIN_HEIGHT; in kmb_setup_mode_config()
180 drm->mode_config.max_width = KMB_FB_MAX_WIDTH; in kmb_setup_mode_config()
181 drm->mode_config.max_height = KMB_FB_MAX_HEIGHT; in kmb_setup_mode_config()
182 drm->mode_config.preferred_depth = 24; in kmb_setup_mode_config()
183 drm->mode_config.funcs = &kmb_mode_config_funcs; in kmb_setup_mode_config()
185 ret = kmb_setup_crtc(drm); in kmb_setup_mode_config()
187 drm_err(drm, "failed to create crtc\n"); in kmb_setup_mode_config()
190 ret = kmb_dsi_encoder_init(drm, kmb->kmb_dsi); in kmb_setup_mode_config()
192 kmb->crtc.port = of_graph_get_port_by_id(drm->dev->of_node, 0); in kmb_setup_mode_config()
193 ret = drm_vblank_init(drm, drm->mode_config.num_crtc); in kmb_setup_mode_config()
195 drm_err(drm, "failed to initialize vblank\n"); in kmb_setup_mode_config()
196 pm_runtime_disable(drm->dev); in kmb_setup_mode_config()
200 drm_mode_config_reset(drm); in kmb_setup_mode_config()
312 drm_info(&kmb->drm, in handle_lcd_irq()
332 drm_dbg(&kmb->drm, in handle_lcd_irq()
335 drm_dbg(&kmb->drm, in handle_lcd_irq()
338 drm_dbg(&kmb->drm, in handle_lcd_irq()
346 drm_info(&kmb->drm, in handle_lcd_irq()
366 drm_dbg(&kmb->drm, in handle_lcd_irq()
369 drm_dbg(&kmb->drm, in handle_lcd_irq()
372 drm_dbg(&kmb->drm, in handle_lcd_irq()
377 drm_dbg(&kmb->drm, in handle_lcd_irq()
380 drm_dbg(&kmb->drm, in handle_lcd_irq()
385 drm_dbg(&kmb->drm, in handle_lcd_irq()
388 drm_dbg(&kmb->drm, in handle_lcd_irq()
413 static void kmb_irq_reset(struct drm_device *drm) in kmb_irq_reset() argument
415 kmb_write_lcd(to_kmb(drm), LCD_INT_CLEAR, 0xFFFF); in kmb_irq_reset()
416 kmb_write_lcd(to_kmb(drm), LCD_INT_ENABLE, 0); in kmb_irq_reset()
419 static int kmb_irq_install(struct drm_device *drm, unsigned int irq) in kmb_irq_install() argument
424 kmb_irq_reset(drm); in kmb_irq_install()
426 return request_irq(irq, kmb_isr, 0, drm->driver->name, drm); in kmb_irq_install()
429 static void kmb_irq_uninstall(struct drm_device *drm) in kmb_irq_uninstall() argument
431 struct kmb_drm_private *kmb = to_kmb(drm); in kmb_irq_uninstall()
433 kmb_irq_reset(drm); in kmb_irq_uninstall()
434 free_irq(kmb->irq_lcd, drm); in kmb_irq_uninstall()
456 struct drm_device *drm = dev_get_drvdata(dev); in kmb_remove() local
457 struct kmb_drm_private *kmb = to_kmb(drm); in kmb_remove()
459 drm_dev_unregister(drm); in kmb_remove()
460 drm_kms_helper_poll_fini(drm); in kmb_remove()
463 pm_runtime_get_sync(drm->dev); in kmb_remove()
464 kmb_irq_uninstall(drm); in kmb_remove()
465 pm_runtime_put_sync(drm->dev); in kmb_remove()
466 pm_runtime_disable(drm->dev); in kmb_remove()
468 of_reserved_mem_device_release(drm->dev); in kmb_remove()
477 drm_atomic_helper_shutdown(drm); in kmb_remove()
529 struct kmb_drm_private, drm); in kmb_probe()
533 dev_set_drvdata(dev, &kmb->drm); in kmb_probe()
538 drm_err(&kmb->drm, "failed to initialize DSI\n"); in kmb_probe()
545 ret = kmb_hw_init(&kmb->drm, 0); in kmb_probe()
549 ret = kmb_setup_mode_config(&kmb->drm); in kmb_probe()
553 ret = kmb_irq_install(&kmb->drm, kmb->irq_lcd); in kmb_probe()
555 drm_err(&kmb->drm, "failed to install IRQ handler\n"); in kmb_probe()
559 drm_kms_helper_poll_init(&kmb->drm); in kmb_probe()
562 ret = drm_dev_register(&kmb->drm, 0); in kmb_probe()
566 drm_client_setup(&kmb->drm, NULL); in kmb_probe()
571 drm_kms_helper_poll_fini(&kmb->drm); in kmb_probe()
573 pm_runtime_disable(kmb->drm.dev); in kmb_probe()
576 drm_mode_config_cleanup(&kmb->drm); in kmb_probe()
593 struct drm_device *drm = dev_get_drvdata(dev); in kmb_pm_suspend() local
594 struct kmb_drm_private *kmb = to_kmb(drm); in kmb_pm_suspend()
596 drm_kms_helper_poll_disable(drm); in kmb_pm_suspend()
598 kmb->state = drm_atomic_helper_suspend(drm); in kmb_pm_suspend()
600 drm_kms_helper_poll_enable(drm); in kmb_pm_suspend()
609 struct drm_device *drm = dev_get_drvdata(dev); in kmb_pm_resume() local
610 struct kmb_drm_private *kmb = drm ? to_kmb(drm) : NULL; in kmb_pm_resume()
615 drm_atomic_helper_resume(drm, kmb->state); in kmb_pm_resume()
616 drm_kms_helper_poll_enable(drm); in kmb_pm_resume()