|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
| 2 | +// Copyright (c) 2025 FIXME |
| 3 | +// Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree: |
| 4 | +// Copyright (c) 2014, The Linux Foundation. All rights reserved. (FIXME) |
| 5 | + |
| 6 | +#ifndef _PANEL_R61308_720P_VIDEO_H_ |
| 7 | +#define _PANEL_R61308_720P_VIDEO_H_ |
| 8 | + |
| 9 | +#include <mipi_dsi.h> |
| 10 | +#include <panel_display.h> |
| 11 | +#include <panel.h> |
| 12 | +#include <string.h> |
| 13 | + |
| 14 | +static struct panel_config r61308_720p_video_panel_data = { |
| 15 | + .panel_node_id = "qcom,mdss_dsi_r61308_720p_video", |
| 16 | + .panel_controller = "dsi:0:", |
| 17 | + .panel_compatible = "qcom,mdss-dsi-panel", |
| 18 | + .panel_type = 0, |
| 19 | + .panel_destination = "DISPLAY_1", |
| 20 | + /* .panel_orientation not supported yet */ |
| 21 | + .panel_framerate = 60, |
| 22 | + .panel_lp11_init = 1, |
| 23 | + .panel_init_delay = 50000, |
| 24 | +}; |
| 25 | + |
| 26 | +static struct panel_resolution r61308_720p_video_panel_res = { |
| 27 | + .panel_width = 720, |
| 28 | + .panel_height = 1280, |
| 29 | + .hfront_porch = 120, |
| 30 | + .hback_porch = 50, |
| 31 | + .hpulse_width = 2, |
| 32 | + .hsync_skew = 0, |
| 33 | + .vfront_porch = 6, |
| 34 | + .vback_porch = 14, |
| 35 | + .vpulse_width = 1, |
| 36 | + /* Borders not supported yet */ |
| 37 | +}; |
| 38 | + |
| 39 | +static struct color_info r61308_720p_video_color = { |
| 40 | + .color_format = 24, |
| 41 | + .color_order = DSI_RGB_SWAP_RGB, |
| 42 | + .underflow_color = 0xff, |
| 43 | + /* Borders and pixel packing not supported yet */ |
| 44 | +}; |
| 45 | + |
| 46 | +static char r61308_720p_video_on_cmd_0[] = { |
| 47 | + 0x11, 0x00, 0x05, 0x80 |
| 48 | +}; |
| 49 | +static char r61308_720p_video_on_cmd_1[] = { |
| 50 | + 0x02, 0x00, 0x39, 0xc0, 0x36, 0x00, 0xff, 0xff |
| 51 | +}; |
| 52 | +static char r61308_720p_video_on_cmd_2[] = { |
| 53 | + 0x02, 0x00, 0x39, 0xc0, 0x3a, 0x07, 0xff, 0xff |
| 54 | +}; |
| 55 | +static char r61308_720p_video_on_cmd_3[] = { |
| 56 | + 0x02, 0x00, 0x29, 0xc0, 0xb0, 0x04, 0xff, 0xff |
| 57 | +}; |
| 58 | +static char r61308_720p_video_on_cmd_4[] = { |
| 59 | + 0x08, 0x00, 0x29, 0xc0, 0xc1, 0x50, 0x02, 0x22, |
| 60 | + 0x00, 0x00, 0xed, 0x11 |
| 61 | +}; |
| 62 | +static char r61308_720p_video_on_cmd_5[] = { |
| 63 | + 0x19, 0x00, 0x29, 0xc0, 0xc8, 0x1a, 0x24, 0x29, |
| 64 | + 0x2d, 0x32, 0x37, 0x14, 0x13, 0x10, 0x0c, 0x0a, |
| 65 | + 0x06, 0x1a, 0x24, 0x28, 0x2d, 0x32, 0x37, 0x14, |
| 66 | + 0x13, 0x10, 0x0c, 0x0a, 0x06, 0xff, 0xff, 0xff |
| 67 | +}; |
| 68 | +static char r61308_720p_video_on_cmd_6[] = { |
| 69 | + 0x09, 0x00, 0x29, 0xc0, 0xcb, 0x10, 0x20, 0x40, |
| 70 | + 0x80, 0xa0, 0xc0, 0xd0, 0xe0, 0xff, 0xff, 0xff |
| 71 | +}; |
| 72 | +static char r61308_720p_video_on_cmd_7[] = { |
| 73 | + 0x04, 0x00, 0x29, 0xc0, 0xcc, 0xc8, 0xd8, 0xff |
| 74 | +}; |
| 75 | +static char r61308_720p_video_on_cmd_8[] = { |
| 76 | + 0x08, 0x00, 0x29, 0xc0, 0xcd, 0x1c, 0x1e, 0x1e, |
| 77 | + 0x1d, 0x1c, 0x1e, 0x1e |
| 78 | +}; |
| 79 | +static char r61308_720p_video_on_cmd_9[] = { |
| 80 | + 0x08, 0x00, 0x29, 0xc0, 0xce, 0x1e, 0x1e, 0x1e, |
| 81 | + 0x1d, 0x1d, 0x1e, 0x1e |
| 82 | +}; |
| 83 | +static char r61308_720p_video_on_cmd_10[] = { |
| 84 | + 0x08, 0x00, 0x29, 0xc0, 0xcf, 0x1e, 0x1f, 0x20, |
| 85 | + 0x20, 0x20, 0x20, 0x21 |
| 86 | +}; |
| 87 | +static char r61308_720p_video_on_cmd_11[] = { |
| 88 | + 0x02, 0x00, 0x29, 0xc0, 0xb0, 0x03, 0xff, 0xff |
| 89 | +}; |
| 90 | +static char r61308_720p_video_on_cmd_12[] = { |
| 91 | + 0x29, 0x00, 0x05, 0x80 |
| 92 | +}; |
| 93 | + |
| 94 | +static struct mipi_dsi_cmd r61308_720p_video_on_command[] = { |
| 95 | + { sizeof(r61308_720p_video_on_cmd_0), r61308_720p_video_on_cmd_0, 120 }, |
| 96 | + { sizeof(r61308_720p_video_on_cmd_1), r61308_720p_video_on_cmd_1, 0 }, |
| 97 | + { sizeof(r61308_720p_video_on_cmd_2), r61308_720p_video_on_cmd_2, 0 }, |
| 98 | + { sizeof(r61308_720p_video_on_cmd_3), r61308_720p_video_on_cmd_3, 0 }, |
| 99 | + { sizeof(r61308_720p_video_on_cmd_4), r61308_720p_video_on_cmd_4, 0 }, |
| 100 | + { sizeof(r61308_720p_video_on_cmd_5), r61308_720p_video_on_cmd_5, 0 }, |
| 101 | + { sizeof(r61308_720p_video_on_cmd_6), r61308_720p_video_on_cmd_6, 0 }, |
| 102 | + { sizeof(r61308_720p_video_on_cmd_7), r61308_720p_video_on_cmd_7, 0 }, |
| 103 | + { sizeof(r61308_720p_video_on_cmd_8), r61308_720p_video_on_cmd_8, 0 }, |
| 104 | + { sizeof(r61308_720p_video_on_cmd_9), r61308_720p_video_on_cmd_9, 0 }, |
| 105 | + { sizeof(r61308_720p_video_on_cmd_10), r61308_720p_video_on_cmd_10, 0 }, |
| 106 | + { sizeof(r61308_720p_video_on_cmd_11), r61308_720p_video_on_cmd_11, 0 }, |
| 107 | + { sizeof(r61308_720p_video_on_cmd_12), r61308_720p_video_on_cmd_12, 10 }, |
| 108 | +}; |
| 109 | + |
| 110 | +static char r61308_720p_video_off_cmd_0[] = { |
| 111 | + 0x28, 0x00, 0x05, 0x80 |
| 112 | +}; |
| 113 | +static char r61308_720p_video_off_cmd_1[] = { |
| 114 | + 0x10, 0x00, 0x05, 0x80 |
| 115 | +}; |
| 116 | + |
| 117 | +static struct mipi_dsi_cmd r61308_720p_video_off_command[] = { |
| 118 | + { sizeof(r61308_720p_video_off_cmd_0), r61308_720p_video_off_cmd_0, 50 }, |
| 119 | + { sizeof(r61308_720p_video_off_cmd_1), r61308_720p_video_off_cmd_1, 120 }, |
| 120 | +}; |
| 121 | + |
| 122 | +static struct command_state r61308_720p_video_state = { |
| 123 | + .oncommand_state = 0, |
| 124 | + .offcommand_state = 1, |
| 125 | +}; |
| 126 | + |
| 127 | +static struct commandpanel_info r61308_720p_video_command_panel = { |
| 128 | + /* Unused, this is a video mode panel */ |
| 129 | +}; |
| 130 | + |
| 131 | +static struct videopanel_info r61308_720p_video_video_panel = { |
| 132 | + .hsync_pulse = 1, |
| 133 | + .hfp_power_mode = 0, |
| 134 | + .hbp_power_mode = 0, |
| 135 | + .hsa_power_mode = 0, |
| 136 | + .bllp_eof_power_mode = 1, |
| 137 | + .bllp_power_mode = 1, |
| 138 | + .traffic_mode = 2, |
| 139 | + /* This is bllp_eof_power_mode and bllp_power_mode combined */ |
| 140 | + .bllp_eof_power = 1 << 3 | 1 << 0, |
| 141 | +}; |
| 142 | + |
| 143 | +static struct lane_configuration r61308_720p_video_lane_config = { |
| 144 | + .dsi_lanes = 3, |
| 145 | + .dsi_lanemap = 0, |
| 146 | + .lane0_state = 1, |
| 147 | + .lane1_state = 1, |
| 148 | + .lane2_state = 1, |
| 149 | + .lane3_state = 0, |
| 150 | + .force_clk_lane_hs = 0, |
| 151 | +}; |
| 152 | + |
| 153 | +static const uint32_t r61308_720p_video_timings[] = { |
| 154 | + 0x9b, 0x22, 0x18, 0x00, 0x4a, 0x4c, 0x1c, 0x26, 0x1d, 0x03, 0x04, 0x00 |
| 155 | +}; |
| 156 | + |
| 157 | +static struct panel_timing r61308_720p_video_timing_info = { |
| 158 | + .tclk_post = 0x04, |
| 159 | + .tclk_pre = 0x1f, |
| 160 | +}; |
| 161 | + |
| 162 | +static struct panel_reset_sequence r61308_720p_video_reset_seq = { |
| 163 | + .pin_state = { 1, 0, 1 }, |
| 164 | + .sleep = { 5, 10, 30 }, |
| 165 | + .pin_direction = 2, |
| 166 | +}; |
| 167 | + |
| 168 | +static struct backlight r61308_720p_video_backlight = { |
| 169 | + .bl_interface_type = BL_PWM, |
| 170 | + .bl_min_level = 1, |
| 171 | + .bl_max_level = 255, |
| 172 | +}; |
| 173 | + |
| 174 | +static inline void panel_r61308_720p_video_select(struct panel_struct *panel, |
| 175 | + struct msm_panel_info *pinfo, |
| 176 | + struct mdss_dsi_phy_ctrl *phy_db) |
| 177 | +{ |
| 178 | + panel->paneldata = &r61308_720p_video_panel_data; |
| 179 | + panel->panelres = &r61308_720p_video_panel_res; |
| 180 | + panel->color = &r61308_720p_video_color; |
| 181 | + panel->videopanel = &r61308_720p_video_video_panel; |
| 182 | + panel->commandpanel = &r61308_720p_video_command_panel; |
| 183 | + panel->state = &r61308_720p_video_state; |
| 184 | + panel->laneconfig = &r61308_720p_video_lane_config; |
| 185 | + panel->paneltiminginfo = &r61308_720p_video_timing_info; |
| 186 | + panel->panelresetseq = &r61308_720p_video_reset_seq; |
| 187 | + panel->backlightinfo = &r61308_720p_video_backlight; |
| 188 | + pinfo->mipi.panel_on_cmds = r61308_720p_video_on_command; |
| 189 | + pinfo->mipi.panel_off_cmds = r61308_720p_video_off_command; |
| 190 | + pinfo->mipi.num_of_panel_on_cmds = ARRAY_SIZE(r61308_720p_video_on_command); |
| 191 | + pinfo->mipi.num_of_panel_off_cmds = ARRAY_SIZE(r61308_720p_video_off_command); |
| 192 | + memcpy(phy_db->timing, r61308_720p_video_timings, TIMING_SIZE); |
| 193 | + phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE; |
| 194 | +} |
| 195 | + |
| 196 | +#endif /* _PANEL_R61308_720P_VIDEO_H_ */ |
0 commit comments