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"
56 struct regulator *iovcc; member
86 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in jh057n_init_sequence()
176 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xbd599_init_sequence()
226 /* NVDDD_SEL = -1.8V, VDDD_SEL = out of range (possibly 1.9V?) */ in xbd599_init_sequence()
235 /* Zig-Zag Type C column inversion. */ in xbd599_init_sequence()
263 0x10 /* SLPIN_OPTION = 1 (no need vsync after sleep-in) in xbd599_init_sequence()
273 0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */ in xbd599_init_sequence()
296 0x2C, /* VCOMDC_F = -0.67V */ in xbd599_init_sequence()
297 0x2C /* VCOMDC_B = -0.67V */); in xbd599_init_sequence()
361 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in st7703_enable()
364 ret = ctx->desc->init_sequence(ctx); in st7703_enable()
366 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in st7703_enable()
374 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in st7703_enable()
385 dev_dbg(ctx->dev, "Panel init sequence done\n"); in st7703_enable()
393 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in st7703_disable()
398 dev_err(ctx->dev, "Failed to turn off the display: %d\n", ret); in st7703_disable()
402 dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); in st7703_disable()
411 if (!ctx->prepared) in st7703_unprepare()
414 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in st7703_unprepare()
415 regulator_disable(ctx->iovcc); in st7703_unprepare()
416 regulator_disable(ctx->vcc); in st7703_unprepare()
417 ctx->prepared = false; in st7703_unprepare()
427 if (ctx->prepared) in st7703_prepare()
430 dev_dbg(ctx->dev, "Resetting the panel\n"); in st7703_prepare()
431 ret = regulator_enable(ctx->vcc); in st7703_prepare()
433 dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); in st7703_prepare()
436 ret = regulator_enable(ctx->iovcc); in st7703_prepare()
438 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in st7703_prepare()
442 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in st7703_prepare()
444 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in st7703_prepare()
447 ctx->prepared = true; in st7703_prepare()
452 regulator_disable(ctx->vcc); in st7703_prepare()
462 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in st7703_get_modes()
464 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in st7703_get_modes()
465 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in st7703_get_modes()
466 drm_mode_vrefresh(ctx->desc->mode)); in st7703_get_modes()
467 return -ENOMEM; in st7703_get_modes()
472 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in st7703_get_modes()
473 connector->display_info.width_mm = mode->width_mm; in st7703_get_modes()
474 connector->display_info.height_mm = mode->height_mm; in st7703_get_modes()
491 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in allpixelson_set()
493 dev_dbg(ctx->dev, "Setting all pixels on\n"); in allpixelson_set()
497 drm_panel_disable(&ctx->panel); in allpixelson_set()
498 drm_panel_unprepare(&ctx->panel); in allpixelson_set()
499 drm_panel_prepare(&ctx->panel); in allpixelson_set()
500 drm_panel_enable(&ctx->panel); in allpixelson_set()
510 ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL); in st7703_debugfs_init()
512 debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx, in st7703_debugfs_init()
518 debugfs_remove_recursive(ctx->debugfs); in st7703_debugfs_remove()
519 ctx->debugfs = NULL; in st7703_debugfs_remove()
524 struct device *dev = &dsi->dev; in st7703_probe()
530 return -ENOMEM; in st7703_probe()
532 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in st7703_probe()
533 if (IS_ERR(ctx->reset_gpio)) { in st7703_probe()
535 return PTR_ERR(ctx->reset_gpio); in st7703_probe()
540 ctx->dev = dev; in st7703_probe()
541 ctx->desc = of_device_get_match_data(dev); in st7703_probe()
543 dsi->mode_flags = ctx->desc->mode_flags; in st7703_probe()
544 dsi->format = ctx->desc->format; in st7703_probe()
545 dsi->lanes = ctx->desc->lanes; in st7703_probe()
547 ctx->vcc = devm_regulator_get(dev, "vcc"); in st7703_probe()
548 if (IS_ERR(ctx->vcc)) { in st7703_probe()
549 ret = PTR_ERR(ctx->vcc); in st7703_probe()
550 if (ret != -EPROBE_DEFER) in st7703_probe()
554 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in st7703_probe()
555 if (IS_ERR(ctx->iovcc)) { in st7703_probe()
556 ret = PTR_ERR(ctx->iovcc); in st7703_probe()
557 if (ret != -EPROBE_DEFER) in st7703_probe()
558 dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); in st7703_probe()
562 drm_panel_init(&ctx->panel, dev, &st7703_drm_funcs, in st7703_probe()
565 ret = drm_panel_of_backlight(&ctx->panel); in st7703_probe()
569 drm_panel_add(&ctx->panel); in st7703_probe()
574 drm_panel_remove(&ctx->panel); in st7703_probe()
578 dev_info(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", in st7703_probe()
579 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in st7703_probe()
580 drm_mode_vrefresh(ctx->desc->mode), in st7703_probe()
581 mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); in st7703_probe()
592 ret = drm_panel_unprepare(&ctx->panel); in st7703_shutdown()
594 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in st7703_shutdown()
596 ret = drm_panel_disable(&ctx->panel); in st7703_shutdown()
598 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in st7703_shutdown()
610 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in st7703_remove()
612 drm_panel_remove(&ctx->panel); in st7703_remove()