Lines Matching refs:hdlcd

43 	struct hdlcd_drm_private *hdlcd = arg;  in hdlcd_irq()  local
46 irq_status = hdlcd_read(hdlcd, HDLCD_REG_INT_STATUS); in hdlcd_irq()
50 atomic_inc(&hdlcd->buffer_underrun_count); in hdlcd_irq()
53 atomic_inc(&hdlcd->dma_end_count); in hdlcd_irq()
56 atomic_inc(&hdlcd->bus_error_count); in hdlcd_irq()
59 atomic_inc(&hdlcd->vsync_count); in hdlcd_irq()
63 drm_crtc_handle_vblank(&hdlcd->crtc); in hdlcd_irq()
66 hdlcd_write(hdlcd, HDLCD_REG_INT_CLEAR, irq_status); in hdlcd_irq()
71 static int hdlcd_irq_install(struct hdlcd_drm_private *hdlcd) in hdlcd_irq_install() argument
76 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, 0); in hdlcd_irq_install()
77 hdlcd_write(hdlcd, HDLCD_REG_INT_CLEAR, ~0); in hdlcd_irq_install()
79 ret = request_irq(hdlcd->irq, hdlcd_irq, 0, "hdlcd", hdlcd); in hdlcd_irq_install()
85 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, HDLCD_DEBUG_INT_MASK); in hdlcd_irq_install()
91 static void hdlcd_irq_uninstall(struct hdlcd_drm_private *hdlcd) in hdlcd_irq_uninstall() argument
94 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, 0); in hdlcd_irq_uninstall()
96 free_irq(hdlcd->irq, hdlcd); in hdlcd_irq_uninstall()
101 struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); in hdlcd_load() local
106 hdlcd->clk = devm_clk_get(drm->dev, "pxlclk"); in hdlcd_load()
107 if (IS_ERR(hdlcd->clk)) in hdlcd_load()
108 return PTR_ERR(hdlcd->clk); in hdlcd_load()
111 atomic_set(&hdlcd->buffer_underrun_count, 0); in hdlcd_load()
112 atomic_set(&hdlcd->bus_error_count, 0); in hdlcd_load()
113 atomic_set(&hdlcd->vsync_count, 0); in hdlcd_load()
114 atomic_set(&hdlcd->dma_end_count, 0); in hdlcd_load()
117 hdlcd->mmio = devm_platform_ioremap_resource(pdev, 0); in hdlcd_load()
118 if (IS_ERR(hdlcd->mmio)) { in hdlcd_load()
120 ret = PTR_ERR(hdlcd->mmio); in hdlcd_load()
121 hdlcd->mmio = NULL; in hdlcd_load()
125 version = hdlcd_read(hdlcd, HDLCD_REG_VERSION); in hdlcd_load()
152 hdlcd->irq = ret; in hdlcd_load()
154 ret = hdlcd_irq_install(hdlcd); in hdlcd_load()
163 drm_crtc_cleanup(&hdlcd->crtc); in hdlcd_load()
198 struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); in hdlcd_show_underrun_count() local
200 seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count)); in hdlcd_show_underrun_count()
201 seq_printf(m, "dma_end : %d\n", atomic_read(&hdlcd->dma_end_count)); in hdlcd_show_underrun_count()
202 seq_printf(m, "bus_error: %d\n", atomic_read(&hdlcd->bus_error_count)); in hdlcd_show_underrun_count()
203 seq_printf(m, "vsync : %d\n", atomic_read(&hdlcd->vsync_count)); in hdlcd_show_underrun_count()
211 struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); in hdlcd_show_pxlclock() local
212 unsigned long clkrate = clk_get_rate(hdlcd->clk); in hdlcd_show_pxlclock()
213 unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000; in hdlcd_show_pxlclock()
242 struct hdlcd_drm_private *hdlcd; in hdlcd_drm_bind() local
245 hdlcd = devm_drm_dev_alloc(dev, &hdlcd_driver, typeof(*hdlcd), base); in hdlcd_drm_bind()
246 if (IS_ERR(hdlcd)) in hdlcd_drm_bind()
247 return PTR_ERR(hdlcd); in hdlcd_drm_bind()
249 drm = &hdlcd->base; in hdlcd_drm_bind()
262 hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0); in hdlcd_drm_bind()
286 if (hdlcd_read(hdlcd, HDLCD_REG_COMMAND)) { in hdlcd_drm_bind()
287 hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0); in hdlcd_drm_bind()
314 of_node_put(hdlcd->crtc.port); in hdlcd_drm_bind()
315 hdlcd->crtc.port = NULL; in hdlcd_drm_bind()
316 hdlcd_irq_uninstall(hdlcd); in hdlcd_drm_bind()
326 struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm); in hdlcd_drm_unbind() local
331 of_node_put(hdlcd->crtc.port); in hdlcd_drm_unbind()
332 hdlcd->crtc.port = NULL; in hdlcd_drm_unbind()
335 hdlcd_irq_uninstall(hdlcd); in hdlcd_drm_unbind()