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()
466 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in st7703_get_modes()
468 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in st7703_get_modes()
469 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in st7703_get_modes()
470 drm_mode_vrefresh(ctx->desc->mode)); in st7703_get_modes()
471 return -ENOMEM; in st7703_get_modes()
476 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in st7703_get_modes()
477 connector->display_info.width_mm = mode->width_mm; in st7703_get_modes()
478 connector->display_info.height_mm = mode->height_mm; in st7703_get_modes()
481 drm_display_info_set_bus_formats(&connector->display_info, in st7703_get_modes()
499 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in allpixelson_set()
501 dev_dbg(ctx->dev, "Setting all pixels on\n"); in allpixelson_set()
505 drm_panel_disable(&ctx->panel); in allpixelson_set()
506 drm_panel_unprepare(&ctx->panel); in allpixelson_set()
507 drm_panel_prepare(&ctx->panel); in allpixelson_set()
508 drm_panel_enable(&ctx->panel); in allpixelson_set()
518 ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL); in st7703_debugfs_init()
520 debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx, in st7703_debugfs_init()
526 debugfs_remove_recursive(ctx->debugfs); in st7703_debugfs_remove()
527 ctx->debugfs = NULL; in st7703_debugfs_remove()
532 struct device *dev = &dsi->dev; in st7703_probe()
538 return -ENOMEM; in st7703_probe()
540 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in st7703_probe()
541 if (IS_ERR(ctx->reset_gpio)) in st7703_probe()
542 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset gpio\n"); in st7703_probe()
546 ctx->dev = dev; in st7703_probe()
547 ctx->desc = of_device_get_match_data(dev); in st7703_probe()
549 dsi->mode_flags = ctx->desc->mode_flags; in st7703_probe()
550 dsi->format = ctx->desc->format; in st7703_probe()
551 dsi->lanes = ctx->desc->lanes; in st7703_probe()
553 ctx->vcc = devm_regulator_get(dev, "vcc"); in st7703_probe()
554 if (IS_ERR(ctx->vcc)) in st7703_probe()
555 return dev_err_probe(dev, PTR_ERR(ctx->vcc), "Failed to request vcc regulator\n"); in st7703_probe()
557 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in st7703_probe()
558 if (IS_ERR(ctx->iovcc)) in st7703_probe()
559 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in st7703_probe()
560 "Failed to request iovcc regulator\n"); 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()