Lines Matching +full:op +full:- +full:panel
1 // SPDX-License-Identifier: GPL-2.0
8 #include <linux/media-bus-format.h>
34 struct drm_panel panel; member
47 { 0x51, 0x85 }, /* VREG2OUT=-5V */
230 { 0x85, 0x0D }, /* VGL clamp level (-10V) */
234 { 0xB5, 0x07 }, /* GAMMA OP */
235 { 0x31, 0x45 }, /* SOURCE OP */
241 struct ltk050h3146w *panel_to_ltk050h3146w(struct drm_panel *panel) in panel_to_ltk050h3146w() argument
243 return container_of(panel, struct ltk050h3146w, panel); in panel_to_ltk050h3146w()
249 * Init sequence was supplied by the panel vendor without much in ltk050h3148w_init_sequence()
323 * Init sequence was supplied by the panel vendor without much in ltk050h3146w_init_sequence()
422 * Init sequence was supplied by the panel vendor without much in ltk050h3146w_a2_init_sequence()
460 static int ltk050h3146w_unprepare(struct drm_panel *panel) in ltk050h3146w_unprepare() argument
462 struct ltk050h3146w *ctx = panel_to_ltk050h3146w(panel); in ltk050h3146w_unprepare()
463 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_unprepare()
471 regulator_disable(ctx->iovcc); in ltk050h3146w_unprepare()
472 regulator_disable(ctx->vci); in ltk050h3146w_unprepare()
477 static int ltk050h3146w_prepare(struct drm_panel *panel) in ltk050h3146w_prepare() argument
479 struct ltk050h3146w *ctx = panel_to_ltk050h3146w(panel); in ltk050h3146w_prepare()
480 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk050h3146w_prepare()
483 dev_dbg(ctx->dev, "Resetting the panel\n"); in ltk050h3146w_prepare()
484 dsi_ctx.accum_err = regulator_enable(ctx->vci); in ltk050h3146w_prepare()
486 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", dsi_ctx.accum_err); in ltk050h3146w_prepare()
489 dsi_ctx.accum_err = regulator_enable(ctx->iovcc); in ltk050h3146w_prepare()
491 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", dsi_ctx.accum_err); in ltk050h3146w_prepare()
495 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in ltk050h3146w_prepare()
497 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in ltk050h3146w_prepare()
500 ctx->panel_desc->init(&dsi_ctx); in ltk050h3146w_prepare()
513 regulator_disable(ctx->iovcc); in ltk050h3146w_prepare()
515 regulator_disable(ctx->vci); in ltk050h3146w_prepare()
519 static int ltk050h3146w_get_modes(struct drm_panel *panel, in ltk050h3146w_get_modes() argument
522 struct ltk050h3146w *ctx = panel_to_ltk050h3146w(panel); in ltk050h3146w_get_modes()
525 mode = drm_mode_duplicate(connector->dev, ctx->panel_desc->mode); in ltk050h3146w_get_modes()
527 return -ENOMEM; in ltk050h3146w_get_modes()
531 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in ltk050h3146w_get_modes()
532 connector->display_info.width_mm = mode->width_mm; in ltk050h3146w_get_modes()
533 connector->display_info.height_mm = mode->height_mm; in ltk050h3146w_get_modes()
547 struct device *dev = &dsi->dev; in ltk050h3146w_probe()
553 return -ENOMEM; in ltk050h3146w_probe()
555 ctx->panel_desc = of_device_get_match_data(dev); in ltk050h3146w_probe()
556 if (!ctx->panel_desc) in ltk050h3146w_probe()
557 return -EINVAL; in ltk050h3146w_probe()
559 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in ltk050h3146w_probe()
560 if (IS_ERR(ctx->reset_gpio)) in ltk050h3146w_probe()
561 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "cannot get reset gpio\n"); in ltk050h3146w_probe()
563 ctx->vci = devm_regulator_get(dev, "vci"); in ltk050h3146w_probe()
564 if (IS_ERR(ctx->vci)) in ltk050h3146w_probe()
565 return dev_err_probe(dev, PTR_ERR(ctx->vci), "Failed to request vci regulator\n"); in ltk050h3146w_probe()
567 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in ltk050h3146w_probe()
568 if (IS_ERR(ctx->iovcc)) in ltk050h3146w_probe()
569 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in ltk050h3146w_probe()
574 ctx->dev = dev; in ltk050h3146w_probe()
576 dsi->lanes = 4; in ltk050h3146w_probe()
577 dsi->format = MIPI_DSI_FMT_RGB888; in ltk050h3146w_probe()
578 dsi->mode_flags = ctx->panel_desc->mode_flags; in ltk050h3146w_probe()
580 drm_panel_init(&ctx->panel, &dsi->dev, <k050h3146w_funcs, in ltk050h3146w_probe()
583 ret = drm_panel_of_backlight(&ctx->panel); in ltk050h3146w_probe()
587 drm_panel_add(&ctx->panel); in ltk050h3146w_probe()
592 drm_panel_remove(&ctx->panel); in ltk050h3146w_probe()
606 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in ltk050h3146w_remove()
608 drm_panel_remove(&ctx->panel); in ltk050h3146w_remove()
617 .compatible = "leadtek,ltk050h3146w-a2",
630 .name = "panel-leadtek-ltk050h3146w",
638 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");
639 MODULE_DESCRIPTION("DRM driver for Leadtek LTK050H3146W MIPI DSI panel");