Lines Matching +full:iovcc +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0
8 #include <linux/media-bus-format.h>
37 struct regulator *iovcc; member
48 { 0x51, 0x85 }, /* VREG2OUT=-5V */
231 { 0x85, 0x0D }, /* VGL clamp level (-10V) */
257 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_init_sequence()
316 dev_err(ctx->dev, "failed to set tear on: %d\n", ret); in ltk050h3146w_init_sequence()
346 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_a2_select_page()
356 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_a2_write_page()
361 dev_err(ctx->dev, "failed to select page %d: %d\n", page, ret); in ltk050h3146w_a2_write_page()
369 dev_err(ctx->dev, "failed to write page %d init cmds: %d\n", page, ret); in ltk050h3146w_a2_write_page()
379 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_a2_init_sequence()
403 dev_err(ctx->dev, "failed to select page 0: %d\n", ret); in ltk050h3146w_a2_init_sequence()
410 dev_err(ctx->dev, "failed to set tear on: %d\n", ret); in ltk050h3146w_a2_init_sequence()
441 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_unprepare()
444 if (!ctx->prepared) in ltk050h3146w_unprepare()
449 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in ltk050h3146w_unprepare()
455 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in ltk050h3146w_unprepare()
459 regulator_disable(ctx->iovcc); in ltk050h3146w_unprepare()
460 regulator_disable(ctx->vci); in ltk050h3146w_unprepare()
462 ctx->prepared = false; in ltk050h3146w_unprepare()
470 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_prepare()
473 if (ctx->prepared) in ltk050h3146w_prepare()
476 dev_dbg(ctx->dev, "Resetting the panel\n"); in ltk050h3146w_prepare()
477 ret = regulator_enable(ctx->vci); in ltk050h3146w_prepare()
479 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret); in ltk050h3146w_prepare()
482 ret = regulator_enable(ctx->iovcc); in ltk050h3146w_prepare()
484 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in ltk050h3146w_prepare()
488 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in ltk050h3146w_prepare()
490 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in ltk050h3146w_prepare()
493 ret = ctx->panel_desc->init(ctx); in ltk050h3146w_prepare()
495 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in ltk050h3146w_prepare()
501 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in ltk050h3146w_prepare()
510 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in ltk050h3146w_prepare()
516 ctx->prepared = true; in ltk050h3146w_prepare()
521 regulator_disable(ctx->iovcc); in ltk050h3146w_prepare()
523 regulator_disable(ctx->vci); in ltk050h3146w_prepare()
533 mode = drm_mode_duplicate(connector->dev, ctx->panel_desc->mode); in ltk050h3146w_get_modes()
535 return -ENOMEM; in ltk050h3146w_get_modes()
539 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in ltk050h3146w_get_modes()
540 connector->display_info.width_mm = mode->width_mm; in ltk050h3146w_get_modes()
541 connector->display_info.height_mm = mode->height_mm; in ltk050h3146w_get_modes()
555 struct device *dev = &dsi->dev; in ltk050h3146w_probe()
561 return -ENOMEM; in ltk050h3146w_probe()
563 ctx->panel_desc = of_device_get_match_data(dev); in ltk050h3146w_probe()
564 if (!ctx->panel_desc) in ltk050h3146w_probe()
565 return -EINVAL; in ltk050h3146w_probe()
567 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in ltk050h3146w_probe()
568 if (IS_ERR(ctx->reset_gpio)) { in ltk050h3146w_probe()
570 return PTR_ERR(ctx->reset_gpio); in ltk050h3146w_probe()
573 ctx->vci = devm_regulator_get(dev, "vci"); in ltk050h3146w_probe()
574 if (IS_ERR(ctx->vci)) { in ltk050h3146w_probe()
575 ret = PTR_ERR(ctx->vci); in ltk050h3146w_probe()
576 if (ret != -EPROBE_DEFER) in ltk050h3146w_probe()
581 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in ltk050h3146w_probe()
582 if (IS_ERR(ctx->iovcc)) { in ltk050h3146w_probe()
583 ret = PTR_ERR(ctx->iovcc); in ltk050h3146w_probe()
584 if (ret != -EPROBE_DEFER) in ltk050h3146w_probe()
585 dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); in ltk050h3146w_probe()
591 ctx->dev = dev; in ltk050h3146w_probe()
593 dsi->lanes = 4; in ltk050h3146w_probe()
594 dsi->format = MIPI_DSI_FMT_RGB888; in ltk050h3146w_probe()
595 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in ltk050h3146w_probe()
598 drm_panel_init(&ctx->panel, &dsi->dev, <k050h3146w_funcs, in ltk050h3146w_probe()
601 ret = drm_panel_of_backlight(&ctx->panel); in ltk050h3146w_probe()
605 drm_panel_add(&ctx->panel); in ltk050h3146w_probe()
610 drm_panel_remove(&ctx->panel); in ltk050h3146w_probe()
622 ret = drm_panel_unprepare(&ctx->panel); in ltk050h3146w_shutdown()
624 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in ltk050h3146w_shutdown()
626 ret = drm_panel_disable(&ctx->panel); in ltk050h3146w_shutdown()
628 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in ltk050h3146w_shutdown()
640 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in ltk050h3146w_remove()
642 drm_panel_remove(&ctx->panel); in ltk050h3146w_remove()
653 .compatible = "leadtek,ltk050h3146w-a2",
662 .name = "panel-leadtek-ltk050h3146w",
671 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");