Lines Matching +full:iovcc +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0
5 * - Rocktech jh057n00900 5.5" MIPI-DSI panel
13 #include <linux/media-bus-format.h>
26 #define DRV_NAME "panel-sitronix-st7703"
60 struct regulator *iovcc; member
82 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in jh057n_init_sequence()
163 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xbd599_init_sequence()
213 /* NVDDD_SEL = -1.8V, VDDD_SEL = out of range (possibly 1.9V?) */ in xbd599_init_sequence()
222 /* Zig-Zag Type C column inversion. */ in xbd599_init_sequence()
250 0x10 /* SLPIN_OPTION = 1 (no need vsync after sleep-in) in xbd599_init_sequence()
259 0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */ in xbd599_init_sequence()
282 0x2C, /* VCOMDC_F = -0.67V */ in xbd599_init_sequence()
283 0x2C /* VCOMDC_B = -0.67V */); in xbd599_init_sequence()
346 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in rg353v2_init_sequence()
439 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in st7703_enable()
442 ret = ctx->desc->init_sequence(ctx); in st7703_enable()
444 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in st7703_enable()
452 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in st7703_enable()
463 dev_dbg(ctx->dev, "Panel init sequence done\n"); in st7703_enable()
471 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in st7703_disable()
476 dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret); in st7703_disable()
480 dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); in st7703_disable()
489 if (!ctx->prepared) in st7703_unprepare()
492 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in st7703_unprepare()
493 regulator_disable(ctx->iovcc); in st7703_unprepare()
494 regulator_disable(ctx->vcc); in st7703_unprepare()
495 ctx->prepared = false; in st7703_unprepare()
505 if (ctx->prepared) in st7703_prepare()
508 dev_dbg(ctx->dev, "Resetting the panel\n"); in st7703_prepare()
509 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in st7703_prepare()
511 ret = regulator_enable(ctx->iovcc); in st7703_prepare()
513 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in st7703_prepare()
517 ret = regulator_enable(ctx->vcc); in st7703_prepare()
519 dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); in st7703_prepare()
520 regulator_disable(ctx->iovcc); in st7703_prepare()
527 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in st7703_prepare()
530 ctx->prepared = true; in st7703_prepare()
545 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in st7703_get_modes()
547 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in st7703_get_modes()
548 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in st7703_get_modes()
549 drm_mode_vrefresh(ctx->desc->mode)); in st7703_get_modes()
550 return -ENOMEM; in st7703_get_modes()
555 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in st7703_get_modes()
556 connector->display_info.width_mm = mode->width_mm; in st7703_get_modes()
557 connector->display_info.height_mm = mode->height_mm; in st7703_get_modes()
560 drm_display_info_set_bus_formats(&connector->display_info, in st7703_get_modes()
578 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in allpixelson_set()
580 dev_dbg(ctx->dev, "Setting all pixels on\n"); in allpixelson_set()
584 drm_panel_disable(&ctx->panel); in allpixelson_set()
585 drm_panel_unprepare(&ctx->panel); in allpixelson_set()
586 drm_panel_prepare(&ctx->panel); in allpixelson_set()
587 drm_panel_enable(&ctx->panel); in allpixelson_set()
597 ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL); in st7703_debugfs_init()
599 debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx, in st7703_debugfs_init()
605 debugfs_remove_recursive(ctx->debugfs); in st7703_debugfs_remove()
606 ctx->debugfs = NULL; in st7703_debugfs_remove()
611 struct device *dev = &dsi->dev; in st7703_probe()
617 return -ENOMEM; in st7703_probe()
619 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in st7703_probe()
620 if (IS_ERR(ctx->reset_gpio)) in st7703_probe()
621 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset gpio\n"); in st7703_probe()
625 ctx->dev = dev; in st7703_probe()
626 ctx->desc = of_device_get_match_data(dev); in st7703_probe()
628 dsi->mode_flags = ctx->desc->mode_flags; in st7703_probe()
629 dsi->format = ctx->desc->format; in st7703_probe()
630 dsi->lanes = ctx->desc->lanes; in st7703_probe()
632 ctx->vcc = devm_regulator_get(dev, "vcc"); in st7703_probe()
633 if (IS_ERR(ctx->vcc)) in st7703_probe()
634 return dev_err_probe(dev, PTR_ERR(ctx->vcc), "Failed to request vcc regulator\n"); in st7703_probe()
636 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in st7703_probe()
637 if (IS_ERR(ctx->iovcc)) in st7703_probe()
638 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in st7703_probe()
639 "Failed to request iovcc regulator\n"); in st7703_probe()
641 drm_panel_init(&ctx->panel, dev, &st7703_drm_funcs, in st7703_probe()
644 ret = drm_panel_of_backlight(&ctx->panel); in st7703_probe()
648 drm_panel_add(&ctx->panel); in st7703_probe()
653 drm_panel_remove(&ctx->panel); in st7703_probe()
657 dev_info(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", in st7703_probe()
658 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in st7703_probe()
659 drm_mode_vrefresh(ctx->desc->mode), in st7703_probe()
660 mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); in st7703_probe()
671 ret = drm_panel_unprepare(&ctx->panel); in st7703_shutdown()
673 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in st7703_shutdown()
675 ret = drm_panel_disable(&ctx->panel); in st7703_shutdown()
677 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in st7703_shutdown()
689 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in st7703_remove()
691 drm_panel_remove(&ctx->panel); in st7703_remove()
697 { .compatible = "anbernic,rg353v-panel-v2", .data = &rg353v2_desc },