Lines Matching +full:vci +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0
8 #include <linux/media-bus-format.h>
36 struct regulator *vci; member
47 { 0x51, 0x85 }, /* VREG2OUT=-5V */
230 { 0x85, 0x0D }, /* VGL clamp level (-10V) */
248 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3148w_init_sequence()
300 dev_err(ctx->dev, "failed to set tear on: %d\n", ret); in ltk050h3148w_init_sequence()
332 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_init_sequence()
391 dev_err(ctx->dev, "failed to set tear on: %d\n", ret); in ltk050h3146w_init_sequence()
423 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_a2_select_page()
433 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_a2_write_page()
438 dev_err(ctx->dev, "failed to select page %d: %d\n", page, ret); in ltk050h3146w_a2_write_page()
446 dev_err(ctx->dev, "failed to write page %d init cmds: %d\n", page, ret); in ltk050h3146w_a2_write_page()
456 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_a2_init_sequence()
480 dev_err(ctx->dev, "failed to select page 0: %d\n", ret); in ltk050h3146w_a2_init_sequence()
487 dev_err(ctx->dev, "failed to set tear on: %d\n", ret); in ltk050h3146w_a2_init_sequence()
520 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_unprepare()
525 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in ltk050h3146w_unprepare()
531 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in ltk050h3146w_unprepare()
535 regulator_disable(ctx->iovcc); in ltk050h3146w_unprepare()
536 regulator_disable(ctx->vci); in ltk050h3146w_unprepare()
544 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_prepare()
547 dev_dbg(ctx->dev, "Resetting the panel\n"); in ltk050h3146w_prepare()
548 ret = regulator_enable(ctx->vci); in ltk050h3146w_prepare()
550 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret); in ltk050h3146w_prepare()
553 ret = regulator_enable(ctx->iovcc); in ltk050h3146w_prepare()
555 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in ltk050h3146w_prepare()
559 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in ltk050h3146w_prepare()
561 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in ltk050h3146w_prepare()
564 ret = ctx->panel_desc->init(ctx); in ltk050h3146w_prepare()
566 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in ltk050h3146w_prepare()
572 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in ltk050h3146w_prepare()
581 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in ltk050h3146w_prepare()
590 regulator_disable(ctx->iovcc); in ltk050h3146w_prepare()
592 regulator_disable(ctx->vci); in ltk050h3146w_prepare()
602 mode = drm_mode_duplicate(connector->dev, ctx->panel_desc->mode); in ltk050h3146w_get_modes()
604 return -ENOMEM; in ltk050h3146w_get_modes()
608 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in ltk050h3146w_get_modes()
609 connector->display_info.width_mm = mode->width_mm; in ltk050h3146w_get_modes()
610 connector->display_info.height_mm = mode->height_mm; in ltk050h3146w_get_modes()
624 struct device *dev = &dsi->dev; in ltk050h3146w_probe()
630 return -ENOMEM; in ltk050h3146w_probe()
632 ctx->panel_desc = of_device_get_match_data(dev); in ltk050h3146w_probe()
633 if (!ctx->panel_desc) in ltk050h3146w_probe()
634 return -EINVAL; in ltk050h3146w_probe()
636 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in ltk050h3146w_probe()
637 if (IS_ERR(ctx->reset_gpio)) in ltk050h3146w_probe()
638 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "cannot get reset gpio\n"); in ltk050h3146w_probe()
640 ctx->vci = devm_regulator_get(dev, "vci"); in ltk050h3146w_probe()
641 if (IS_ERR(ctx->vci)) in ltk050h3146w_probe()
642 return dev_err_probe(dev, PTR_ERR(ctx->vci), "Failed to request vci regulator\n"); in ltk050h3146w_probe()
644 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in ltk050h3146w_probe()
645 if (IS_ERR(ctx->iovcc)) in ltk050h3146w_probe()
646 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in ltk050h3146w_probe()
651 ctx->dev = dev; in ltk050h3146w_probe()
653 dsi->lanes = 4; in ltk050h3146w_probe()
654 dsi->format = MIPI_DSI_FMT_RGB888; in ltk050h3146w_probe()
655 dsi->mode_flags = ctx->panel_desc->mode_flags; in ltk050h3146w_probe()
657 drm_panel_init(&ctx->panel, &dsi->dev, <k050h3146w_funcs, in ltk050h3146w_probe()
660 ret = drm_panel_of_backlight(&ctx->panel); in ltk050h3146w_probe()
664 drm_panel_add(&ctx->panel); in ltk050h3146w_probe()
669 drm_panel_remove(&ctx->panel); in ltk050h3146w_probe()
683 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in ltk050h3146w_remove()
685 drm_panel_remove(&ctx->panel); in ltk050h3146w_remove()
694 .compatible = "leadtek,ltk050h3146w-a2",
707 .name = "panel-leadtek-ltk050h3146w",
715 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");