analogix_dp.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Analogix DP (Display Port) Core interface driver.
  3. *
  4. * Copyright (C) 2015 Rockchip Electronics Co., Ltd.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #ifndef _ANALOGIX_DP_H_
  12. #define _ANALOGIX_DP_H_
  13. #include <drm/drm_crtc.h>
  14. struct analogix_dp_device;
  15. enum analogix_dp_devtype {
  16. EXYNOS_DP,
  17. RK3288_DP,
  18. RK3399_EDP,
  19. };
  20. static inline bool is_rockchip(enum analogix_dp_devtype type)
  21. {
  22. return type == RK3288_DP || type == RK3399_EDP;
  23. }
  24. struct analogix_dp_plat_data {
  25. enum analogix_dp_devtype dev_type;
  26. struct drm_panel *panel;
  27. struct drm_encoder *encoder;
  28. struct drm_connector *connector;
  29. bool skip_connector;
  30. int (*power_on_start)(struct analogix_dp_plat_data *);
  31. int (*power_on_end)(struct analogix_dp_plat_data *);
  32. int (*power_off)(struct analogix_dp_plat_data *);
  33. int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *,
  34. struct drm_connector *);
  35. int (*get_modes)(struct analogix_dp_plat_data *,
  36. struct drm_connector *);
  37. };
  38. int analogix_dp_psr_enabled(struct analogix_dp_device *dp);
  39. int analogix_dp_enable_psr(struct analogix_dp_device *dp);
  40. int analogix_dp_disable_psr(struct analogix_dp_device *dp);
  41. int analogix_dp_resume(struct analogix_dp_device *dp);
  42. int analogix_dp_suspend(struct analogix_dp_device *dp);
  43. struct analogix_dp_device *
  44. analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
  45. struct analogix_dp_plat_data *plat_data);
  46. void analogix_dp_unbind(struct analogix_dp_device *dp);
  47. int analogix_dp_start_crc(struct drm_connector *connector);
  48. int analogix_dp_stop_crc(struct drm_connector *connector);
  49. #endif /* _ANALOGIX_DP_H_ */