rcar_du_lvdsenc.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * rcar_du_lvdsenc.h -- R-Car Display Unit LVDS Encoder
  3. *
  4. * Copyright (C) 2013-2014 Renesas Electronics Corporation
  5. *
  6. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef __RCAR_DU_LVDSENC_H__
  14. #define __RCAR_DU_LVDSENC_H__
  15. #include <linux/io.h>
  16. #include <linux/module.h>
  17. struct rcar_drm_crtc;
  18. struct rcar_du_lvdsenc;
  19. enum rcar_lvds_input {
  20. RCAR_LVDS_INPUT_DU0,
  21. RCAR_LVDS_INPUT_DU1,
  22. RCAR_LVDS_INPUT_DU2,
  23. };
  24. /* Keep in sync with the LVDCR0.LVMD hardware register values. */
  25. enum rcar_lvds_mode {
  26. RCAR_LVDS_MODE_JEIDA = 0,
  27. RCAR_LVDS_MODE_MIRROR = 1,
  28. RCAR_LVDS_MODE_VESA = 4,
  29. };
  30. #if IS_ENABLED(CONFIG_DRM_RCAR_LVDS)
  31. int rcar_du_lvdsenc_init(struct rcar_du_device *rcdu);
  32. void rcar_du_lvdsenc_set_mode(struct rcar_du_lvdsenc *lvds,
  33. enum rcar_lvds_mode mode);
  34. int rcar_du_lvdsenc_enable(struct rcar_du_lvdsenc *lvds,
  35. struct drm_crtc *crtc, bool enable);
  36. void rcar_du_lvdsenc_atomic_check(struct rcar_du_lvdsenc *lvds,
  37. struct drm_display_mode *mode);
  38. #else
  39. static inline int rcar_du_lvdsenc_init(struct rcar_du_device *rcdu)
  40. {
  41. return 0;
  42. }
  43. static inline void rcar_du_lvdsenc_set_mode(struct rcar_du_lvdsenc *lvds,
  44. enum rcar_lvds_mode mode)
  45. {
  46. }
  47. static inline int rcar_du_lvdsenc_enable(struct rcar_du_lvdsenc *lvds,
  48. struct drm_crtc *crtc, bool enable)
  49. {
  50. return 0;
  51. }
  52. static inline void rcar_du_lvdsenc_atomic_check(struct rcar_du_lvdsenc *lvds,
  53. struct drm_display_mode *mode)
  54. {
  55. }
  56. #endif
  57. #endif /* __RCAR_DU_LVDSENC_H__ */