arcpgu.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * ARC PGU DRM driver.
  3. *
  4. * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com)
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. */
  16. #ifndef _ARCPGU_H_
  17. #define _ARCPGU_H_
  18. struct arcpgu_drm_private {
  19. void __iomem *regs;
  20. struct clk *clk;
  21. struct drm_fbdev_cma *fbdev;
  22. struct drm_framebuffer *fb;
  23. struct list_head event_list;
  24. struct drm_crtc crtc;
  25. struct drm_plane *plane;
  26. };
  27. #define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)
  28. static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
  29. unsigned int reg, u32 value)
  30. {
  31. iowrite32(value, arcpgu->regs + reg);
  32. }
  33. static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
  34. unsigned int reg)
  35. {
  36. return ioread32(arcpgu->regs + reg);
  37. }
  38. int arc_pgu_setup_crtc(struct drm_device *dev);
  39. int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
  40. struct drm_fbdev_cma *arcpgu_fbdev_cma_init(struct drm_device *dev,
  41. unsigned int preferred_bpp, unsigned int num_crtc,
  42. unsigned int max_conn_count);
  43. #endif