Lines Matching full:st7701
113 struct st7701;
139 void (*gip_sequence)(struct st7701 *st7701);
142 struct st7701 { struct
152 static inline struct st7701 *panel_to_st7701(struct drm_panel *panel) in panel_to_st7701() argument
154 return container_of(panel, struct st7701, panel); in panel_to_st7701()
157 static inline int st7701_dsi_write(struct st7701 *st7701, const void *seq, in st7701_dsi_write() argument
160 return mipi_dsi_dcs_write_buffer(st7701->dsi, seq, len); in st7701_dsi_write()
163 #define ST7701_DSI(st7701, seq...) \ argument
166 st7701_dsi_write(st7701, d, ARRAY_SIZE(d)); \
169 static u8 st7701_vgls_map(struct st7701 *st7701) in st7701_vgls_map() argument
171 const struct st7701_panel_desc *desc = st7701->desc; in st7701_vgls_map()
194 static void st7701_init_sequence(struct st7701 *st7701) in st7701_init_sequence() argument
196 const struct st7701_panel_desc *desc = st7701->desc; in st7701_init_sequence()
201 ST7701_DSI(st7701, MIPI_DCS_SOFT_RESET, 0x00); in st7701_init_sequence()
206 ST7701_DSI(st7701, MIPI_DCS_EXIT_SLEEP_MODE, 0x00); in st7701_init_sequence()
208 msleep(st7701->sleep_delay); in st7701_init_sequence()
211 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in st7701_init_sequence()
213 mipi_dsi_dcs_write(st7701->dsi, DSI_CMD2_BK0_PVGAMCTRL, in st7701_init_sequence()
215 mipi_dsi_dcs_write(st7701->dsi, DSI_CMD2_BK0_NVGAMCTRL, in st7701_init_sequence()
228 ST7701_DSI(st7701, DSI_CMD2_BK0_LNESET, in st7701_init_sequence()
232 ST7701_DSI(st7701, DSI_CMD2_BK0_PORCTRL, in st7701_init_sequence()
243 ST7701_DSI(st7701, DSI_CMD2_BK0_INVSEL, in st7701_init_sequence()
250 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, 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_DSI(st7701, DSI_CMD2BKX_SEL, in dmt028vghmcmi_1a_gip_sequence()
379 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in dmt028vghmcmi_1a_gip_sequence()
381 ST7701_DSI(st7701, 0xE6, 0x7C); in dmt028vghmcmi_1a_gip_sequence()
382 ST7701_DSI(st7701, 0xE8, 0x00, 0x0E); in dmt028vghmcmi_1a_gip_sequence()
384 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in dmt028vghmcmi_1a_gip_sequence()
386 ST7701_DSI(st7701, 0x11); in dmt028vghmcmi_1a_gip_sequence()
389 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in dmt028vghmcmi_1a_gip_sequence()
391 ST7701_DSI(st7701, 0xE8, 0x00, 0x0C); in dmt028vghmcmi_1a_gip_sequence()
393 ST7701_DSI(st7701, 0xE8, 0x00, 0x00); in dmt028vghmcmi_1a_gip_sequence()
395 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in dmt028vghmcmi_1a_gip_sequence()
397 ST7701_DSI(st7701, 0x11); in dmt028vghmcmi_1a_gip_sequence()
399 ST7701_DSI(st7701, 0xE8, 0x00, 0x00); in dmt028vghmcmi_1a_gip_sequence()
401 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in dmt028vghmcmi_1a_gip_sequence()
404 ST7701_DSI(st7701, 0x3A, 0x70); in dmt028vghmcmi_1a_gip_sequence()
409 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_prepare() local
412 gpiod_set_value(st7701->reset, 0); in st7701_prepare()
414 ret = regulator_bulk_enable(ARRAY_SIZE(st7701->supplies), in st7701_prepare()
415 st7701->supplies); in st7701_prepare()
420 gpiod_set_value(st7701->reset, 1); in st7701_prepare()
423 st7701_init_sequence(st7701); in st7701_prepare()
425 if (st7701->desc->gip_sequence) in st7701_prepare()
426 st7701->desc->gip_sequence(st7701); in st7701_prepare()
429 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in st7701_prepare()
437 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_enable() local
439 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00); in st7701_enable()
446 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_disable() local
448 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_OFF, 0x00); in st7701_disable()
455 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_unprepare() local
457 ST7701_DSI(st7701, MIPI_DCS_ENTER_SLEEP_MODE, 0x00); in st7701_unprepare()
459 msleep(st7701->sleep_delay); in st7701_unprepare()
461 gpiod_set_value(st7701->reset, 0); in st7701_unprepare()
472 msleep(st7701->sleep_delay); in st7701_unprepare()
474 regulator_bulk_disable(ARRAY_SIZE(st7701->supplies), st7701->supplies); in st7701_unprepare()
482 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_get_modes() local
483 const struct drm_display_mode *desc_mode = st7701->desc->mode; in st7701_get_modes()
488 dev_err(&st7701->dsi->dev, "failed to add mode %ux%u@%u\n", in st7701_get_modes()
714 struct st7701 *st7701; in st7701_dsi_probe() local
717 st7701 = devm_kzalloc(&dsi->dev, sizeof(*st7701), GFP_KERNEL); in st7701_dsi_probe()
718 if (!st7701) in st7701_dsi_probe()
727 st7701->supplies[0].supply = "VCC"; in st7701_dsi_probe()
728 st7701->supplies[1].supply = "IOVCC"; in st7701_dsi_probe()
730 ret = devm_regulator_bulk_get(&dsi->dev, ARRAY_SIZE(st7701->supplies), in st7701_dsi_probe()
731 st7701->supplies); in st7701_dsi_probe()
735 st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); in st7701_dsi_probe()
736 if (IS_ERR(st7701->reset)) { in st7701_dsi_probe()
738 return PTR_ERR(st7701->reset); in st7701_dsi_probe()
741 drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs, in st7701_dsi_probe()
745 * Once sleep out has been issued, ST7701 IC required to wait 120ms in st7701_dsi_probe()
753 st7701->sleep_delay = 120 + desc->panel_sleep_delay; in st7701_dsi_probe()
755 ret = drm_panel_of_backlight(&st7701->panel); in st7701_dsi_probe()
759 drm_panel_add(&st7701->panel); in st7701_dsi_probe()
761 mipi_dsi_set_drvdata(dsi, st7701); in st7701_dsi_probe()
762 st7701->dsi = dsi; in st7701_dsi_probe()
763 st7701->desc = desc; in st7701_dsi_probe()
770 struct st7701 *st7701 = mipi_dsi_get_drvdata(dsi); in st7701_dsi_remove() local
773 drm_panel_remove(&st7701->panel); in st7701_dsi_remove()
787 .name = "st7701",
794 MODULE_DESCRIPTION("Sitronix ST7701 LCD Panel Driver");