dw_mipi_dsi.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) STMicroelectronics SA 2017
  3. *
  4. * Authors: Philippe Cornu <philippe.cornu@st.com>
  5. * Yannick Fertre <yannick.fertre@st.com>
  6. *
  7. * License terms: GNU General Public License (GPL), version 2
  8. */
  9. #ifndef __DW_MIPI_DSI__
  10. #define __DW_MIPI_DSI__
  11. struct dw_mipi_dsi;
  12. struct dw_mipi_dsi_phy_ops {
  13. int (*init)(void *priv_data);
  14. int (*get_lane_mbps)(void *priv_data, struct drm_display_mode *mode,
  15. unsigned long mode_flags, u32 lanes, u32 format,
  16. unsigned int *lane_mbps);
  17. };
  18. struct dw_mipi_dsi_plat_data {
  19. void __iomem *base;
  20. unsigned int max_data_lanes;
  21. enum drm_mode_status (*mode_valid)(void *priv_data,
  22. const struct drm_display_mode *mode);
  23. const struct dw_mipi_dsi_phy_ops *phy_ops;
  24. void *priv_data;
  25. };
  26. struct dw_mipi_dsi *dw_mipi_dsi_probe(struct platform_device *pdev,
  27. const struct dw_mipi_dsi_plat_data
  28. *plat_data);
  29. void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi);
  30. struct dw_mipi_dsi *dw_mipi_dsi_bind(struct platform_device *pdev,
  31. struct drm_encoder *encoder,
  32. const struct dw_mipi_dsi_plat_data
  33. *plat_data);
  34. void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi);
  35. #endif /* __DW_MIPI_DSI__ */