diff options
author | Hai Li <hali@codeaurora.org> | 2015-05-15 13:04:05 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2015-06-11 13:11:04 -0400 |
commit | 9d32c4989c858af12b333ae9a3c160a91ff43934 (patch) | |
tree | ad5d91c6a4b2b91ca9d1e8e5a2c7742abe79a0ef /drivers/gpu/drm/msm/dsi/dsi.h | |
parent | 825637b9c06cede2a742421b0ea6f24428099af3 (diff) |
drm/msm/dsi: Enable PLL driver in MSM DSI
This change activates PLL driver for DSI to work with
common clock framework.
Signed-off-by: Hai Li <hali@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/dsi/dsi.h')
-rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi.h | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 321964a6b27e..8022814f7914 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h | |||
@@ -38,6 +38,13 @@ | |||
38 | #define DSI_ENCODER_MASTER DSI_1 | 38 | #define DSI_ENCODER_MASTER DSI_1 |
39 | #define DSI_ENCODER_SLAVE DSI_0 | 39 | #define DSI_ENCODER_SLAVE DSI_0 |
40 | 40 | ||
41 | enum msm_dsi_phy_type { | ||
42 | MSM_DSI_PHY_UNKNOWN, | ||
43 | MSM_DSI_PHY_28NM_HPM, | ||
44 | MSM_DSI_PHY_28NM_LP, | ||
45 | MSM_DSI_PHY_MAX | ||
46 | }; | ||
47 | |||
41 | struct msm_dsi { | 48 | struct msm_dsi { |
42 | struct drm_device *dev; | 49 | struct drm_device *dev; |
43 | struct platform_device *pdev; | 50 | struct platform_device *pdev; |
@@ -49,6 +56,8 @@ struct msm_dsi { | |||
49 | struct msm_dsi_phy *phy; | 56 | struct msm_dsi_phy *phy; |
50 | struct drm_panel *panel; | 57 | struct drm_panel *panel; |
51 | unsigned long panel_flags; | 58 | unsigned long panel_flags; |
59 | |||
60 | enum msm_dsi_phy_type phy_type; | ||
52 | bool phy_enabled; | 61 | bool phy_enabled; |
53 | 62 | ||
54 | /* the encoders we are hooked to (outside of dsi block) */ | 63 | /* the encoders we are hooked to (outside of dsi block) */ |
@@ -73,6 +82,29 @@ void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); | |||
73 | /* msm dsi */ | 82 | /* msm dsi */ |
74 | struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi); | 83 | struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi); |
75 | 84 | ||
85 | /* dsi pll */ | ||
86 | struct msm_dsi_pll; | ||
87 | #ifdef CONFIG_DRM_MSM_DSI_PLL | ||
88 | struct msm_dsi_pll *msm_dsi_pll_init(struct platform_device *pdev, | ||
89 | enum msm_dsi_phy_type type, int dsi_id); | ||
90 | void msm_dsi_pll_destroy(struct msm_dsi_pll *pll); | ||
91 | int msm_dsi_pll_get_clk_provider(struct msm_dsi_pll *pll, | ||
92 | struct clk **byte_clk_provider, struct clk **pixel_clk_provider); | ||
93 | #else | ||
94 | static inline struct msm_dsi_pll *msm_dsi_pll_init(struct platform_device *pdev, | ||
95 | enum msm_dsi_phy_type type, int id) { | ||
96 | return ERR_PTR(-ENODEV); | ||
97 | } | ||
98 | static inline void msm_dsi_pll_destroy(struct msm_dsi_pll *pll) | ||
99 | { | ||
100 | } | ||
101 | static inline int msm_dsi_pll_get_clk_provider(struct msm_dsi_pll *pll, | ||
102 | struct clk **byte_clk_provider, struct clk **pixel_clk_provider) | ||
103 | { | ||
104 | return -ENODEV; | ||
105 | } | ||
106 | #endif | ||
107 | |||
76 | /* dsi host */ | 108 | /* dsi host */ |
77 | int msm_dsi_host_xfer_prepare(struct mipi_dsi_host *host, | 109 | int msm_dsi_host_xfer_prepare(struct mipi_dsi_host *host, |
78 | const struct mipi_dsi_msg *msg); | 110 | const struct mipi_dsi_msg *msg); |
@@ -94,6 +126,8 @@ struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host, | |||
94 | unsigned long *panel_flags); | 126 | unsigned long *panel_flags); |
95 | int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer); | 127 | int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer); |
96 | void msm_dsi_host_unregister(struct mipi_dsi_host *host); | 128 | void msm_dsi_host_unregister(struct mipi_dsi_host *host); |
129 | int msm_dsi_host_set_src_pll(struct mipi_dsi_host *host, | ||
130 | struct msm_dsi_pll *src_pll); | ||
97 | void msm_dsi_host_destroy(struct mipi_dsi_host *host); | 131 | void msm_dsi_host_destroy(struct mipi_dsi_host *host); |
98 | int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, | 132 | int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, |
99 | struct drm_device *dev); | 133 | struct drm_device *dev); |
@@ -101,18 +135,15 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi); | |||
101 | 135 | ||
102 | /* dsi phy */ | 136 | /* dsi phy */ |
103 | struct msm_dsi_phy; | 137 | struct msm_dsi_phy; |
104 | enum msm_dsi_phy_type { | ||
105 | MSM_DSI_PHY_UNKNOWN, | ||
106 | MSM_DSI_PHY_28NM_HPM, | ||
107 | MSM_DSI_PHY_28NM_LP, | ||
108 | MSM_DSI_PHY_MAX | ||
109 | }; | ||
110 | struct msm_dsi_phy *msm_dsi_phy_init(struct platform_device *pdev, | 138 | struct msm_dsi_phy *msm_dsi_phy_init(struct platform_device *pdev, |
111 | enum msm_dsi_phy_type type, int id); | 139 | enum msm_dsi_phy_type type, int id); |
140 | void msm_dsi_phy_destroy(struct msm_dsi_phy *phy); | ||
112 | int msm_dsi_phy_enable(struct msm_dsi_phy *phy, bool is_dual_panel, | 141 | int msm_dsi_phy_enable(struct msm_dsi_phy *phy, bool is_dual_panel, |
113 | const unsigned long bit_rate, const unsigned long esc_rate); | 142 | const unsigned long bit_rate, const unsigned long esc_rate); |
114 | int msm_dsi_phy_disable(struct msm_dsi_phy *phy); | 143 | int msm_dsi_phy_disable(struct msm_dsi_phy *phy); |
115 | void msm_dsi_phy_get_clk_pre_post(struct msm_dsi_phy *phy, | 144 | void msm_dsi_phy_get_clk_pre_post(struct msm_dsi_phy *phy, |
116 | u32 *clk_pre, u32 *clk_post); | 145 | u32 *clk_pre, u32 *clk_post); |
146 | struct msm_dsi_pll *msm_dsi_phy_get_pll(struct msm_dsi_phy *phy); | ||
147 | |||
117 | #endif /* __DSI_CONNECTOR_H__ */ | 148 | #endif /* __DSI_CONNECTOR_H__ */ |
118 | 149 | ||