Ajay Singh Parmar | 0e18781 | 2016-05-16 17:45:31 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. |
| 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_CATALOG_H_ |
| 16 | #define _DSI_CATALOG_H_ |
| 17 | |
| 18 | #include "dsi_ctrl_hw.h" |
| 19 | #include "dsi_phy_hw.h" |
| 20 | |
| 21 | /** |
| 22 | * dsi_catalog_ctrl_setup() - return catalog info for dsi controller |
| 23 | * @ctrl: Pointer to DSI controller hw object. |
| 24 | * @version: DSI controller version. |
| 25 | * @index: DSI controller instance ID. |
| 26 | * |
| 27 | * This function setups the catalog information in the dsi_ctrl_hw object. |
| 28 | * |
| 29 | * return: error code for failure and 0 for success. |
| 30 | */ |
| 31 | int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl, |
| 32 | enum dsi_ctrl_version version, |
| 33 | u32 index); |
| 34 | |
| 35 | /** |
| 36 | * dsi_catalog_phy_setup() - return catalog info for dsi phy hardware |
| 37 | * @ctrl: Pointer to DSI PHY hw object. |
| 38 | * @version: DSI PHY version. |
| 39 | * @index: DSI PHY instance ID. |
| 40 | * |
| 41 | * This function setups the catalog information in the dsi_phy_hw object. |
| 42 | * |
| 43 | * return: error code for failure and 0 for success. |
| 44 | */ |
| 45 | int dsi_catalog_phy_setup(struct dsi_phy_hw *phy, |
| 46 | enum dsi_phy_version version, |
| 47 | u32 index); |
| 48 | |
| 49 | /* Definitions for 4.0 PHY hardware driver */ |
| 50 | void dsi_phy_hw_v4_0_regulator_enable(struct dsi_phy_hw *phy, |
| 51 | struct dsi_phy_per_lane_cfgs *cfg); |
| 52 | void dsi_phy_hw_v4_0_regulator_disable(struct dsi_phy_hw *phy); |
| 53 | void dsi_phy_hw_v4_0_enable(struct dsi_phy_hw *phy, struct dsi_phy_cfg *cfg); |
| 54 | void dsi_phy_hw_v4_0_disable(struct dsi_phy_hw *phy); |
| 55 | int dsi_phy_hw_v4_0_calculate_timing_params(struct dsi_phy_hw *phy, |
| 56 | struct dsi_mode_info *mode, |
| 57 | struct dsi_host_common_cfg *cfg, |
| 58 | struct dsi_phy_per_lane_cfgs |
| 59 | *timing); |
| 60 | |
| 61 | /* Definitions for 1.4 controller hardware driver */ |
| 62 | void dsi_ctrl_hw_14_host_setup(struct dsi_ctrl_hw *ctrl, |
| 63 | struct dsi_host_common_cfg *config); |
| 64 | void dsi_ctrl_hw_14_video_engine_en(struct dsi_ctrl_hw *ctrl, bool on); |
| 65 | void dsi_ctrl_hw_14_video_engine_setup(struct dsi_ctrl_hw *ctrl, |
| 66 | struct dsi_host_common_cfg *common_cfg, |
| 67 | struct dsi_video_engine_cfg *cfg); |
| 68 | void dsi_ctrl_hw_14_set_video_timing(struct dsi_ctrl_hw *ctrl, |
| 69 | struct dsi_mode_info *mode); |
| 70 | |
| 71 | void dsi_ctrl_hw_14_cmd_engine_setup(struct dsi_ctrl_hw *ctrl, |
| 72 | struct dsi_host_common_cfg *common_cfg, |
| 73 | struct dsi_cmd_engine_cfg *cfg); |
| 74 | |
| 75 | void dsi_ctrl_hw_14_ctrl_en(struct dsi_ctrl_hw *ctrl, bool on); |
| 76 | void dsi_ctrl_hw_14_cmd_engine_en(struct dsi_ctrl_hw *ctrl, bool on); |
| 77 | |
Ajay Singh Parmar | aa9152d | 2016-05-16 18:02:07 -0700 | [diff] [blame^] | 78 | void dsi_ctrl_hw_14_setup_cmd_stream(struct dsi_ctrl_hw *ctrl, |
| 79 | u32 width_in_pixels, |
| 80 | u32 h_stride, |
| 81 | u32 height_in_lines, |
| 82 | u32 vc_id); |
Ajay Singh Parmar | 0e18781 | 2016-05-16 17:45:31 -0700 | [diff] [blame] | 83 | void dsi_ctrl_hw_14_phy_sw_reset(struct dsi_ctrl_hw *ctrl); |
| 84 | void dsi_ctrl_hw_14_soft_reset(struct dsi_ctrl_hw *ctrl); |
| 85 | |
| 86 | void dsi_ctrl_hw_14_setup_lane_map(struct dsi_ctrl_hw *ctrl, |
| 87 | struct dsi_lane_mapping *lane_map); |
| 88 | void dsi_ctrl_hw_14_kickoff_command(struct dsi_ctrl_hw *ctrl, |
| 89 | struct dsi_ctrl_cmd_dma_info *cmd, |
| 90 | u32 flags); |
| 91 | |
| 92 | void dsi_ctrl_hw_14_kickoff_fifo_command(struct dsi_ctrl_hw *ctrl, |
| 93 | struct dsi_ctrl_cmd_dma_fifo_info *cmd, |
| 94 | u32 flags); |
| 95 | void dsi_ctrl_hw_14_reset_cmd_fifo(struct dsi_ctrl_hw *ctrl); |
| 96 | void dsi_ctrl_hw_14_trigger_command_dma(struct dsi_ctrl_hw *ctrl); |
| 97 | |
| 98 | void dsi_ctrl_hw_14_ulps_request(struct dsi_ctrl_hw *ctrl, u32 lanes); |
| 99 | void dsi_ctrl_hw_14_ulps_exit(struct dsi_ctrl_hw *ctrl, u32 lanes); |
| 100 | void dsi_ctrl_hw_14_clear_ulps_request(struct dsi_ctrl_hw *ctrl, u32 lanes); |
| 101 | u32 dsi_ctrl_hw_14_get_lanes_in_ulps(struct dsi_ctrl_hw *ctrl); |
| 102 | |
| 103 | void dsi_ctrl_hw_14_clamp_enable(struct dsi_ctrl_hw *ctrl, |
| 104 | u32 lanes, |
| 105 | bool enable_ulps); |
| 106 | |
| 107 | void dsi_ctrl_hw_14_clamp_disable(struct dsi_ctrl_hw *ctrl, |
| 108 | u32 lanes, |
| 109 | bool disable_ulps); |
| 110 | u32 dsi_ctrl_hw_14_get_interrupt_status(struct dsi_ctrl_hw *ctrl); |
| 111 | void dsi_ctrl_hw_14_clear_interrupt_status(struct dsi_ctrl_hw *ctrl, u32 ints); |
| 112 | void dsi_ctrl_hw_14_enable_status_interrupts(struct dsi_ctrl_hw *ctrl, |
| 113 | u32 ints); |
| 114 | |
| 115 | u64 dsi_ctrl_hw_14_get_error_status(struct dsi_ctrl_hw *ctrl); |
| 116 | void dsi_ctrl_hw_14_clear_error_status(struct dsi_ctrl_hw *ctrl, u64 errors); |
| 117 | void dsi_ctrl_hw_14_enable_error_interrupts(struct dsi_ctrl_hw *ctrl, |
| 118 | u64 errors); |
| 119 | |
| 120 | void dsi_ctrl_hw_14_video_test_pattern_setup(struct dsi_ctrl_hw *ctrl, |
| 121 | enum dsi_test_pattern type, |
| 122 | u32 init_val); |
| 123 | void dsi_ctrl_hw_14_cmd_test_pattern_setup(struct dsi_ctrl_hw *ctrl, |
| 124 | enum dsi_test_pattern type, |
| 125 | u32 init_val, |
| 126 | u32 stream_id); |
| 127 | void dsi_ctrl_hw_14_test_pattern_enable(struct dsi_ctrl_hw *ctrl, bool enable); |
| 128 | void dsi_ctrl_hw_14_trigger_cmd_test_pattern(struct dsi_ctrl_hw *ctrl, |
| 129 | u32 stream_id); |
| 130 | #endif /* _DSI_CATALOG_H_ */ |