Lines Matching refs:st7701

101 struct st7701;
127 void (*gip_sequence)(struct st7701 *st7701);
130 struct st7701 { struct
141 static inline struct st7701 *panel_to_st7701(struct drm_panel *panel) in panel_to_st7701() argument
143 return container_of(panel, struct st7701, panel); in panel_to_st7701()
146 static inline int st7701_dsi_write(struct st7701 *st7701, const void *seq, in st7701_dsi_write() argument
149 return mipi_dsi_dcs_write_buffer(st7701->dsi, seq, len); in st7701_dsi_write()
152 #define ST7701_DSI(st7701, seq...) \ argument
155 st7701_dsi_write(st7701, d, ARRAY_SIZE(d)); \
158 static u8 st7701_vgls_map(struct st7701 *st7701) in st7701_vgls_map() argument
160 const struct st7701_panel_desc *desc = st7701->desc; in st7701_vgls_map()
183 static void st7701_switch_cmd_bkx(struct st7701 *st7701, bool cmd2, u8 bkx) in st7701_switch_cmd_bkx() argument
192 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, 0x77, 0x01, 0x00, 0x00, val); in st7701_switch_cmd_bkx()
195 static void st7701_init_sequence(struct st7701 *st7701) in st7701_init_sequence() argument
197 const struct st7701_panel_desc *desc = st7701->desc; in st7701_init_sequence()
202 ST7701_DSI(st7701, MIPI_DCS_SOFT_RESET, 0x00); in st7701_init_sequence()
207 ST7701_DSI(st7701, MIPI_DCS_EXIT_SLEEP_MODE, 0x00); in st7701_init_sequence()
209 msleep(st7701->sleep_delay); in st7701_init_sequence()
212 st7701_switch_cmd_bkx(st7701, true, 0); in st7701_init_sequence()
214 mipi_dsi_dcs_write(st7701->dsi, DSI_CMD2_BK0_PVGAMCTRL, in st7701_init_sequence()
216 mipi_dsi_dcs_write(st7701->dsi, DSI_CMD2_BK0_NVGAMCTRL, in st7701_init_sequence()
229 ST7701_DSI(st7701, DSI_CMD2_BK0_LNESET, in st7701_init_sequence()
233 ST7701_DSI(st7701, DSI_CMD2_BK0_PORCTRL, in st7701_init_sequence()
244 ST7701_DSI(st7701, DSI_CMD2_BK0_INVSEL, in st7701_init_sequence()
251 st7701_switch_cmd_bkx(st7701, true, 1); in st7701_init_sequence()
254 ST7701_DSI(st7701, DSI_CMD2_BK1_VRHS, in st7701_init_sequence()
259 ST7701_DSI(st7701, DSI_CMD2_BK1_VCOM, in st7701_init_sequence()
264 ST7701_DSI(st7701, DSI_CMD2_BK1_VGHSS, in st7701_init_sequence()
271 ST7701_DSI(st7701, DSI_CMD2_BK1_TESTCMD, DSI_CMD2_BK1_TESTCMD_VAL); in st7701_init_sequence()
274 ST7701_DSI(st7701, DSI_CMD2_BK1_VGLS, in st7701_init_sequence()
276 FIELD_PREP(DSI_CMD2_BK1_VGLS_MASK, st7701_vgls_map(st7701))); in st7701_init_sequence()
278 ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR1, in st7701_init_sequence()
287 ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR2, in st7701_init_sequence()
294 ST7701_DSI(st7701, DSI_CMD2_BK1_SPD1, in st7701_init_sequence()
300 ST7701_DSI(st7701, DSI_CMD2_BK1_SPD2, in st7701_init_sequence()
305 ST7701_DSI(st7701, DSI_CMD2_BK1_MIPISET1, in st7701_init_sequence()
310 static void ts8550b_gip_sequence(struct st7701 *st7701) in ts8550b_gip_sequence() argument
316 ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02); in ts8550b_gip_sequence()
317 ST7701_DSI(st7701, 0xE1, 0x0B, 0x00, 0x0D, 0x00, 0x0C, 0x00, 0x0E, in ts8550b_gip_sequence()
319 ST7701_DSI(st7701, 0xE2, 0x33, 0x33, 0x44, 0x44, 0x64, 0x00, 0x66, in ts8550b_gip_sequence()
321 ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33); in ts8550b_gip_sequence()
322 ST7701_DSI(st7701, 0xE4, 0x44, 0x44); in ts8550b_gip_sequence()
323 ST7701_DSI(st7701, 0xE5, 0x0C, 0x78, 0x3C, 0xA0, 0x0E, 0x78, 0x3C, in ts8550b_gip_sequence()
325 ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33); in ts8550b_gip_sequence()
326 ST7701_DSI(st7701, 0xE7, 0x44, 0x44); in ts8550b_gip_sequence()
327 ST7701_DSI(st7701, 0xE8, 0x0D, 0x78, 0x3C, 0xA0, 0x0F, 0x78, 0x3C, in ts8550b_gip_sequence()
329 ST7701_DSI(st7701, 0xEB, 0x02, 0x02, 0x39, 0x39, 0xEE, 0x44, 0x00); in ts8550b_gip_sequence()
330 ST7701_DSI(st7701, 0xEC, 0x00, 0x00); in ts8550b_gip_sequence()
331 ST7701_DSI(st7701, 0xED, 0xFF, 0xF1, 0x04, 0x56, 0x72, 0x3F, 0xFF, in ts8550b_gip_sequence()
335 static void dmt028vghmcmi_1a_gip_sequence(struct st7701 *st7701) in dmt028vghmcmi_1a_gip_sequence() argument
337 ST7701_DSI(st7701, 0xEE, 0x42); in dmt028vghmcmi_1a_gip_sequence()
338 ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02); in dmt028vghmcmi_1a_gip_sequence()
340 ST7701_DSI(st7701, 0xE1, in dmt028vghmcmi_1a_gip_sequence()
344 ST7701_DSI(st7701, 0xE2, in dmt028vghmcmi_1a_gip_sequence()
348 ST7701_DSI(st7701, 0xE3, in dmt028vghmcmi_1a_gip_sequence()
350 ST7701_DSI(st7701, 0xE4, 0x44, 0x44); in dmt028vghmcmi_1a_gip_sequence()
351 ST7701_DSI(st7701, 0xE5, in dmt028vghmcmi_1a_gip_sequence()
356 ST7701_DSI(st7701, 0xE6, in dmt028vghmcmi_1a_gip_sequence()
358 ST7701_DSI(st7701, 0xE7, 0x44, 0x44); in dmt028vghmcmi_1a_gip_sequence()
359 ST7701_DSI(st7701, 0xE8, in dmt028vghmcmi_1a_gip_sequence()
364 ST7701_DSI(st7701, 0xEB, in dmt028vghmcmi_1a_gip_sequence()
367 ST7701_DSI(st7701, 0xED, in dmt028vghmcmi_1a_gip_sequence()
372 ST7701_DSI(st7701, 0xEF, in dmt028vghmcmi_1a_gip_sequence()
376 st7701_switch_cmd_bkx(st7701, false, 0); in dmt028vghmcmi_1a_gip_sequence()
378 st7701_switch_cmd_bkx(st7701, true, 3); in dmt028vghmcmi_1a_gip_sequence()
379 ST7701_DSI(st7701, 0xE6, 0x7C); in dmt028vghmcmi_1a_gip_sequence()
380 ST7701_DSI(st7701, 0xE8, 0x00, 0x0E); in dmt028vghmcmi_1a_gip_sequence()
382 st7701_switch_cmd_bkx(st7701, false, 0); in dmt028vghmcmi_1a_gip_sequence()
383 ST7701_DSI(st7701, 0x11); in dmt028vghmcmi_1a_gip_sequence()
386 st7701_switch_cmd_bkx(st7701, true, 3); in dmt028vghmcmi_1a_gip_sequence()
387 ST7701_DSI(st7701, 0xE8, 0x00, 0x0C); in dmt028vghmcmi_1a_gip_sequence()
389 ST7701_DSI(st7701, 0xE8, 0x00, 0x00); in dmt028vghmcmi_1a_gip_sequence()
391 st7701_switch_cmd_bkx(st7701, false, 0); in dmt028vghmcmi_1a_gip_sequence()
392 ST7701_DSI(st7701, 0x11); in dmt028vghmcmi_1a_gip_sequence()
394 ST7701_DSI(st7701, 0xE8, 0x00, 0x00); in dmt028vghmcmi_1a_gip_sequence()
396 st7701_switch_cmd_bkx(st7701, false, 0); in dmt028vghmcmi_1a_gip_sequence()
398 ST7701_DSI(st7701, 0x3A, 0x70); in dmt028vghmcmi_1a_gip_sequence()
401 static void kd50t048a_gip_sequence(struct st7701 *st7701) in kd50t048a_gip_sequence() argument
407 ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02); in kd50t048a_gip_sequence()
408 ST7701_DSI(st7701, 0xE1, 0x08, 0x00, 0x0A, 0x00, 0x07, 0x00, 0x09, in kd50t048a_gip_sequence()
410 ST7701_DSI(st7701, 0xE2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, in kd50t048a_gip_sequence()
412 ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33); in kd50t048a_gip_sequence()
413 ST7701_DSI(st7701, 0xE4, 0x44, 0x44); in kd50t048a_gip_sequence()
414 ST7701_DSI(st7701, 0xE5, 0x0E, 0x60, 0xA0, 0xA0, 0x10, 0x60, 0xA0, in kd50t048a_gip_sequence()
416 ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33); in kd50t048a_gip_sequence()
417 ST7701_DSI(st7701, 0xE7, 0x44, 0x44); in kd50t048a_gip_sequence()
418 ST7701_DSI(st7701, 0xE8, 0x0D, 0x60, 0xA0, 0xA0, 0x0F, 0x60, 0xA0, in kd50t048a_gip_sequence()
420 ST7701_DSI(st7701, 0xEB, 0x02, 0x01, 0xE4, 0xE4, 0x44, 0x00, 0x40); in kd50t048a_gip_sequence()
421 ST7701_DSI(st7701, 0xEC, 0x02, 0x01); in kd50t048a_gip_sequence()
422 ST7701_DSI(st7701, 0xED, 0xAB, 0x89, 0x76, 0x54, 0x01, 0xFF, 0xFF, in kd50t048a_gip_sequence()
428 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_prepare() local
431 gpiod_set_value(st7701->reset, 0); in st7701_prepare()
433 ret = regulator_bulk_enable(ARRAY_SIZE(st7701->supplies), in st7701_prepare()
434 st7701->supplies); in st7701_prepare()
439 gpiod_set_value(st7701->reset, 1); in st7701_prepare()
442 st7701_init_sequence(st7701); in st7701_prepare()
444 if (st7701->desc->gip_sequence) in st7701_prepare()
445 st7701->desc->gip_sequence(st7701); in st7701_prepare()
448 st7701_switch_cmd_bkx(st7701, false, 0); in st7701_prepare()
455 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_enable() local
457 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00); in st7701_enable()
464 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_disable() local
466 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_OFF, 0x00); in st7701_disable()
473 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_unprepare() local
475 ST7701_DSI(st7701, MIPI_DCS_ENTER_SLEEP_MODE, 0x00); in st7701_unprepare()
477 msleep(st7701->sleep_delay); in st7701_unprepare()
479 gpiod_set_value(st7701->reset, 0); in st7701_unprepare()
490 msleep(st7701->sleep_delay); in st7701_unprepare()
492 regulator_bulk_disable(ARRAY_SIZE(st7701->supplies), st7701->supplies); in st7701_unprepare()
500 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_get_modes() local
501 const struct drm_display_mode *desc_mode = st7701->desc->mode; in st7701_get_modes()
506 dev_err(&st7701->dsi->dev, "failed to add mode %ux%u@%u\n", in st7701_get_modes()
522 drm_connector_set_panel_orientation(connector, st7701->orientation); in st7701_get_modes()
529 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_get_orientation() local
531 return st7701->orientation; in st7701_get_orientation()
845 struct st7701 *st7701; in st7701_dsi_probe() local
848 st7701 = devm_kzalloc(&dsi->dev, sizeof(*st7701), GFP_KERNEL); in st7701_dsi_probe()
849 if (!st7701) in st7701_dsi_probe()
858 st7701->supplies[0].supply = "VCC"; in st7701_dsi_probe()
859 st7701->supplies[1].supply = "IOVCC"; in st7701_dsi_probe()
861 ret = devm_regulator_bulk_get(&dsi->dev, ARRAY_SIZE(st7701->supplies), in st7701_dsi_probe()
862 st7701->supplies); in st7701_dsi_probe()
866 st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); in st7701_dsi_probe()
867 if (IS_ERR(st7701->reset)) { in st7701_dsi_probe()
869 return PTR_ERR(st7701->reset); in st7701_dsi_probe()
872 ret = of_drm_get_panel_orientation(dsi->dev.of_node, &st7701->orientation); in st7701_dsi_probe()
876 drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs, in st7701_dsi_probe()
888 st7701->sleep_delay = 120 + desc->panel_sleep_delay; in st7701_dsi_probe()
890 ret = drm_panel_of_backlight(&st7701->panel); in st7701_dsi_probe()
894 drm_panel_add(&st7701->panel); in st7701_dsi_probe()
896 mipi_dsi_set_drvdata(dsi, st7701); in st7701_dsi_probe()
897 st7701->dsi = dsi; in st7701_dsi_probe()
898 st7701->desc = desc; in st7701_dsi_probe()
907 drm_panel_remove(&st7701->panel); in st7701_dsi_probe()
913 struct st7701 *st7701 = mipi_dsi_get_drvdata(dsi); in st7701_dsi_remove() local
916 drm_panel_remove(&st7701->panel); in st7701_dsi_remove()