rcar_du_encoder.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * rcar_du_encoder.h -- R-Car Display Unit 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_ENCODER_H__
  14. #define __RCAR_DU_ENCODER_H__
  15. #include <drm/drm_crtc.h>
  16. #include <drm/drm_encoder_slave.h>
  17. struct rcar_du_device;
  18. struct rcar_du_hdmienc;
  19. struct rcar_du_lvdsenc;
  20. enum rcar_du_encoder_type {
  21. RCAR_DU_ENCODER_UNUSED = 0,
  22. RCAR_DU_ENCODER_NONE,
  23. RCAR_DU_ENCODER_VGA,
  24. RCAR_DU_ENCODER_LVDS,
  25. RCAR_DU_ENCODER_HDMI,
  26. };
  27. struct rcar_du_encoder {
  28. struct drm_encoder_slave slave;
  29. enum rcar_du_output output;
  30. struct rcar_du_hdmienc *hdmi;
  31. struct rcar_du_lvdsenc *lvds;
  32. };
  33. #define to_rcar_encoder(e) \
  34. container_of(e, struct rcar_du_encoder, slave.base)
  35. #define rcar_encoder_to_drm_encoder(e) (&(e)->slave.base)
  36. struct rcar_du_connector {
  37. struct drm_connector connector;
  38. struct rcar_du_encoder *encoder;
  39. };
  40. #define to_rcar_connector(c) \
  41. container_of(c, struct rcar_du_connector, connector)
  42. struct drm_encoder *
  43. rcar_du_connector_best_encoder(struct drm_connector *connector);
  44. int rcar_du_encoder_init(struct rcar_du_device *rcdu,
  45. enum rcar_du_encoder_type type,
  46. enum rcar_du_output output,
  47. struct device_node *enc_node,
  48. struct device_node *con_node);
  49. #endif /* __RCAR_DU_ENCODER_H__ */