Lines Matching +full:iovcc +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0+
5 * base on panel-kingdisplay-kd097d04.c
29 struct regulator *iovcc; member
272 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk500hd1829_unprepare()
275 if (!ctx->prepared) in ltk500hd1829_unprepare()
280 dev_err(panel->dev, "failed to set display off: %d\n", ret); in ltk500hd1829_unprepare()
284 dev_err(panel->dev, "failed to enter sleep mode: %d\n", ret); in ltk500hd1829_unprepare()
290 regulator_disable(ctx->iovcc); in ltk500hd1829_unprepare()
291 regulator_disable(ctx->vcc); in ltk500hd1829_unprepare()
293 ctx->prepared = false; in ltk500hd1829_unprepare()
301 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in ltk500hd1829_prepare()
305 if (ctx->prepared) in ltk500hd1829_prepare()
308 ret = regulator_enable(ctx->vcc); in ltk500hd1829_prepare()
310 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret); in ltk500hd1829_prepare()
313 ret = regulator_enable(ctx->iovcc); in ltk500hd1829_prepare()
315 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in ltk500hd1829_prepare()
319 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in ltk500hd1829_prepare()
322 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in ltk500hd1829_prepare()
331 dev_err(panel->dev, "failed to write init cmds: %d\n", ret); in ltk500hd1829_prepare()
338 dev_err(panel->dev, "failed to exit sleep mode: %d\n", ret); in ltk500hd1829_prepare()
347 dev_err(panel->dev, "failed to set display on: %d\n", ret); in ltk500hd1829_prepare()
351 ctx->prepared = true; in ltk500hd1829_prepare()
356 regulator_disable(ctx->iovcc); in ltk500hd1829_prepare()
358 regulator_disable(ctx->vcc); in ltk500hd1829_prepare()
382 mode = drm_mode_duplicate(connector->dev, &default_mode); in ltk500hd1829_get_modes()
384 dev_err(ctx->dev, "failed to add mode %ux%u@%u\n", in ltk500hd1829_get_modes()
387 return -ENOMEM; in ltk500hd1829_get_modes()
392 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in ltk500hd1829_get_modes()
393 connector->display_info.width_mm = mode->width_mm; in ltk500hd1829_get_modes()
394 connector->display_info.height_mm = mode->height_mm; in ltk500hd1829_get_modes()
409 struct device *dev = &dsi->dev; in ltk500hd1829_probe()
412 ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); in ltk500hd1829_probe()
414 return -ENOMEM; in ltk500hd1829_probe()
416 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in ltk500hd1829_probe()
417 if (IS_ERR(ctx->reset_gpio)) { in ltk500hd1829_probe()
419 return PTR_ERR(ctx->reset_gpio); in ltk500hd1829_probe()
422 ctx->vcc = devm_regulator_get(dev, "vcc"); in ltk500hd1829_probe()
423 if (IS_ERR(ctx->vcc)) { in ltk500hd1829_probe()
424 ret = PTR_ERR(ctx->vcc); in ltk500hd1829_probe()
425 if (ret != -EPROBE_DEFER) in ltk500hd1829_probe()
430 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in ltk500hd1829_probe()
431 if (IS_ERR(ctx->iovcc)) { in ltk500hd1829_probe()
432 ret = PTR_ERR(ctx->iovcc); in ltk500hd1829_probe()
433 if (ret != -EPROBE_DEFER) in ltk500hd1829_probe()
434 dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); in ltk500hd1829_probe()
440 ctx->dev = dev; in ltk500hd1829_probe()
442 dsi->lanes = 4; in ltk500hd1829_probe()
443 dsi->format = MIPI_DSI_FMT_RGB888; in ltk500hd1829_probe()
444 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in ltk500hd1829_probe()
447 drm_panel_init(&ctx->panel, &dsi->dev, <k500hd1829_funcs, in ltk500hd1829_probe()
450 ret = drm_panel_of_backlight(&ctx->panel); in ltk500hd1829_probe()
454 drm_panel_add(&ctx->panel); in ltk500hd1829_probe()
459 drm_panel_remove(&ctx->panel); in ltk500hd1829_probe()
471 ret = drm_panel_unprepare(&ctx->panel); in ltk500hd1829_shutdown()
473 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in ltk500hd1829_shutdown()
475 ret = drm_panel_disable(&ctx->panel); in ltk500hd1829_shutdown()
477 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in ltk500hd1829_shutdown()
489 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); in ltk500hd1829_remove()
491 drm_panel_remove(&ctx->panel); in ltk500hd1829_remove()
504 .name = "panel-leadtek-ltk500hd1829",
513 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");