Lines Matching refs:hdlcd

43 	struct hdlcd_drm_private *hdlcd = drm->dev_private;  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()
73 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_irq_preinstall() local
75 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, 0); in hdlcd_irq_preinstall()
76 hdlcd_write(hdlcd, HDLCD_REG_INT_CLEAR, ~0); in hdlcd_irq_preinstall()
82 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_irq_postinstall() local
83 unsigned long irq_mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK); in hdlcd_irq_postinstall()
88 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, irq_mask); in hdlcd_irq_postinstall()
112 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_irq_uninstall() local
114 unsigned long irq_mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK); in hdlcd_irq_uninstall()
123 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, irq_mask); in hdlcd_irq_uninstall()
125 free_irq(hdlcd->irq, drm); in hdlcd_irq_uninstall()
130 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_load() local
136 hdlcd->clk = devm_clk_get(drm->dev, "pxlclk"); in hdlcd_load()
137 if (IS_ERR(hdlcd->clk)) in hdlcd_load()
138 return PTR_ERR(hdlcd->clk); in hdlcd_load()
141 atomic_set(&hdlcd->buffer_underrun_count, 0); in hdlcd_load()
142 atomic_set(&hdlcd->bus_error_count, 0); in hdlcd_load()
143 atomic_set(&hdlcd->vsync_count, 0); in hdlcd_load()
144 atomic_set(&hdlcd->dma_end_count, 0); in hdlcd_load()
148 hdlcd->mmio = devm_ioremap_resource(drm->dev, res); in hdlcd_load()
149 if (IS_ERR(hdlcd->mmio)) { in hdlcd_load()
151 ret = PTR_ERR(hdlcd->mmio); in hdlcd_load()
152 hdlcd->mmio = NULL; in hdlcd_load()
156 version = hdlcd_read(hdlcd, HDLCD_REG_VERSION); in hdlcd_load()
183 hdlcd->irq = ret; in hdlcd_load()
185 ret = hdlcd_irq_install(drm, hdlcd->irq); in hdlcd_load()
194 drm_crtc_cleanup(&hdlcd->crtc); in hdlcd_load()
222 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_show_underrun_count() local
224 seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count)); in hdlcd_show_underrun_count()
225 seq_printf(m, "dma_end : %d\n", atomic_read(&hdlcd->dma_end_count)); in hdlcd_show_underrun_count()
226 seq_printf(m, "bus_error: %d\n", atomic_read(&hdlcd->bus_error_count)); in hdlcd_show_underrun_count()
227 seq_printf(m, "vsync : %d\n", atomic_read(&hdlcd->vsync_count)); in hdlcd_show_underrun_count()
235 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_show_pxlclock() local
236 unsigned long clkrate = clk_get_rate(hdlcd->clk); in hdlcd_show_pxlclock()
237 unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000; in hdlcd_show_pxlclock()
276 struct hdlcd_drm_private *hdlcd; in hdlcd_drm_bind() local
279 hdlcd = devm_kzalloc(dev, sizeof(*hdlcd), GFP_KERNEL); in hdlcd_drm_bind()
280 if (!hdlcd) in hdlcd_drm_bind()
287 drm->dev_private = hdlcd; in hdlcd_drm_bind()
296 hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0); in hdlcd_drm_bind()
335 of_node_put(hdlcd->crtc.port); in hdlcd_drm_bind()
336 hdlcd->crtc.port = NULL; in hdlcd_drm_bind()
350 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_drm_unbind() local
355 of_node_put(hdlcd->crtc.port); in hdlcd_drm_unbind()
356 hdlcd->crtc.port = NULL; in hdlcd_drm_unbind()