sti_compositor.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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_layer.h"
  13. #include "sti_mixer.h"
  14. #define WAIT_NEXT_VSYNC_MS 50 /*ms*/
  15. #define STI_MAX_LAYER 8
  16. #define STI_MAX_MIXER 2
  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. * @vtg_main: vtg for main data path
  54. * @vtg_aux: vtg for auxillary data path
  55. * @layer: array of layers
  56. * @nb_mixers: number of mixers for this compositor
  57. * @nb_layers: number of layers (GDP,VID,...) for this compositor
  58. * @vtg_vblank_nb: callback for VTG VSYNC notification
  59. */
  60. struct sti_compositor {
  61. struct device *dev;
  62. void __iomem *regs;
  63. struct sti_compositor_data data;
  64. struct clk *clk_compo_main;
  65. struct clk *clk_compo_aux;
  66. struct clk *clk_pix_main;
  67. struct clk *clk_pix_aux;
  68. struct reset_control *rst_main;
  69. struct reset_control *rst_aux;
  70. struct sti_mixer *mixer[STI_MAX_MIXER];
  71. struct sti_vtg *vtg_main;
  72. struct sti_vtg *vtg_aux;
  73. struct sti_layer *layer[STI_MAX_LAYER];
  74. int nb_mixers;
  75. int nb_layers;
  76. struct notifier_block vtg_vblank_nb;
  77. };
  78. #endif