ltdc.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) STMicroelectronics SA 2017
  4. *
  5. * Authors: Philippe Cornu <philippe.cornu@st.com>
  6. * Yannick Fertre <yannick.fertre@st.com>
  7. * Fabien Dessenne <fabien.dessenne@st.com>
  8. * Mickael Reulier <mickael.reulier@st.com>
  9. */
  10. #ifndef _LTDC_H_
  11. #define _LTDC_H_
  12. struct ltdc_caps {
  13. u32 hw_version; /* hardware version */
  14. u32 nb_layers; /* number of supported layers */
  15. u32 reg_ofs; /* register offset for applicable regs */
  16. u32 bus_width; /* bus width (32 or 64 bits) */
  17. const u32 *pix_fmt_hw; /* supported pixel formats */
  18. bool non_alpha_only_l1; /* non-native no-alpha formats on layer 1 */
  19. int pad_max_freq_hz; /* max frequency supported by pad */
  20. };
  21. #define LTDC_MAX_LAYER 4
  22. struct fps_info {
  23. unsigned int counter;
  24. ktime_t last_timestamp;
  25. };
  26. struct ltdc_device {
  27. void __iomem *regs;
  28. struct clk *pixel_clk; /* lcd pixel clock */
  29. struct mutex err_lock; /* protecting error_status */
  30. struct ltdc_caps caps;
  31. u32 error_status;
  32. u32 irq_status;
  33. struct fps_info plane_fpsi[LTDC_MAX_LAYER];
  34. };
  35. int ltdc_load(struct drm_device *ddev);
  36. void ltdc_unload(struct drm_device *ddev);
  37. #endif