hdlcd_drv.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * ARM HDLCD Controller register definition
  3. */
  4. #ifndef __HDLCD_DRV_H__
  5. #define __HDLCD_DRV_H__
  6. struct hdlcd_drm_private {
  7. void __iomem *mmio;
  8. struct clk *clk;
  9. struct drm_fbdev_cma *fbdev;
  10. struct drm_framebuffer *fb;
  11. struct list_head event_list;
  12. struct drm_crtc crtc;
  13. struct drm_plane *plane;
  14. #ifdef CONFIG_DEBUG_FS
  15. atomic_t buffer_underrun_count;
  16. atomic_t bus_error_count;
  17. atomic_t vsync_count;
  18. atomic_t dma_end_count;
  19. #endif
  20. };
  21. #define crtc_to_hdlcd_priv(x) container_of(x, struct hdlcd_drm_private, crtc)
  22. static inline void hdlcd_write(struct hdlcd_drm_private *hdlcd,
  23. unsigned int reg, u32 value)
  24. {
  25. writel(value, hdlcd->mmio + reg);
  26. }
  27. static inline u32 hdlcd_read(struct hdlcd_drm_private *hdlcd, unsigned int reg)
  28. {
  29. return readl(hdlcd->mmio + reg);
  30. }
  31. int hdlcd_setup_crtc(struct drm_device *dev);
  32. void hdlcd_set_scanout(struct hdlcd_drm_private *hdlcd);
  33. void hdlcd_crtc_suspend(struct drm_crtc *crtc);
  34. void hdlcd_crtc_resume(struct drm_crtc *crtc);
  35. #endif /* __HDLCD_DRV_H__ */