Lines Matching refs:jdi
60 static void jdi_wait_frames(struct jdi_panel *jdi, unsigned int frames) in jdi_wait_frames() argument
62 unsigned int refresh = drm_mode_vrefresh(jdi->mode); in jdi_wait_frames()
72 struct jdi_panel *jdi = to_panel_jdi(panel); in jdi_panel_disable() local
74 backlight_disable(jdi->backlight); in jdi_panel_disable()
76 jdi_wait_frames(jdi, 2); in jdi_panel_disable()
83 struct jdi_panel *jdi = to_panel_jdi(panel); in jdi_panel_unprepare() local
86 ret = mipi_dsi_dcs_set_display_off(jdi->link1); in jdi_panel_unprepare()
90 ret = mipi_dsi_dcs_set_display_off(jdi->link2); in jdi_panel_unprepare()
97 ret = mipi_dsi_dcs_enter_sleep_mode(jdi->link1); in jdi_panel_unprepare()
100 ret = mipi_dsi_dcs_enter_sleep_mode(jdi->link2); in jdi_panel_unprepare()
107 gpiod_set_value(jdi->reset_gpio, 1); in jdi_panel_unprepare()
112 gpiod_set_value(jdi->enable_gpio, 0); in jdi_panel_unprepare()
117 regulator_disable(jdi->ddi_supply); in jdi_panel_unprepare()
122 regulator_disable(jdi->supply); in jdi_panel_unprepare()
162 static int jdi_write_dcdc_registers(struct jdi_panel *jdi) in jdi_write_dcdc_registers() argument
165 mipi_dsi_generic_write_seq(jdi->link1, MCS_CMD_ACS_PROT, in jdi_write_dcdc_registers()
167 mipi_dsi_generic_write_seq(jdi->link2, MCS_CMD_ACS_PROT, in jdi_write_dcdc_registers()
174 mipi_dsi_generic_write_seq(jdi->link1, MCS_PWR_CTRL_FUNC, in jdi_write_dcdc_registers()
180 mipi_dsi_generic_write_seq(jdi->link2, MCS_PWR_CTRL_FUNC, in jdi_write_dcdc_registers()
191 struct jdi_panel *jdi = to_panel_jdi(panel); in jdi_panel_prepare() local
197 backlight_disable(jdi->backlight); in jdi_panel_prepare()
198 jdi_wait_frames(jdi, 3); in jdi_panel_prepare()
200 jdi->link1->mode_flags |= MIPI_DSI_MODE_LPM; in jdi_panel_prepare()
201 jdi->link2->mode_flags |= MIPI_DSI_MODE_LPM; in jdi_panel_prepare()
203 err = regulator_enable(jdi->supply); in jdi_panel_prepare()
211 err = regulator_enable(jdi->ddi_supply); in jdi_panel_prepare()
219 gpiod_set_value(jdi->enable_gpio, 1); in jdi_panel_prepare()
223 gpiod_set_value(jdi->reset_gpio, 0); in jdi_panel_prepare()
234 err = jdi_setup_symmetrical_split(jdi->link1, jdi->link2, in jdi_panel_prepare()
235 jdi->mode); in jdi_panel_prepare()
242 err = mipi_dsi_dcs_set_tear_scanline(jdi->link1, in jdi_panel_prepare()
243 jdi->mode->vdisplay - 16); in jdi_panel_prepare()
249 err = mipi_dsi_dcs_set_tear_scanline(jdi->link2, in jdi_panel_prepare()
250 jdi->mode->vdisplay - 16); in jdi_panel_prepare()
256 err = mipi_dsi_dcs_set_tear_on(jdi->link1, in jdi_panel_prepare()
263 err = mipi_dsi_dcs_set_tear_on(jdi->link2, in jdi_panel_prepare()
270 err = mipi_dsi_dcs_set_pixel_format(jdi->link1, MIPI_DCS_PIXEL_FMT_24BIT); in jdi_panel_prepare()
276 err = mipi_dsi_dcs_set_pixel_format(jdi->link2, MIPI_DCS_PIXEL_FMT_24BIT); in jdi_panel_prepare()
282 err = mipi_dsi_dcs_exit_sleep_mode(jdi->link1); in jdi_panel_prepare()
288 err = mipi_dsi_dcs_exit_sleep_mode(jdi->link2); in jdi_panel_prepare()
294 err = jdi_write_dcdc_registers(jdi); in jdi_panel_prepare()
305 err = mipi_dsi_dcs_set_display_on(jdi->link1); in jdi_panel_prepare()
311 err = mipi_dsi_dcs_set_display_on(jdi->link2); in jdi_panel_prepare()
317 jdi->link1->mode_flags &= ~MIPI_DSI_MODE_LPM; in jdi_panel_prepare()
318 jdi->link2->mode_flags &= ~MIPI_DSI_MODE_LPM; in jdi_panel_prepare()
323 regulator_disable(jdi->ddi_supply); in jdi_panel_prepare()
328 regulator_disable(jdi->supply); in jdi_panel_prepare()
337 struct jdi_panel *jdi = to_panel_jdi(panel); in jdi_panel_enable() local
343 jdi_wait_frames(jdi, 3); in jdi_panel_enable()
345 backlight_enable(jdi->backlight); in jdi_panel_enable()
367 struct jdi_panel *jdi = to_panel_jdi(panel); in jdi_panel_get_modes() local
368 struct device *dev = &jdi->link1->dev; in jdi_panel_get_modes()
403 static int jdi_panel_add(struct jdi_panel *jdi) in jdi_panel_add() argument
405 struct device *dev = &jdi->link1->dev; in jdi_panel_add()
407 jdi->mode = &default_mode; in jdi_panel_add()
409 jdi->supply = devm_regulator_get(dev, "power"); in jdi_panel_add()
410 if (IS_ERR(jdi->supply)) in jdi_panel_add()
411 return dev_err_probe(dev, PTR_ERR(jdi->supply), in jdi_panel_add()
414 jdi->ddi_supply = devm_regulator_get(dev, "ddi"); in jdi_panel_add()
415 if (IS_ERR(jdi->ddi_supply)) in jdi_panel_add()
416 return dev_err_probe(dev, PTR_ERR(jdi->ddi_supply), in jdi_panel_add()
419 jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in jdi_panel_add()
420 if (IS_ERR(jdi->reset_gpio)) in jdi_panel_add()
421 return dev_err_probe(dev, PTR_ERR(jdi->reset_gpio), in jdi_panel_add()
426 jdi->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in jdi_panel_add()
427 if (IS_ERR(jdi->enable_gpio)) in jdi_panel_add()
428 return dev_err_probe(dev, PTR_ERR(jdi->enable_gpio), in jdi_panel_add()
433 jdi->backlight = devm_of_find_backlight(dev); in jdi_panel_add()
434 if (IS_ERR(jdi->backlight)) in jdi_panel_add()
435 return dev_err_probe(dev, PTR_ERR(jdi->backlight), in jdi_panel_add()
438 drm_panel_init(&jdi->base, &jdi->link1->dev, &jdi_panel_funcs, in jdi_panel_add()
441 drm_panel_add(&jdi->base); in jdi_panel_add()
446 static void jdi_panel_del(struct jdi_panel *jdi) in jdi_panel_del() argument
448 if (jdi->base.dev) in jdi_panel_del()
449 drm_panel_remove(&jdi->base); in jdi_panel_del()
451 if (jdi->link2) in jdi_panel_del()
452 put_device(&jdi->link2->dev); in jdi_panel_del()
458 struct jdi_panel *jdi; in jdi_panel_dsi_probe() local
478 jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL); in jdi_panel_dsi_probe()
479 if (!jdi) { in jdi_panel_dsi_probe()
484 mipi_dsi_set_drvdata(dsi, jdi); in jdi_panel_dsi_probe()
486 jdi->link1 = dsi; in jdi_panel_dsi_probe()
487 jdi->link2 = secondary; in jdi_panel_dsi_probe()
489 err = jdi_panel_add(jdi); in jdi_panel_dsi_probe()
499 jdi_panel_del(jdi); in jdi_panel_dsi_probe()
509 struct jdi_panel *jdi = mipi_dsi_get_drvdata(dsi); in jdi_panel_dsi_remove() local
513 if (!jdi) in jdi_panel_dsi_remove()
516 err = jdi_panel_disable(&jdi->base); in jdi_panel_dsi_remove()
524 jdi_panel_del(jdi); in jdi_panel_dsi_remove()
529 struct jdi_panel *jdi = mipi_dsi_get_drvdata(dsi); in jdi_panel_dsi_shutdown() local
531 if (!jdi) in jdi_panel_dsi_shutdown()
534 jdi_panel_disable(&jdi->base); in jdi_panel_dsi_shutdown()