sti_compositor.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (C) STMicroelectronics SA 2014
  3. * Authors: Benjamin Gaignard <benjamin.gaignard@st.com>
  4. * Fabien Dessenne <fabien.dessenne@st.com>
  5. * for STMicroelectronics.
  6. * License terms: GNU General Public License (GPL), version 2
  7. */
  8. #ifndef _STI_COMPOSITOR_H_
  9. #define _STI_COMPOSITOR_H_
  10. #include <linux/clk.h>
  11. #include <linux/kernel.h>
  12. #include "sti_mixer.h"
  13. #include "sti_plane.h"
  14. #define WAIT_NEXT_VSYNC_MS 50 /*ms*/
  15. #define STI_MAX_MIXER 2
  16. #define STI_MAX_VID 1
  17. enum sti_compositor_subdev_type {
  18. STI_MIXER_MAIN_SUBDEV,
  19. STI_MIXER_AUX_SUBDEV,
  20. STI_GPD_SUBDEV,
  21. STI_VID_SUBDEV,
  22. STI_CURSOR_SUBDEV,
  23. };
  24. struct sti_compositor_subdev_descriptor {
  25. enum sti_compositor_subdev_type type;
  26. int id;
  27. unsigned int offset;
  28. };
  29. /**
  30. * STI Compositor data structure
  31. *
  32. * @nb_subdev: number of subdevices supported by the compositor
  33. * @subdev_desc: subdev list description
  34. */
  35. #define MAX_SUBDEV 9
  36. struct sti_compositor_data {
  37. unsigned int nb_subdev;
  38. struct sti_compositor_subdev_descriptor subdev_desc[MAX_SUBDEV];
  39. };
  40. /**
  41. * STI Compositor structure
  42. *
  43. * @dev: driver device
  44. * @regs: registers (main)
  45. * @data: device data
  46. * @clk_compo_main: clock for main compo
  47. * @clk_compo_aux: clock for aux compo
  48. * @clk_pix_main: pixel clock for main path
  49. * @clk_pix_aux: pixel clock for aux path
  50. * @rst_main: reset control of the main path
  51. * @rst_aux: reset control of the aux path
  52. * @mixer: array of mixers
  53. * @vid: array of vids
  54. * @vtg_main: vtg for main data path
  55. * @vtg_aux: vtg for auxillary data path
  56. * @vtg_vblank_nb: callback for VTG VSYNC notification
  57. */
  58. struct sti_compositor {
  59. struct device *dev;
  60. void __iomem *regs;
  61. struct sti_compositor_data data;
  62. struct clk *clk_compo_main;
  63. struct clk *clk_compo_aux;
  64. struct clk *clk_pix_main;
  65. struct clk *clk_pix_aux;
  66. struct reset_control *rst_main;
  67. struct reset_control *rst_aux;
  68. struct sti_mixer *mixer[STI_MAX_MIXER];
  69. struct sti_vid *vid[STI_MAX_VID];
  70. struct sti_vtg *vtg_main;
  71. struct sti_vtg *vtg_aux;
  72. struct notifier_block vtg_vblank_nb;
  73. };
  74. #endif