zx_vou.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2016 Linaro Ltd.
  3. * Copyright 2016 ZTE Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. */
  10. #ifndef __ZX_VOU_H__
  11. #define __ZX_VOU_H__
  12. #define VOU_CRTC_MASK 0x3
  13. /* VOU output interfaces */
  14. enum vou_inf_id {
  15. VOU_HDMI = 0,
  16. VOU_RGB_LCD = 1,
  17. VOU_TV_ENC = 2,
  18. VOU_MIPI_DSI = 3,
  19. VOU_LVDS = 4,
  20. VOU_VGA = 5,
  21. };
  22. enum vou_inf_hdmi_audio {
  23. VOU_HDMI_AUD_SPDIF = BIT(0),
  24. VOU_HDMI_AUD_I2S = BIT(1),
  25. VOU_HDMI_AUD_DSD = BIT(2),
  26. VOU_HDMI_AUD_HBR = BIT(3),
  27. VOU_HDMI_AUD_PARALLEL = BIT(4),
  28. };
  29. void vou_inf_hdmi_audio_sel(struct drm_crtc *crtc,
  30. enum vou_inf_hdmi_audio aud);
  31. void vou_inf_enable(enum vou_inf_id id, struct drm_crtc *crtc);
  32. void vou_inf_disable(enum vou_inf_id id, struct drm_crtc *crtc);
  33. enum vou_div_id {
  34. VOU_DIV_VGA,
  35. VOU_DIV_PIC,
  36. VOU_DIV_TVENC,
  37. VOU_DIV_HDMI_PNX,
  38. VOU_DIV_HDMI,
  39. VOU_DIV_INF,
  40. VOU_DIV_LAYER,
  41. };
  42. enum vou_div_val {
  43. VOU_DIV_1 = 0,
  44. VOU_DIV_2 = 1,
  45. VOU_DIV_4 = 3,
  46. VOU_DIV_8 = 7,
  47. };
  48. struct vou_div_config {
  49. enum vou_div_id id;
  50. enum vou_div_val val;
  51. };
  52. void zx_vou_config_dividers(struct drm_crtc *crtc,
  53. struct vou_div_config *configs, int num);
  54. void zx_vou_layer_enable(struct drm_plane *plane);
  55. void zx_vou_layer_disable(struct drm_plane *plane);
  56. #endif /* __ZX_VOU_H__ */