mxsfb_drv.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2016 Marek Vasut <marex@denx.de>
  3. *
  4. * i.MX23/i.MX28/i.MX6SX MXSFB LCD controller driver.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  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. #ifndef __MXSFB_DRV_H__
  16. #define __MXSFB_DRV_H__
  17. struct mxsfb_devdata {
  18. unsigned int transfer_count;
  19. unsigned int cur_buf;
  20. unsigned int next_buf;
  21. unsigned int debug0;
  22. unsigned int hs_wdth_mask;
  23. unsigned int hs_wdth_shift;
  24. unsigned int ipversion;
  25. };
  26. struct mxsfb_drm_private {
  27. const struct mxsfb_devdata *devdata;
  28. void __iomem *base; /* registers */
  29. struct clk *clk;
  30. struct clk *clk_axi;
  31. struct clk *clk_disp_axi;
  32. struct drm_simple_display_pipe pipe;
  33. struct drm_connector connector;
  34. struct drm_panel *panel;
  35. struct drm_fbdev_cma *fbdev;
  36. };
  37. int mxsfb_setup_crtc(struct drm_device *dev);
  38. int mxsfb_create_output(struct drm_device *dev);
  39. void mxsfb_enable_axi_clk(struct mxsfb_drm_private *mxsfb);
  40. void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb);
  41. void mxsfb_crtc_enable(struct mxsfb_drm_private *mxsfb);
  42. void mxsfb_crtc_disable(struct mxsfb_drm_private *mxsfb);
  43. void mxsfb_plane_atomic_update(struct mxsfb_drm_private *mxsfb,
  44. struct drm_plane_state *state);
  45. #endif /* __MXSFB_DRV_H__ */