mxsfb_drv.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2016 Marek Vasut <marex@denx.de>
  4. *
  5. * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver.
  6. */
  7. #ifndef __MXSFB_DRV_H__
  8. #define __MXSFB_DRV_H__
  9. #include <drm/drm_crtc.h>
  10. #include <drm/drm_device.h>
  11. #include <drm/drm_encoder.h>
  12. #include <drm/drm_plane.h>
  13. struct clk;
  14. struct mxsfb_devdata {
  15. unsigned int transfer_count;
  16. unsigned int cur_buf;
  17. unsigned int next_buf;
  18. unsigned int hs_wdth_mask;
  19. unsigned int hs_wdth_shift;
  20. bool has_overlay;
  21. bool has_ctrl2;
  22. bool has_crc32;
  23. };
  24. struct mxsfb_drm_private {
  25. const struct mxsfb_devdata *devdata;
  26. void __iomem *base; /* registers */
  27. struct clk *clk;
  28. struct clk *clk_axi;
  29. struct clk *clk_disp_axi;
  30. unsigned int irq;
  31. struct drm_device *drm;
  32. struct {
  33. struct drm_plane primary;
  34. struct drm_plane overlay;
  35. } planes;
  36. struct drm_crtc crtc;
  37. struct drm_encoder encoder;
  38. struct drm_connector *connector;
  39. struct drm_bridge *bridge;
  40. bool crc_active;
  41. };
  42. static inline struct mxsfb_drm_private *
  43. to_mxsfb_drm_private(struct drm_device *drm)
  44. {
  45. return drm->dev_private;
  46. }
  47. void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
  48. void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
  49. int mxsfb_kms_init(struct mxsfb_drm_private *mxsfb);
  50. #endif /* __MXSFB_DRV_H__ */