Lines Matching refs:hdlcd
38 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_load() local
44 hdlcd->clk = devm_clk_get(drm->dev, "pxlclk"); in hdlcd_load()
45 if (IS_ERR(hdlcd->clk)) in hdlcd_load()
46 return PTR_ERR(hdlcd->clk); in hdlcd_load()
49 atomic_set(&hdlcd->buffer_underrun_count, 0); in hdlcd_load()
50 atomic_set(&hdlcd->bus_error_count, 0); in hdlcd_load()
51 atomic_set(&hdlcd->vsync_count, 0); in hdlcd_load()
52 atomic_set(&hdlcd->dma_end_count, 0); in hdlcd_load()
56 hdlcd->mmio = devm_ioremap_resource(drm->dev, res); in hdlcd_load()
57 if (IS_ERR(hdlcd->mmio)) { in hdlcd_load()
59 ret = PTR_ERR(hdlcd->mmio); in hdlcd_load()
60 hdlcd->mmio = NULL; in hdlcd_load()
64 version = hdlcd_read(hdlcd, HDLCD_REG_VERSION); in hdlcd_load()
97 drm_crtc_cleanup(&hdlcd->crtc); in hdlcd_load()
124 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_irq() local
127 irq_status = hdlcd_read(hdlcd, HDLCD_REG_INT_STATUS); in hdlcd_irq()
131 atomic_inc(&hdlcd->buffer_underrun_count); in hdlcd_irq()
134 atomic_inc(&hdlcd->dma_end_count); in hdlcd_irq()
137 atomic_inc(&hdlcd->bus_error_count); in hdlcd_irq()
140 atomic_inc(&hdlcd->vsync_count); in hdlcd_irq()
144 drm_crtc_handle_vblank(&hdlcd->crtc); in hdlcd_irq()
147 hdlcd_write(hdlcd, HDLCD_REG_INT_CLEAR, irq_status); in hdlcd_irq()
154 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_irq_preinstall() local
156 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, 0); in hdlcd_irq_preinstall()
157 hdlcd_write(hdlcd, HDLCD_REG_INT_CLEAR, ~0); in hdlcd_irq_preinstall()
163 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_irq_postinstall() local
164 unsigned long irq_mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK); in hdlcd_irq_postinstall()
169 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, irq_mask); in hdlcd_irq_postinstall()
176 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_irq_uninstall() local
178 unsigned long irq_mask = hdlcd_read(hdlcd, HDLCD_REG_INT_MASK); in hdlcd_irq_uninstall()
188 hdlcd_write(hdlcd, HDLCD_REG_INT_MASK, irq_mask); in hdlcd_irq_uninstall()
196 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_show_underrun_count() local
198 seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count)); in hdlcd_show_underrun_count()
199 seq_printf(m, "dma_end : %d\n", atomic_read(&hdlcd->dma_end_count)); in hdlcd_show_underrun_count()
200 seq_printf(m, "bus_error: %d\n", atomic_read(&hdlcd->bus_error_count)); in hdlcd_show_underrun_count()
201 seq_printf(m, "vsync : %d\n", atomic_read(&hdlcd->vsync_count)); in hdlcd_show_underrun_count()
209 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_show_pxlclock() local
210 unsigned long clkrate = clk_get_rate(hdlcd->clk); in hdlcd_show_pxlclock()
211 unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000; in hdlcd_show_pxlclock()
268 struct hdlcd_drm_private *hdlcd; in hdlcd_drm_bind() local
271 hdlcd = devm_kzalloc(dev, sizeof(*hdlcd), GFP_KERNEL); in hdlcd_drm_bind()
272 if (!hdlcd) in hdlcd_drm_bind()
279 drm->dev_private = hdlcd; in hdlcd_drm_bind()
288 hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0); in hdlcd_drm_bind()
331 of_node_put(hdlcd->crtc.port); in hdlcd_drm_bind()
332 hdlcd->crtc.port = NULL; in hdlcd_drm_bind()
346 struct hdlcd_drm_private *hdlcd = drm->dev_private; in hdlcd_drm_unbind() local
352 of_node_put(hdlcd->crtc.port); in hdlcd_drm_unbind()
353 hdlcd->crtc.port = NULL; in hdlcd_drm_unbind()
355 drm_crtc_vblank_off(&hdlcd->crtc); in hdlcd_drm_unbind()