1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2019, Amarula Solutions.
4 * Author: Jagan Teki <jagan@amarulasolutions.com>
7 #include <drm/drm_mipi_dsi.h>
8 #include <drm/drm_modes.h>
9 #include <drm/drm_panel.h>
11 #include <linux/bitfield.h>
12 #include <linux/gpio/consumer.h>
13 #include <linux/delay.h>
14 #include <linux/module.h>
16 #include <linux/regulator/consumer.h>
18 #include <video/mipi_display.h>
20 /* Command2 BKx selection command */
21 #define DSI_CMD2BKX_SEL 0xFF
23 #define DSI_CMD2 BIT(4)
24 #define DSI_CMD2BK_MASK GENMASK(3, 0)
26 /* Command2, BK0 commands */
27 #define DSI_CMD2_BK0_PVGAMCTRL 0xB0 /* Positive Voltage Gamma Control */
28 #define DSI_CMD2_BK0_NVGAMCTRL 0xB1 /* Negative Voltage Gamma Control */
29 #define DSI_CMD2_BK0_LNESET 0xC0 /* Display Line setting */
30 #define DSI_CMD2_BK0_PORCTRL 0xC1 /* Porch control */
31 #define DSI_CMD2_BK0_INVSEL 0xC2 /* Inversion selection, Frame Rate Control */
33 /* Command2, BK1 commands */
34 #define DSI_CMD2_BK1_VRHS 0xB0 /* Vop amplitude setting */
35 #define DSI_CMD2_BK1_VCOM 0xB1 /* VCOM amplitude setting */
36 #define DSI_CMD2_BK1_VGHSS 0xB2 /* VGH Voltage setting */
37 #define DSI_CMD2_BK1_TESTCMD 0xB3 /* TEST Command Setting */
38 #define DSI_CMD2_BK1_VGLS 0xB5 /* VGL Voltage setting */
39 #define DSI_CMD2_BK1_PWCTLR1 0xB7 /* Power Control 1 */
40 #define DSI_CMD2_BK1_PWCTLR2 0xB8 /* Power Control 2 */
41 #define DSI_CMD2_BK1_SPD1 0xC1 /* Source pre_drive timing set1 */
42 #define DSI_CMD2_BK1_SPD2 0xC2 /* Source EQ2 Setting */
43 #define DSI_CMD2_BK1_MIPISET1 0xD0 /* MIPI Setting 1 */
45 /* Command2, BK0 bytes */
46 #define DSI_CMD2_BK0_GAMCTRL_AJ_MASK GENMASK(7, 6)
47 #define DSI_CMD2_BK0_GAMCTRL_VC0_MASK GENMASK(3, 0)
48 #define DSI_CMD2_BK0_GAMCTRL_VC4_MASK GENMASK(5, 0)
49 #define DSI_CMD2_BK0_GAMCTRL_VC8_MASK GENMASK(5, 0)
50 #define DSI_CMD2_BK0_GAMCTRL_VC16_MASK GENMASK(4, 0)
51 #define DSI_CMD2_BK0_GAMCTRL_VC24_MASK GENMASK(4, 0)
52 #define DSI_CMD2_BK0_GAMCTRL_VC52_MASK GENMASK(3, 0)
53 #define DSI_CMD2_BK0_GAMCTRL_VC80_MASK GENMASK(5, 0)
54 #define DSI_CMD2_BK0_GAMCTRL_VC108_MASK GENMASK(3, 0)
55 #define DSI_CMD2_BK0_GAMCTRL_VC147_MASK GENMASK(3, 0)
56 #define DSI_CMD2_BK0_GAMCTRL_VC175_MASK GENMASK(5, 0)
57 #define DSI_CMD2_BK0_GAMCTRL_VC203_MASK GENMASK(3, 0)
58 #define DSI_CMD2_BK0_GAMCTRL_VC231_MASK GENMASK(4, 0)
59 #define DSI_CMD2_BK0_GAMCTRL_VC239_MASK GENMASK(4, 0)
60 #define DSI_CMD2_BK0_GAMCTRL_VC247_MASK GENMASK(5, 0)
61 #define DSI_CMD2_BK0_GAMCTRL_VC251_MASK GENMASK(5, 0)
62 #define DSI_CMD2_BK0_GAMCTRL_VC255_MASK GENMASK(4, 0)
63 #define DSI_CMD2_BK0_LNESET_LINE_MASK GENMASK(6, 0)
64 #define DSI_CMD2_BK0_LNESET_LDE_EN BIT(7)
65 #define DSI_CMD2_BK0_LNESET_LINEDELTA GENMASK(1, 0)
66 #define DSI_CMD2_BK0_PORCTRL_VBP_MASK GENMASK(7, 0)
67 #define DSI_CMD2_BK0_PORCTRL_VFP_MASK GENMASK(7, 0)
68 #define DSI_CMD2_BK0_INVSEL_ONES_MASK GENMASK(5, 4)
69 #define DSI_CMD2_BK0_INVSEL_NLINV_MASK GENMASK(2, 0)
70 #define DSI_CMD2_BK0_INVSEL_RTNI_MASK GENMASK(4, 0)
72 /* Command2, BK1 bytes */
73 #define DSI_CMD2_BK1_VRHA_MASK GENMASK(7, 0)
74 #define DSI_CMD2_BK1_VCOM_MASK GENMASK(7, 0)
75 #define DSI_CMD2_BK1_VGHSS_MASK GENMASK(3, 0)
76 #define DSI_CMD2_BK1_TESTCMD_VAL BIT(7)
77 #define DSI_CMD2_BK1_VGLS_ONES BIT(6)
78 #define DSI_CMD2_BK1_VGLS_MASK GENMASK(3, 0)
79 #define DSI_CMD2_BK1_PWRCTRL1_AP_MASK GENMASK(7, 6)
80 #define DSI_CMD2_BK1_PWRCTRL1_APIS_MASK GENMASK(3, 2)
81 #define DSI_CMD2_BK1_PWRCTRL1_APOS_MASK GENMASK(1, 0)
82 #define DSI_CMD2_BK1_PWRCTRL2_AVDD_MASK GENMASK(5, 4)
83 #define DSI_CMD2_BK1_PWRCTRL2_AVCL_MASK GENMASK(1, 0)
84 #define DSI_CMD2_BK1_SPD1_ONES_MASK GENMASK(6, 4)
85 #define DSI_CMD2_BK1_SPD1_T2D_MASK GENMASK(3, 0)
86 #define DSI_CMD2_BK1_SPD2_ONES_MASK GENMASK(6, 4)
87 #define DSI_CMD2_BK1_SPD2_T3D_MASK GENMASK(3, 0)
88 #define DSI_CMD2_BK1_MIPISET1_ONES BIT(7)
89 #define DSI_CMD2_BK1_MIPISET1_EOT_EN BIT(3)
91 #define CFIELD_PREP(_mask, _val) \
92 (((typeof(_mask))(_val) << (__builtin_ffsll(_mask) - 1)) & (_mask))
103 struct st7701_panel_desc {
104 const struct drm_display_mode *mode;
106 enum mipi_dsi_pixel_format format;
107 unsigned int panel_sleep_delay;
109 /* TFT matrix driver configuration, panel specific. */
110 const u8 pv_gamma[16]; /* Positive voltage gamma control */
111 const u8 nv_gamma[16]; /* Negative voltage gamma control */
112 const u8 nlinv; /* Inversion selection */
113 const u32 vop_uv; /* Vop in uV */
114 const u32 vcom_uv; /* Vcom in uV */
115 const u16 vgh_mv; /* Vgh in mV */
116 const s16 vgl_mv; /* Vgl in mV */
117 const u16 avdd_mv; /* Avdd in mV */
118 const s16 avcl_mv; /* Avcl in mV */
119 const enum op_bias gamma_op_bias;
120 const enum op_bias input_op_bias;
121 const enum op_bias output_op_bias;
122 const u16 t2d_ns; /* T2D in ns */
123 const u16 t3d_ns; /* T3D in ns */
126 /* GIP sequence, fully custom and undocumented. */
127 void (*gip_sequence)(struct st7701 *st7701);
131 struct drm_panel panel;
132 struct mipi_dsi_device *dsi;
133 const struct st7701_panel_desc *desc;
135 struct regulator_bulk_data supplies[2];
136 struct gpio_desc *reset;
137 unsigned int sleep_delay;
138 enum drm_panel_orientation orientation;
141 static inline struct st7701 *panel_to_st7701(struct drm_panel *panel)
143 return container_of(panel, struct st7701, panel);
146 static inline int st7701_dsi_write(struct st7701 *st7701, const void *seq,
149 return mipi_dsi_dcs_write_buffer(st7701->dsi, seq, len);
152 #define ST7701_DSI(st7701, seq...) \
154 const u8 d[] = { seq }; \
155 st7701_dsi_write(st7701, d, ARRAY_SIZE(d)); \
158 static u8 st7701_vgls_map(struct st7701 *st7701)
160 const struct st7701_panel_desc *desc = st7701->desc;
165 { -7060, 0x0 }, { -7470, 0x1 },
166 { -7910, 0x2 }, { -8140, 0x3 },
167 { -8650, 0x4 }, { -8920, 0x5 },
168 { -9210, 0x6 }, { -9510, 0x7 },
169 { -9830, 0x8 }, { -10170, 0x9 },
170 { -10530, 0xa }, { -10910, 0xb },
171 { -11310, 0xc }, { -11730, 0xd },
172 { -12200, 0xe }, { -12690, 0xf }
176 for (i = 0; i < ARRAY_SIZE(map); i++)
177 if (desc->vgl_mv == map[i].vgl)
183 static void st7701_switch_cmd_bkx(struct st7701 *st7701, bool cmd2, u8 bkx)
188 val = DSI_CMD2 | FIELD_PREP(DSI_CMD2BK_MASK, bkx);
192 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, 0x77, 0x01, 0x00, 0x00, val);
195 static void st7701_init_sequence(struct st7701 *st7701)
197 const struct st7701_panel_desc *desc = st7701->desc;
198 const struct drm_display_mode *mode = desc->mode;
199 const u8 linecount8 = mode->vdisplay / 8;
200 const u8 linecountrem2 = (mode->vdisplay % 8) / 2;
202 ST7701_DSI(st7701, MIPI_DCS_SOFT_RESET, 0x00);
204 /* We need to wait 5ms before sending new commands */
207 ST7701_DSI(st7701, MIPI_DCS_EXIT_SLEEP_MODE, 0x00);
209 msleep(st7701->sleep_delay);
212 st7701_switch_cmd_bkx(st7701, true, 0);
214 mipi_dsi_dcs_write(st7701->dsi, DSI_CMD2_BK0_PVGAMCTRL,
215 desc->pv_gamma, ARRAY_SIZE(desc->pv_gamma));
216 mipi_dsi_dcs_write(st7701->dsi, DSI_CMD2_BK0_NVGAMCTRL,
217 desc->nv_gamma, ARRAY_SIZE(desc->nv_gamma));
219 * Vertical line count configuration:
220 * Line[6:0]: select number of vertical lines of the TFT matrix in
221 * multiples of 8 lines
222 * LDE_EN: enable sub-8-line granularity line count
223 * Line_delta[1:0]: add 0/2/4/6 extra lines to line count selected
226 * Total number of vertical lines:
227 * LN = ((Line[6:0] + 1) * 8) + (LDE_EN ? Line_delta[1:0] * 2 : 0)
229 ST7701_DSI(st7701, DSI_CMD2_BK0_LNESET,
230 FIELD_PREP(DSI_CMD2_BK0_LNESET_LINE_MASK, linecount8 - 1) |
231 (linecountrem2 ? DSI_CMD2_BK0_LNESET_LDE_EN : 0),
232 FIELD_PREP(DSI_CMD2_BK0_LNESET_LINEDELTA, linecountrem2));
233 ST7701_DSI(st7701, DSI_CMD2_BK0_PORCTRL,
234 FIELD_PREP(DSI_CMD2_BK0_PORCTRL_VBP_MASK,
235 mode->vtotal - mode->vsync_end),
236 FIELD_PREP(DSI_CMD2_BK0_PORCTRL_VFP_MASK,
237 mode->vsync_start - mode->vdisplay));
239 * Horizontal pixel count configuration:
240 * PCLK = 512 + (RTNI[4:0] * 16)
241 * The PCLK is number of pixel clock per line, which matches
242 * mode htotal. The minimum is 512 PCLK.
244 ST7701_DSI(st7701, DSI_CMD2_BK0_INVSEL,
245 DSI_CMD2_BK0_INVSEL_ONES_MASK |
246 FIELD_PREP(DSI_CMD2_BK0_INVSEL_NLINV_MASK, desc->nlinv),
247 FIELD_PREP(DSI_CMD2_BK0_INVSEL_RTNI_MASK,
248 (clamp((u32)mode->htotal, 512U, 1008U) - 512) / 16));
251 st7701_switch_cmd_bkx(st7701, true, 1);
253 /* Vop = 3.5375V + (VRHA[7:0] * 0.0125V) */
254 ST7701_DSI(st7701, DSI_CMD2_BK1_VRHS,
255 FIELD_PREP(DSI_CMD2_BK1_VRHA_MASK,
256 DIV_ROUND_CLOSEST(desc->vop_uv - 3537500, 12500)));
258 /* Vcom = 0.1V + (VCOM[7:0] * 0.0125V) */
259 ST7701_DSI(st7701, DSI_CMD2_BK1_VCOM,
260 FIELD_PREP(DSI_CMD2_BK1_VCOM_MASK,
261 DIV_ROUND_CLOSEST(desc->vcom_uv - 100000, 12500)));
263 /* Vgh = 11.5V + (VGHSS[7:0] * 0.5V) */
264 ST7701_DSI(st7701, DSI_CMD2_BK1_VGHSS,
265 FIELD_PREP(DSI_CMD2_BK1_VGHSS_MASK,
266 DIV_ROUND_CLOSEST(clamp(desc->vgh_mv,
271 ST7701_DSI(st7701, DSI_CMD2_BK1_TESTCMD, DSI_CMD2_BK1_TESTCMD_VAL);
273 /* Vgl is non-linear */
274 ST7701_DSI(st7701, DSI_CMD2_BK1_VGLS,
275 DSI_CMD2_BK1_VGLS_ONES |
276 FIELD_PREP(DSI_CMD2_BK1_VGLS_MASK, st7701_vgls_map(st7701)));
278 ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR1,
279 FIELD_PREP(DSI_CMD2_BK1_PWRCTRL1_AP_MASK,
280 desc->gamma_op_bias) |
281 FIELD_PREP(DSI_CMD2_BK1_PWRCTRL1_APIS_MASK,
282 desc->input_op_bias) |
283 FIELD_PREP(DSI_CMD2_BK1_PWRCTRL1_APOS_MASK,
284 desc->output_op_bias));
286 /* Avdd = 6.2V + (AVDD[1:0] * 0.2V) , Avcl = -4.4V - (AVCL[1:0] * 0.2V) */
287 ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR2,
288 FIELD_PREP(DSI_CMD2_BK1_PWRCTRL2_AVDD_MASK,
289 DIV_ROUND_CLOSEST(desc->avdd_mv - 6200, 200)) |
290 FIELD_PREP(DSI_CMD2_BK1_PWRCTRL2_AVCL_MASK,
291 DIV_ROUND_CLOSEST(-4400 + desc->avcl_mv, 200)));
293 /* T2D = 0.2us * T2D[3:0] */
294 ST7701_DSI(st7701, DSI_CMD2_BK1_SPD1,
295 DSI_CMD2_BK1_SPD1_ONES_MASK |
296 FIELD_PREP(DSI_CMD2_BK1_SPD1_T2D_MASK,
297 DIV_ROUND_CLOSEST(desc->t2d_ns, 200)));
299 /* T3D = 4us + (0.8us * T3D[3:0]) */
300 ST7701_DSI(st7701, DSI_CMD2_BK1_SPD2,
301 DSI_CMD2_BK1_SPD2_ONES_MASK |
302 FIELD_PREP(DSI_CMD2_BK1_SPD2_T3D_MASK,
303 DIV_ROUND_CLOSEST(desc->t3d_ns - 4000, 800)));
305 ST7701_DSI(st7701, DSI_CMD2_BK1_MIPISET1,
306 DSI_CMD2_BK1_MIPISET1_ONES |
307 (desc->eot_en ? DSI_CMD2_BK1_MIPISET1_EOT_EN : 0));
310 static void ts8550b_gip_sequence(struct st7701 *st7701)
313 * ST7701_SPEC_V1.2 is unable to provide enough information above this
314 * specific command sequence, so grab the same from vendor BSP driver.
316 ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02);
317 ST7701_DSI(st7701, 0xE1, 0x0B, 0x00, 0x0D, 0x00, 0x0C, 0x00, 0x0E,
318 0x00, 0x00, 0x44, 0x44);
319 ST7701_DSI(st7701, 0xE2, 0x33, 0x33, 0x44, 0x44, 0x64, 0x00, 0x66,
320 0x00, 0x65, 0x00, 0x67, 0x00, 0x00);
321 ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33);
322 ST7701_DSI(st7701, 0xE4, 0x44, 0x44);
323 ST7701_DSI(st7701, 0xE5, 0x0C, 0x78, 0x3C, 0xA0, 0x0E, 0x78, 0x3C,
324 0xA0, 0x10, 0x78, 0x3C, 0xA0, 0x12, 0x78, 0x3C, 0xA0);
325 ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33);
326 ST7701_DSI(st7701, 0xE7, 0x44, 0x44);
327 ST7701_DSI(st7701, 0xE8, 0x0D, 0x78, 0x3C, 0xA0, 0x0F, 0x78, 0x3C,
328 0xA0, 0x11, 0x78, 0x3C, 0xA0, 0x13, 0x78, 0x3C, 0xA0);
329 ST7701_DSI(st7701, 0xEB, 0x02, 0x02, 0x39, 0x39, 0xEE, 0x44, 0x00);
330 ST7701_DSI(st7701, 0xEC, 0x00, 0x00);
331 ST7701_DSI(st7701, 0xED, 0xFF, 0xF1, 0x04, 0x56, 0x72, 0x3F, 0xFF,
332 0xFF, 0xFF, 0xFF, 0xF3, 0x27, 0x65, 0x40, 0x1F, 0xFF);
335 static void dmt028vghmcmi_1a_gip_sequence(struct st7701 *st7701)
337 ST7701_DSI(st7701, 0xEE, 0x42);
338 ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02);
340 ST7701_DSI(st7701, 0xE1,
341 0x04, 0xA0, 0x06, 0xA0,
342 0x05, 0xA0, 0x07, 0xA0,
344 ST7701_DSI(st7701, 0xE2,
345 0x00, 0x00, 0x00, 0x00,
346 0x00, 0x00, 0x00, 0x00,
347 0x00, 0x00, 0x00, 0x00);
348 ST7701_DSI(st7701, 0xE3,
349 0x00, 0x00, 0x22, 0x22);
350 ST7701_DSI(st7701, 0xE4, 0x44, 0x44);
351 ST7701_DSI(st7701, 0xE5,
352 0x0C, 0x90, 0xA0, 0xA0,
353 0x0E, 0x92, 0xA0, 0xA0,
354 0x08, 0x8C, 0xA0, 0xA0,
355 0x0A, 0x8E, 0xA0, 0xA0);
356 ST7701_DSI(st7701, 0xE6,
357 0x00, 0x00, 0x22, 0x22);
358 ST7701_DSI(st7701, 0xE7, 0x44, 0x44);
359 ST7701_DSI(st7701, 0xE8,
360 0x0D, 0x91, 0xA0, 0xA0,
361 0x0F, 0x93, 0xA0, 0xA0,
362 0x09, 0x8D, 0xA0, 0xA0,
363 0x0B, 0x8F, 0xA0, 0xA0);
364 ST7701_DSI(st7701, 0xEB,
365 0x00, 0x00, 0xE4, 0xE4,
367 ST7701_DSI(st7701, 0xED,
368 0xFF, 0xF5, 0x47, 0x6F,
369 0x0B, 0xA1, 0xAB, 0xFF,
370 0xFF, 0xBA, 0x1A, 0xB0,
371 0xF6, 0x74, 0x5F, 0xFF);
372 ST7701_DSI(st7701, 0xEF,
373 0x08, 0x08, 0x08, 0x40,
376 st7701_switch_cmd_bkx(st7701, false, 0);
378 st7701_switch_cmd_bkx(st7701, true, 3);
379 ST7701_DSI(st7701, 0xE6, 0x7C);
380 ST7701_DSI(st7701, 0xE8, 0x00, 0x0E);
382 st7701_switch_cmd_bkx(st7701, false, 0);
383 ST7701_DSI(st7701, 0x11);
386 st7701_switch_cmd_bkx(st7701, true, 3);
387 ST7701_DSI(st7701, 0xE8, 0x00, 0x0C);
389 ST7701_DSI(st7701, 0xE8, 0x00, 0x00);
391 st7701_switch_cmd_bkx(st7701, false, 0);
392 ST7701_DSI(st7701, 0x11);
394 ST7701_DSI(st7701, 0xE8, 0x00, 0x00);
396 st7701_switch_cmd_bkx(st7701, false, 0);
398 ST7701_DSI(st7701, 0x3A, 0x70);
401 static void kd50t048a_gip_sequence(struct st7701 *st7701)
404 * ST7701_SPEC_V1.2 is unable to provide enough information above this
405 * specific command sequence, so grab the same from vendor BSP driver.
407 ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02);
408 ST7701_DSI(st7701, 0xE1, 0x08, 0x00, 0x0A, 0x00, 0x07, 0x00, 0x09,
409 0x00, 0x00, 0x33, 0x33);
410 ST7701_DSI(st7701, 0xE2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
411 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
412 ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33);
413 ST7701_DSI(st7701, 0xE4, 0x44, 0x44);
414 ST7701_DSI(st7701, 0xE5, 0x0E, 0x60, 0xA0, 0xA0, 0x10, 0x60, 0xA0,
415 0xA0, 0x0A, 0x60, 0xA0, 0xA0, 0x0C, 0x60, 0xA0, 0xA0);
416 ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33);
417 ST7701_DSI(st7701, 0xE7, 0x44, 0x44);
418 ST7701_DSI(st7701, 0xE8, 0x0D, 0x60, 0xA0, 0xA0, 0x0F, 0x60, 0xA0,
419 0xA0, 0x09, 0x60, 0xA0, 0xA0, 0x0B, 0x60, 0xA0, 0xA0);
420 ST7701_DSI(st7701, 0xEB, 0x02, 0x01, 0xE4, 0xE4, 0x44, 0x00, 0x40);
421 ST7701_DSI(st7701, 0xEC, 0x02, 0x01);
422 ST7701_DSI(st7701, 0xED, 0xAB, 0x89, 0x76, 0x54, 0x01, 0xFF, 0xFF,
423 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x45, 0x67, 0x98, 0xBA);
426 static int st7701_prepare(struct drm_panel *panel)
428 struct st7701 *st7701 = panel_to_st7701(panel);
431 gpiod_set_value(st7701->reset, 0);
433 ret = regulator_bulk_enable(ARRAY_SIZE(st7701->supplies),
439 gpiod_set_value(st7701->reset, 1);
442 st7701_init_sequence(st7701);
444 if (st7701->desc->gip_sequence)
445 st7701->desc->gip_sequence(st7701);
447 /* Disable Command2 */
448 st7701_switch_cmd_bkx(st7701, false, 0);
453 static int st7701_enable(struct drm_panel *panel)
455 struct st7701 *st7701 = panel_to_st7701(panel);
457 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00);
462 static int st7701_disable(struct drm_panel *panel)
464 struct st7701 *st7701 = panel_to_st7701(panel);
466 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_OFF, 0x00);
471 static int st7701_unprepare(struct drm_panel *panel)
473 struct st7701 *st7701 = panel_to_st7701(panel);
475 ST7701_DSI(st7701, MIPI_DCS_ENTER_SLEEP_MODE, 0x00);
477 msleep(st7701->sleep_delay);
479 gpiod_set_value(st7701->reset, 0);
482 * During the Resetting period, the display will be blanked
483 * (The display is entering blanking sequence, which maximum
484 * time is 120 ms, when Reset Starts in Sleep Out –mode. The
485 * display remains the blank state in Sleep In –mode.) and
486 * then return to Default condition for Hardware Reset.
488 * So we need wait sleep_delay time to make sure reset completed.
490 msleep(st7701->sleep_delay);
492 regulator_bulk_disable(ARRAY_SIZE(st7701->supplies), st7701->supplies);
497 static int st7701_get_modes(struct drm_panel *panel,
498 struct drm_connector *connector)
500 struct st7701 *st7701 = panel_to_st7701(panel);
501 const struct drm_display_mode *desc_mode = st7701->desc->mode;
502 struct drm_display_mode *mode;
504 mode = drm_mode_duplicate(connector->dev, desc_mode);
506 dev_err(&st7701->dsi->dev, "failed to add mode %ux%u@%u\n",
507 desc_mode->hdisplay, desc_mode->vdisplay,
508 drm_mode_vrefresh(desc_mode));
512 drm_mode_set_name(mode);
513 drm_mode_probed_add(connector, mode);
515 connector->display_info.width_mm = desc_mode->width_mm;
516 connector->display_info.height_mm = desc_mode->height_mm;
519 * TODO: Remove once all drm drivers call
520 * drm_connector_set_orientation_from_panel()
522 drm_connector_set_panel_orientation(connector, st7701->orientation);
527 static enum drm_panel_orientation st7701_get_orientation(struct drm_panel *panel)
529 struct st7701 *st7701 = panel_to_st7701(panel);
531 return st7701->orientation;
534 static const struct drm_panel_funcs st7701_funcs = {
535 .disable = st7701_disable,
536 .unprepare = st7701_unprepare,
537 .prepare = st7701_prepare,
538 .enable = st7701_enable,
539 .get_modes = st7701_get_modes,
540 .get_orientation = st7701_get_orientation,
543 static const struct drm_display_mode ts8550b_mode = {
547 .hsync_start = 480 + 38,
548 .hsync_end = 480 + 38 + 12,
549 .htotal = 480 + 38 + 12 + 12,
552 .vsync_start = 854 + 18,
553 .vsync_end = 854 + 18 + 8,
554 .vtotal = 854 + 18 + 8 + 4,
559 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
562 static const struct st7701_panel_desc ts8550b_desc = {
563 .mode = &ts8550b_mode,
565 .format = MIPI_DSI_FMT_RGB888,
566 .panel_sleep_delay = 80, /* panel need extra 80ms for sleep out cmd */
569 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
570 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0),
571 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
572 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xe),
573 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
574 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x15),
575 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xf),
577 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
578 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x11),
579 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x8),
580 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x8),
581 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8),
583 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x8),
584 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x23),
585 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x4),
586 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
587 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13),
589 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x12),
590 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
591 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x2b),
592 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
593 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x34),
594 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
595 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x1f)
598 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
599 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0),
600 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
601 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xe),
602 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0x2) |
603 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x15),
604 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xf),
606 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
607 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x13),
608 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x7),
609 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x9),
610 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8),
612 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x8),
613 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x22),
614 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x4),
615 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
616 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x10),
618 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0xe),
619 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
620 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x2c),
621 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
622 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x34),
623 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
624 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x1f)
633 .gamma_op_bias = OP_BIAS_MAX,
634 .input_op_bias = OP_BIAS_MIN,
635 .output_op_bias = OP_BIAS_MIN,
639 .gip_sequence = ts8550b_gip_sequence,
642 static const struct drm_display_mode dmt028vghmcmi_1a_mode = {
646 .hsync_start = 480 + 40,
647 .hsync_end = 480 + 40 + 4,
648 .htotal = 480 + 40 + 4 + 20,
651 .vsync_start = 640 + 2,
652 .vsync_end = 640 + 2 + 40,
653 .vtotal = 640 + 2 + 40 + 16,
658 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
660 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
663 static const struct st7701_panel_desc dmt028vghmcmi_1a_desc = {
664 .mode = &dmt028vghmcmi_1a_mode,
666 .format = MIPI_DSI_FMT_RGB888,
667 .panel_sleep_delay = 5, /* panel need extra 5ms for sleep out cmd */
670 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
671 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0),
672 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
673 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0x10),
674 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
675 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x17),
676 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xd),
678 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
679 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x11),
680 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x6),
681 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x5),
682 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8),
684 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x7),
685 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x1f),
686 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x4),
687 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
688 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x11),
690 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0xe),
691 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
692 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x29),
693 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
694 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x30),
695 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
696 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x1f)
699 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
700 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0),
701 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
702 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xd),
703 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
704 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x14),
705 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xe),
707 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
708 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x11),
709 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x6),
710 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x4),
711 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8),
713 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x8),
714 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x20),
715 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x5),
716 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
717 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13),
719 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x13),
720 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
721 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x26),
722 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
723 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x30),
724 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
725 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x1f)
734 .gamma_op_bias = OP_BIAS_MIDDLE,
735 .input_op_bias = OP_BIAS_MIN,
736 .output_op_bias = OP_BIAS_MIN,
740 .gip_sequence = dmt028vghmcmi_1a_gip_sequence,
743 static const struct drm_display_mode kd50t048a_mode = {
747 .hsync_start = 480 + 2,
748 .hsync_end = 480 + 2 + 10,
749 .htotal = 480 + 2 + 10 + 2,
752 .vsync_start = 854 + 2,
753 .vsync_end = 854 + 2 + 2,
754 .vtotal = 854 + 2 + 2 + 17,
759 .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,
762 static const struct st7701_panel_desc kd50t048a_desc = {
763 .mode = &kd50t048a_mode,
765 .format = MIPI_DSI_FMT_RGB888,
766 .panel_sleep_delay = 0,
769 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
770 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0),
771 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
772 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xd),
773 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
774 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x14),
775 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xd),
777 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
778 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x10),
779 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x5),
780 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x2),
781 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8),
783 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x8),
784 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x1e),
785 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x5),
786 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
787 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13),
789 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x11),
790 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 2) |
791 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x23),
792 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
793 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x29),
794 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
795 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x18)
798 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
799 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0),
800 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
801 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xc),
802 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
803 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x14),
804 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xc),
806 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
807 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x10),
808 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x5),
809 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x3),
810 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8),
812 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x7),
813 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x20),
814 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x5),
815 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
816 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13),
818 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x11),
819 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 2) |
820 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x24),
821 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
822 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x29),
823 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) |
824 CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x18)
833 .gamma_op_bias = OP_BIAS_MIDDLE,
834 .input_op_bias = OP_BIAS_MIN,
835 .output_op_bias = OP_BIAS_MIN,
839 .gip_sequence = kd50t048a_gip_sequence,
842 static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
844 const struct st7701_panel_desc *desc;
845 struct st7701 *st7701;
848 st7701 = devm_kzalloc(&dsi->dev, sizeof(*st7701), GFP_KERNEL);
852 desc = of_device_get_match_data(&dsi->dev);
853 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
854 MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS;
855 dsi->format = desc->format;
856 dsi->lanes = desc->lanes;
858 st7701->supplies[0].supply = "VCC";
859 st7701->supplies[1].supply = "IOVCC";
861 ret = devm_regulator_bulk_get(&dsi->dev, ARRAY_SIZE(st7701->supplies),
866 st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
867 if (IS_ERR(st7701->reset)) {
868 dev_err(&dsi->dev, "Couldn't get our reset GPIO\n");
869 return PTR_ERR(st7701->reset);
872 ret = of_drm_get_panel_orientation(dsi->dev.of_node, &st7701->orientation);
874 return dev_err_probe(&dsi->dev, ret, "Failed to get orientation\n");
876 drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs,
877 DRM_MODE_CONNECTOR_DSI);
880 * Once sleep out has been issued, ST7701 IC required to wait 120ms
881 * before initiating new commands.
883 * On top of that some panels might need an extra delay to wait, so
884 * add panel specific delay for those cases. As now this panel specific
885 * delay information is referenced from those panel BSP driver, example
886 * ts8550b and there is no valid documentation for that.
888 st7701->sleep_delay = 120 + desc->panel_sleep_delay;
890 ret = drm_panel_of_backlight(&st7701->panel);
894 drm_panel_add(&st7701->panel);
896 mipi_dsi_set_drvdata(dsi, st7701);
900 ret = mipi_dsi_attach(dsi);
907 drm_panel_remove(&st7701->panel);
911 static void st7701_dsi_remove(struct mipi_dsi_device *dsi)
913 struct st7701 *st7701 = mipi_dsi_get_drvdata(dsi);
915 mipi_dsi_detach(dsi);
916 drm_panel_remove(&st7701->panel);
919 static const struct of_device_id st7701_of_match[] = {
920 { .compatible = "densitron,dmt028vghmcmi-1a", .data = &dmt028vghmcmi_1a_desc },
921 { .compatible = "elida,kd50t048a", .data = &kd50t048a_desc },
922 { .compatible = "techstar,ts8550b", .data = &ts8550b_desc },
925 MODULE_DEVICE_TABLE(of, st7701_of_match);
927 static struct mipi_dsi_driver st7701_dsi_driver = {
928 .probe = st7701_dsi_probe,
929 .remove = st7701_dsi_remove,
932 .of_match_table = st7701_of_match,
935 module_mipi_dsi_driver(st7701_dsi_driver);
937 MODULE_AUTHOR("Jagan Teki <jagan@amarulasolutions.com>");
938 MODULE_DESCRIPTION("Sitronix ST7701 LCD Panel Driver");
939 MODULE_LICENSE("GPL");