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 10 #ifndef __DW_MIPI_DSI__ 11 #define __DW_MIPI_DSI__ 12 13 struct dw_mipi_dsi; 14 15 struct dw_mipi_dsi_phy_ops { 16 int (*init)(void *priv_data); 17 int (*get_lane_mbps)(void *priv_data, struct drm_display_mode *mode, 18 unsigned long mode_flags, u32 lanes, u32 format, 19 unsigned int *lane_mbps); 20 }; 21 22 struct dw_mipi_dsi_host_ops { 23 int (*attach)(void *priv_data, 24 struct mipi_dsi_device *dsi); 25 int (*detach)(void *priv_data, 26 struct mipi_dsi_device *dsi); 27 }; 28 29 struct dw_mipi_dsi_plat_data { 30 void __iomem *base; 31 unsigned int max_data_lanes; 32 33 enum drm_mode_status (*mode_valid)(void *priv_data, 34 const struct drm_display_mode *mode); 35 36 const struct dw_mipi_dsi_phy_ops *phy_ops; 37 const struct dw_mipi_dsi_host_ops *host_ops; 38 39 void *priv_data; 40 }; 41 42 struct dw_mipi_dsi *dw_mipi_dsi_probe(struct platform_device *pdev, 43 const struct dw_mipi_dsi_plat_data 44 *plat_data); 45 void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi); 46 int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder); 47 void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi); 48 void dw_mipi_dsi_set_slave(struct dw_mipi_dsi *dsi, struct dw_mipi_dsi *slave); 49 50 #endif /* __DW_MIPI_DSI__ */ 51