hdlcd_drv.h 900 B

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