Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 1 | /* |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 2 | * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #ifndef _DSI_DISPLAY_H_ |
| 16 | #define _DSI_DISPLAY_H_ |
| 17 | |
| 18 | #include <linux/types.h> |
| 19 | #include <linux/bitops.h> |
Ajay Singh Parmar | 48ea427 | 2016-06-27 11:44:34 -0700 | [diff] [blame] | 20 | #include <linux/debugfs.h> |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 21 | #include <linux/of_device.h> |
| 22 | #include <drm/drmP.h> |
| 23 | #include <drm/drm_crtc.h> |
| 24 | |
Clarence Ip | a403932 | 2016-07-15 16:23:59 -0400 | [diff] [blame] | 25 | #include "msm_drv.h" |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 26 | #include "dsi_defs.h" |
| 27 | #include "dsi_ctrl.h" |
| 28 | #include "dsi_phy.h" |
| 29 | #include "dsi_panel.h" |
| 30 | |
| 31 | #define MAX_DSI_CTRLS_PER_DISPLAY 2 |
Shashank Babu Chinta Venkata | 74a03f1 | 2017-02-28 11:24:51 -0800 | [diff] [blame] | 32 | #define DSI_CLIENT_NAME_SIZE 20 |
Shashank Babu Chinta Venkata | ded9c56 | 2017-03-15 14:43:46 -0700 | [diff] [blame^] | 33 | #define DSI_DISPLAY_MAX_LEN 512 |
Ajay Singh Parmar | 62f795b | 2016-06-10 23:20:23 -0700 | [diff] [blame] | 34 | /* |
| 35 | * DSI Validate Mode modifiers |
| 36 | * @DSI_VALIDATE_FLAG_ALLOW_ADJUST: Allow mode validation to also do fixup |
| 37 | */ |
| 38 | #define DSI_VALIDATE_FLAG_ALLOW_ADJUST 0x1 |
| 39 | |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 40 | /** |
Shashank Babu Chinta Venkata | ded9c56 | 2017-03-15 14:43:46 -0700 | [diff] [blame^] | 41 | * enum dsi_display_selection_type - enumerates DSI display selection types |
| 42 | * @DSI_PRIMARY: primary DSI display selected from module parameter |
| 43 | * @DSI_SECONDARY: Secondary DSI display selected from module parameter |
| 44 | * @MAX_DSI_ACTIVE_DISPLAY: Maximum acive displays that can be selected |
| 45 | */ |
| 46 | enum dsi_display_selection_type { |
| 47 | DSI_PRIMARY = 0, |
| 48 | DSI_SECONDARY, |
| 49 | MAX_DSI_ACTIVE_DISPLAY, |
| 50 | }; |
| 51 | |
| 52 | /** |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 53 | * enum dsi_display_type - enumerates DSI display types |
| 54 | * @DSI_DISPLAY_SINGLE: A panel connected on a single DSI interface. |
| 55 | * @DSI_DISPLAY_EXT_BRIDGE: A bridge is connected between panel and DSI host. |
| 56 | * It utilizes a single DSI interface. |
| 57 | * @DSI_DISPLAY_SPLIT: A panel that utilizes more than one DSI |
| 58 | * interfaces. |
| 59 | * @DSI_DISPLAY_SPLIT_EXT_BRIDGE: A bridge is present between panel and DSI |
| 60 | * host. It utilizes more than one DSI interface. |
| 61 | */ |
| 62 | enum dsi_display_type { |
| 63 | DSI_DISPLAY_SINGLE = 0, |
| 64 | DSI_DISPLAY_EXT_BRIDGE, |
| 65 | DSI_DISPLAY_SPLIT, |
| 66 | DSI_DISPLAY_SPLIT_EXT_BRIDGE, |
| 67 | DSI_DISPLAY_MAX, |
| 68 | }; |
| 69 | |
| 70 | /** |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 71 | * struct dsi_display_ctrl - dsi ctrl/phy information for the display |
| 72 | * @ctrl: Handle to the DSI controller device. |
| 73 | * @ctrl_of_node: pHandle to the DSI controller device. |
| 74 | * @dsi_ctrl_idx: DSI controller instance id. |
| 75 | * @power_state: Current power state of the DSI controller. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 76 | * @phy: Handle to the DSI PHY device. |
| 77 | * @phy_of_node: pHandle to the DSI PHY device. |
| 78 | * @phy_enabled: PHY power status. |
| 79 | */ |
| 80 | struct dsi_display_ctrl { |
| 81 | /* controller info */ |
| 82 | struct dsi_ctrl *ctrl; |
| 83 | struct device_node *ctrl_of_node; |
| 84 | u32 dsi_ctrl_idx; |
| 85 | |
| 86 | enum dsi_power_state power_state; |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 87 | |
| 88 | /* phy info */ |
| 89 | struct msm_dsi_phy *phy; |
| 90 | struct device_node *phy_of_node; |
| 91 | |
| 92 | bool phy_enabled; |
| 93 | }; |
Shashank Babu Chinta Venkata | ded9c56 | 2017-03-15 14:43:46 -0700 | [diff] [blame^] | 94 | /** |
| 95 | * struct dsi_display_boot_param - defines DSI boot display selection |
| 96 | * @name:Name of DSI display selected as a boot param. |
| 97 | * @boot_disp_en:bool to indicate dtsi availability of display node |
| 98 | * @is_primary:bool to indicate whether current display is primary display |
| 99 | * @length:length of DSI display. |
| 100 | */ |
| 101 | struct dsi_display_boot_param { |
| 102 | char name[DSI_DISPLAY_MAX_LEN]; |
| 103 | bool boot_disp_en; |
| 104 | bool is_primary; |
| 105 | int length; |
| 106 | struct device_node *node; |
| 107 | |
| 108 | }; |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 109 | |
| 110 | /** |
| 111 | * struct dsi_display_clk_info - dsi display clock source information |
| 112 | * @src_clks: Source clocks for DSI display. |
| 113 | * @mux_clks: Mux clocks used for DFPS. |
| 114 | * @shadow_clks: Used for DFPS. |
| 115 | */ |
| 116 | struct dsi_display_clk_info { |
| 117 | struct dsi_clk_link_set src_clks; |
| 118 | struct dsi_clk_link_set mux_clks; |
| 119 | struct dsi_clk_link_set shadow_clks; |
| 120 | }; |
| 121 | |
| 122 | /** |
| 123 | * struct dsi_display - dsi display information |
| 124 | * @pdev: Pointer to platform device. |
| 125 | * @drm_dev: DRM device associated with the display. |
| 126 | * @name: Name of the display. |
| 127 | * @display_type: Display type as defined in device tree. |
| 128 | * @list: List pointer. |
| 129 | * @is_active: Is display active. |
| 130 | * @display_lock: Mutex for dsi_display interface. |
| 131 | * @ctrl_count: Number of DSI interfaces required by panel. |
| 132 | * @ctrl: Controller information for DSI display. |
| 133 | * @panel: Handle to DSI panel. |
| 134 | * @panel_of: pHandle to DSI panel. |
| 135 | * @type: DSI display type. |
| 136 | * @clk_master_idx: The master controller for controlling clocks. This is an |
| 137 | * index into the ctrl[MAX_DSI_CTRLS_PER_DISPLAY] array. |
| 138 | * @cmd_master_idx: The master controller for sending DSI commands to panel. |
| 139 | * @video_master_idx: The master controller for enabling video engine. |
| 140 | * @clock_info: Clock sourcing for DSI display. |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 141 | * @config: DSI host configuration information. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 142 | * @lane_map: Lane mapping between DSI host and Panel. |
| 143 | * @num_of_modes: Number of modes supported by display. |
| 144 | * @is_tpg_enabled: TPG state. |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 145 | * @ulps_enabled: ulps state. |
| 146 | * @clamp_enabled: clamp state. |
| 147 | * @phy_idle_power_off: PHY power state. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 148 | * @host: DRM MIPI DSI Host. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 149 | * @bridge: Pointer to DRM bridge object. |
Lloyd Atkinson | e404caf | 2016-07-13 17:26:45 -0400 | [diff] [blame] | 150 | * @cmd_engine_refcount: Reference count enforcing single instance of cmd eng |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 151 | * @clk_mngr: DSI clock manager. |
| 152 | * @dsi_clk_handle: DSI clock handle. |
| 153 | * @mdp_clk_handle: MDP clock handle. |
| 154 | * @root: Debugfs root directory |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 155 | */ |
| 156 | struct dsi_display { |
| 157 | struct platform_device *pdev; |
| 158 | struct drm_device *drm_dev; |
| 159 | |
| 160 | const char *name; |
| 161 | const char *display_type; |
| 162 | struct list_head list; |
| 163 | bool is_active; |
| 164 | struct mutex display_lock; |
| 165 | |
| 166 | u32 ctrl_count; |
| 167 | struct dsi_display_ctrl ctrl[MAX_DSI_CTRLS_PER_DISPLAY]; |
| 168 | |
| 169 | /* panel info */ |
| 170 | struct dsi_panel *panel; |
| 171 | struct device_node *panel_of; |
| 172 | |
| 173 | enum dsi_display_type type; |
| 174 | u32 clk_master_idx; |
| 175 | u32 cmd_master_idx; |
| 176 | u32 video_master_idx; |
| 177 | |
| 178 | struct dsi_display_clk_info clock_info; |
| 179 | struct dsi_host_config config; |
Padmanabhan Komanduru | 8ee8ee5 | 2016-12-19 12:10:51 +0530 | [diff] [blame] | 180 | struct dsi_lane_map lane_map; |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 181 | u32 num_of_modes; |
| 182 | bool is_tpg_enabled; |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 183 | bool ulps_enabled; |
| 184 | bool clamp_enabled; |
| 185 | bool phy_idle_power_off; |
Shashank Babu Chinta Venkata | 8210952 | 2017-05-09 18:59:21 -0700 | [diff] [blame] | 186 | struct drm_gem_object *tx_cmd_buf; |
| 187 | u32 cmd_buffer_size; |
| 188 | u32 cmd_buffer_iova; |
| 189 | void *vaddr; |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 190 | |
| 191 | struct mipi_dsi_host host; |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 192 | struct dsi_bridge *bridge; |
Ajay Singh Parmar | aa9152d | 2016-05-16 18:02:07 -0700 | [diff] [blame] | 193 | u32 cmd_engine_refcount; |
Ajay Singh Parmar | 48ea427 | 2016-06-27 11:44:34 -0700 | [diff] [blame] | 194 | |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 195 | void *clk_mngr; |
| 196 | void *dsi_clk_handle; |
| 197 | void *mdp_clk_handle; |
| 198 | |
Ajay Singh Parmar | 48ea427 | 2016-06-27 11:44:34 -0700 | [diff] [blame] | 199 | /* DEBUG FS */ |
| 200 | struct dentry *root; |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 201 | }; |
| 202 | |
| 203 | int dsi_display_dev_probe(struct platform_device *pdev); |
| 204 | int dsi_display_dev_remove(struct platform_device *pdev); |
| 205 | |
| 206 | /** |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 207 | * dsi_display_get_num_of_displays() - returns number of display devices |
| 208 | * supported. |
| 209 | * |
| 210 | * Return: number of displays. |
| 211 | */ |
Clarence Ip | 3649f8b | 2016-10-31 09:59:44 -0400 | [diff] [blame] | 212 | int dsi_display_get_num_of_displays(void); |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 213 | |
| 214 | /** |
Clarence Ip | a36c92e | 2016-07-26 14:33:46 -0400 | [diff] [blame] | 215 | * dsi_display_get_active_displays - returns pointers for active display devices |
| 216 | * @display_array: Pointer to display array to be filled |
| 217 | * @max_display_count: Size of display_array |
| 218 | * @Returns: Number of display entries filled |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 219 | */ |
Clarence Ip | a36c92e | 2016-07-26 14:33:46 -0400 | [diff] [blame] | 220 | int dsi_display_get_active_displays(void **display_array, |
| 221 | u32 max_display_count); |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 222 | |
| 223 | /** |
Shashank Babu Chinta Venkata | ded9c56 | 2017-03-15 14:43:46 -0700 | [diff] [blame^] | 224 | * dsi_display_get_boot_display()- get DSI boot display name |
| 225 | * @index: index of display selection |
| 226 | * |
| 227 | * Return: returns the display node pointer |
| 228 | */ |
| 229 | struct device_node *dsi_display_get_boot_display(int index); |
| 230 | |
| 231 | /** |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 232 | * dsi_display_get_display_by_name()- finds display by name |
Shashank Babu Chinta Venkata | ded9c56 | 2017-03-15 14:43:46 -0700 | [diff] [blame^] | 233 | * @name: name of the display. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 234 | * |
| 235 | * Return: handle to the display or error code. |
| 236 | */ |
| 237 | struct dsi_display *dsi_display_get_display_by_name(const char *name); |
| 238 | |
| 239 | /** |
| 240 | * dsi_display_set_active_state() - sets the state of the display |
| 241 | * @display: Handle to display. |
| 242 | * @is_active: state |
| 243 | */ |
| 244 | void dsi_display_set_active_state(struct dsi_display *display, bool is_active); |
| 245 | |
| 246 | /** |
Clarence Ip | 40d7d59 | 2016-07-15 16:02:26 -0400 | [diff] [blame] | 247 | * dsi_display_drm_bridge_init() - initializes DRM bridge object for DSI |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 248 | * @display: Handle to the display. |
| 249 | * @encoder: Pointer to the encoder object which is connected to the |
| 250 | * display. |
| 251 | * |
| 252 | * Return: error code. |
| 253 | */ |
Clarence Ip | 40d7d59 | 2016-07-15 16:02:26 -0400 | [diff] [blame] | 254 | int dsi_display_drm_bridge_init(struct dsi_display *display, |
| 255 | struct drm_encoder *enc); |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 256 | |
| 257 | /** |
Clarence Ip | 40d7d59 | 2016-07-15 16:02:26 -0400 | [diff] [blame] | 258 | * dsi_display_drm_bridge_deinit() - destroys DRM bridge for the display |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 259 | * @display: Handle to the display. |
| 260 | * |
| 261 | * Return: error code. |
| 262 | */ |
Clarence Ip | 40d7d59 | 2016-07-15 16:02:26 -0400 | [diff] [blame] | 263 | int dsi_display_drm_bridge_deinit(struct dsi_display *display); |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 264 | |
| 265 | /** |
| 266 | * dsi_display_get_info() - returns the display properties |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 267 | * @info: Pointer to the structure where info is stored. |
Clarence Ip | a403932 | 2016-07-15 16:23:59 -0400 | [diff] [blame] | 268 | * @disp: Handle to the display. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 269 | * |
| 270 | * Return: error code. |
| 271 | */ |
Clarence Ip | a403932 | 2016-07-15 16:23:59 -0400 | [diff] [blame] | 272 | int dsi_display_get_info(struct msm_display_info *info, void *disp); |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 273 | |
| 274 | /** |
| 275 | * dsi_display_get_modes() - get modes supported by display |
| 276 | * @display: Handle to display. |
| 277 | * @modes; Pointer to array of modes. Memory allocated should be |
| 278 | * big enough to store (count * struct dsi_display_mode) |
| 279 | * elements. If modes pointer is NULL, number of modes will |
| 280 | * be stored in the memory pointed to by count. |
| 281 | * @count: If modes is NULL, number of modes will be stored. If |
| 282 | * not, mode information will be copied (number of modes |
| 283 | * copied will be equal to *count). |
| 284 | * |
| 285 | * Return: error code. |
| 286 | */ |
| 287 | int dsi_display_get_modes(struct dsi_display *display, |
| 288 | struct dsi_display_mode *modes, |
| 289 | u32 *count); |
| 290 | |
| 291 | /** |
| 292 | * dsi_display_validate_mode() - validates if mode is supported by display |
| 293 | * @display: Handle to display. |
| 294 | * @mode: Mode to be validated. |
Ajay Singh Parmar | 62f795b | 2016-06-10 23:20:23 -0700 | [diff] [blame] | 295 | * @flags: Modifier flags. |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 296 | * |
| 297 | * Return: 0 if supported or error code. |
| 298 | */ |
| 299 | int dsi_display_validate_mode(struct dsi_display *display, |
Ajay Singh Parmar | 62f795b | 2016-06-10 23:20:23 -0700 | [diff] [blame] | 300 | struct dsi_display_mode *mode, |
| 301 | u32 flags); |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 302 | |
| 303 | /** |
| 304 | * dsi_display_set_mode() - Set mode on the display. |
| 305 | * @display: Handle to display. |
| 306 | * @mode: mode to be set. |
| 307 | * @flags: Modifier flags. |
| 308 | * |
| 309 | * Return: error code. |
| 310 | */ |
| 311 | int dsi_display_set_mode(struct dsi_display *display, |
| 312 | struct dsi_display_mode *mode, |
| 313 | u32 flags); |
| 314 | |
| 315 | /** |
| 316 | * dsi_display_prepare() - prepare display |
| 317 | * @display: Handle to display. |
| 318 | * |
| 319 | * Prepare will perform power up sequences for the host and panel hardware. |
| 320 | * Power and clock resources might be turned on (depending on the panel mode). |
| 321 | * The video engine is not enabled. |
| 322 | * |
| 323 | * Return: error code. |
| 324 | */ |
| 325 | int dsi_display_prepare(struct dsi_display *display); |
| 326 | |
| 327 | /** |
| 328 | * dsi_display_enable() - enable display |
| 329 | * @display: Handle to display. |
| 330 | * |
| 331 | * Enable will turn on the host engine and the panel. At the end of the enable |
| 332 | * function, Host and panel hardware are ready to accept pixel data from |
| 333 | * upstream. |
| 334 | * |
| 335 | * Return: error code. |
| 336 | */ |
| 337 | int dsi_display_enable(struct dsi_display *display); |
| 338 | |
| 339 | /** |
| 340 | * dsi_display_post_enable() - perform post enable operations. |
| 341 | * @display: Handle to display. |
| 342 | * |
| 343 | * Some panels might require some commands to be sent after pixel data |
| 344 | * transmission has started. Such commands are sent as part of the post_enable |
| 345 | * function. |
| 346 | * |
| 347 | * Return: error code. |
| 348 | */ |
| 349 | int dsi_display_post_enable(struct dsi_display *display); |
| 350 | |
| 351 | /** |
| 352 | * dsi_display_pre_disable() - perform pre disable operations. |
| 353 | * @display: Handle to display. |
| 354 | * |
| 355 | * If a panel requires commands to be sent before pixel data transmission is |
| 356 | * stopped, those can be sent as part of pre_disable. |
| 357 | * |
| 358 | * Return: error code. |
| 359 | */ |
| 360 | int dsi_display_pre_disable(struct dsi_display *display); |
| 361 | |
| 362 | /** |
| 363 | * dsi_display_disable() - disable panel and host hardware. |
| 364 | * @display: Handle to display. |
| 365 | * |
| 366 | * Disable host and panel hardware and pixel data transmission can not continue. |
| 367 | * |
| 368 | * Return: error code. |
| 369 | */ |
| 370 | int dsi_display_disable(struct dsi_display *display); |
| 371 | |
| 372 | /** |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 373 | * dsi_pre_clkoff_cb() - Callback before clock is turned off |
| 374 | * @priv: private data pointer. |
| 375 | * @clk_type: clock which is being turned on. |
| 376 | * @new_state: next state for the clock. |
| 377 | * |
| 378 | * @return: error code. |
| 379 | */ |
| 380 | int dsi_pre_clkoff_cb(void *priv, enum dsi_clk_type clk_type, |
| 381 | enum dsi_clk_state new_state); |
| 382 | |
| 383 | /** |
Alexander Beykun | ac18235 | 2017-02-27 17:46:51 -0500 | [diff] [blame] | 384 | * dsi_display_update_pps() - update PPS buffer. |
| 385 | * @pps_cmd: PPS buffer. |
| 386 | * @display: Handle to display. |
| 387 | * |
| 388 | * Copies new PPS buffer into display structure. |
| 389 | * |
| 390 | * Return: error code. |
| 391 | */ |
| 392 | int dsi_display_update_pps(char *pps_cmd, void *display); |
| 393 | |
| 394 | /** |
Padmanabhan Komanduru | dbd2fb0 | 2016-12-02 15:18:49 +0530 | [diff] [blame] | 395 | * dsi_post_clkoff_cb() - Callback after clock is turned off |
| 396 | * @priv: private data pointer. |
| 397 | * @clk_type: clock which is being turned on. |
| 398 | * @curr_state: current state for the clock. |
| 399 | * |
| 400 | * @return: error code. |
| 401 | */ |
| 402 | int dsi_post_clkoff_cb(void *priv, enum dsi_clk_type clk_type, |
| 403 | enum dsi_clk_state curr_state); |
| 404 | |
| 405 | /** |
| 406 | * dsi_post_clkon_cb() - Callback after clock is turned on |
| 407 | * @priv: private data pointer. |
| 408 | * @clk_type: clock which is being turned on. |
| 409 | * @curr_state: current state for the clock. |
| 410 | * |
| 411 | * @return: error code. |
| 412 | */ |
| 413 | int dsi_post_clkon_cb(void *priv, enum dsi_clk_type clk_type, |
| 414 | enum dsi_clk_state curr_state); |
| 415 | |
| 416 | |
| 417 | /** |
| 418 | * dsi_pre_clkon_cb() - Callback before clock is turned on |
| 419 | * @priv: private data pointer. |
| 420 | * @clk_type: clock which is being turned on. |
| 421 | * @new_state: next state for the clock. |
| 422 | * |
| 423 | * @return: error code. |
| 424 | */ |
| 425 | int dsi_pre_clkon_cb(void *priv, enum dsi_clk_type clk_type, |
| 426 | enum dsi_clk_state new_state); |
| 427 | |
| 428 | /** |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 429 | * dsi_display_unprepare() - power off display hardware. |
| 430 | * @display: Handle to display. |
| 431 | * |
| 432 | * Host and panel hardware is turned off. Panel will be in reset state at the |
| 433 | * end of the function. |
| 434 | * |
| 435 | * Return: error code. |
| 436 | */ |
| 437 | int dsi_display_unprepare(struct dsi_display *display); |
| 438 | |
| 439 | int dsi_display_set_tpg_state(struct dsi_display *display, bool enable); |
| 440 | |
| 441 | int dsi_display_clock_gate(struct dsi_display *display, bool enable); |
| 442 | int dsi_dispaly_static_frame(struct dsi_display *display, bool enable); |
| 443 | |
Vishnuvardhan Prodduturi | 75b9680 | 2016-10-17 18:45:55 +0530 | [diff] [blame] | 444 | int dsi_display_set_backlight(void *display, u32 bl_lvl); |
Lloyd Atkinson | 8c49c58 | 2016-11-18 14:23:54 -0500 | [diff] [blame] | 445 | |
| 446 | /** |
| 447 | * dsi_display_soft_reset() - perform a soft reset on DSI controller |
| 448 | * @display: Handle to display |
| 449 | * |
| 450 | * The video, command and controller engines will be disabled before the |
| 451 | * reset is triggered. After, the engines will be re-enabled to the same state |
| 452 | * as before the reset. |
| 453 | * |
| 454 | * If the reset is done while MDP timing engine is turned on, the video |
| 455 | * engine should be re-enabled only during the vertical blanking time. |
| 456 | * |
| 457 | * Return: error code |
| 458 | */ |
| 459 | int dsi_display_soft_reset(void *display); |
Lloyd Atkinson | 05d7551 | 2017-01-17 14:45:51 -0500 | [diff] [blame] | 460 | |
| 461 | /* |
| 462 | * dsi_display_pre_kickoff - program kickoff-time features |
| 463 | * @display: Pointer to private display structure |
| 464 | * @params: Parameters for kickoff-time programming |
| 465 | * Returns: Zero on success |
| 466 | */ |
| 467 | int dsi_display_pre_kickoff(struct dsi_display *display, |
| 468 | struct msm_display_kickoff_params *params); |
| 469 | |
Ajay Singh Parmar | 571e301 | 2016-05-16 17:55:52 -0700 | [diff] [blame] | 470 | #endif /* _DSI_DISPLAY_H_ */ |