Lines Matching +full:iovcc +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0
5 * - HannStar HSD060BHW4 5.99" MIPI-DSI panel
9 * Based on drivers/gpu/drm/panel/panel-sitronix-st7703.c
15 #include <linux/media-bus-format.h>
27 #define DRV_NAME "panel-himax-hx8394"
29 /* Manufacturer specific commands sent via DSI, listed in HX8394-F datasheet */
72 struct regulator *iovcc; member
93 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hsd060bhw4_init_sequence()
154 /* Unknown command, not listed in the HX8394-F datasheet */ in hsd060bhw4_init_sequence()
162 /* Unknown command, not listed in the HX8394-F datasheet */ in hsd060bhw4_init_sequence()
178 /* Unknown command, not listed in the HX8394-F datasheet */ in hsd060bhw4_init_sequence()
210 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in powkiddy_x55_init_sequence()
270 /* Unknown command, not listed in the HX8394-F datasheet */ in powkiddy_x55_init_sequence()
278 /* Unknown command, not listed in the HX8394-F datasheet */ in powkiddy_x55_init_sequence()
286 /* Unknown command, not listed in the HX8394-F datasheet */ in powkiddy_x55_init_sequence()
307 /* Unknown command, not listed in the HX8394-F datasheet */ in powkiddy_x55_init_sequence()
311 /* Unknown command, not listed in the HX8394-F datasheet */ in powkiddy_x55_init_sequence()
345 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hx8394_enable()
348 ret = ctx->desc->init_sequence(ctx); in hx8394_enable()
350 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in hx8394_enable()
356 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in hx8394_enable()
365 dev_err(ctx->dev, "Failed to turn on the display: %d\n", ret); in hx8394_enable()
383 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hx8394_disable()
388 dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); in hx8394_disable()
401 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_unprepare()
403 regulator_disable(ctx->iovcc); in hx8394_unprepare()
404 regulator_disable(ctx->vcc); in hx8394_unprepare()
414 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_prepare()
416 ret = regulator_enable(ctx->vcc); in hx8394_prepare()
418 dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); in hx8394_prepare()
422 ret = regulator_enable(ctx->iovcc); in hx8394_prepare()
424 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in hx8394_prepare()
428 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in hx8394_prepare()
435 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_prepare()
436 regulator_disable(ctx->vcc); in hx8394_prepare()
446 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in hx8394_get_modes()
448 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in hx8394_get_modes()
449 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in hx8394_get_modes()
450 drm_mode_vrefresh(ctx->desc->mode)); in hx8394_get_modes()
451 return -ENOMEM; in hx8394_get_modes()
456 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in hx8394_get_modes()
457 connector->display_info.width_mm = mode->width_mm; in hx8394_get_modes()
458 connector->display_info.height_mm = mode->height_mm; in hx8394_get_modes()
468 return ctx->orientation; in hx8394_get_orientation()
482 struct device *dev = &dsi->dev; in hx8394_probe()
488 return -ENOMEM; in hx8394_probe()
490 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in hx8394_probe()
491 if (IS_ERR(ctx->reset_gpio)) in hx8394_probe()
492 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in hx8394_probe()
495 ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); in hx8394_probe()
497 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); in hx8394_probe()
503 ctx->dev = dev; in hx8394_probe()
504 ctx->desc = of_device_get_match_data(dev); in hx8394_probe()
506 dsi->mode_flags = ctx->desc->mode_flags; in hx8394_probe()
507 dsi->format = ctx->desc->format; in hx8394_probe()
508 dsi->lanes = ctx->desc->lanes; in hx8394_probe()
510 ctx->vcc = devm_regulator_get(dev, "vcc"); in hx8394_probe()
511 if (IS_ERR(ctx->vcc)) in hx8394_probe()
512 return dev_err_probe(dev, PTR_ERR(ctx->vcc), in hx8394_probe()
515 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in hx8394_probe()
516 if (IS_ERR(ctx->iovcc)) in hx8394_probe()
517 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in hx8394_probe()
518 "Failed to request iovcc regulator\n"); in hx8394_probe()
520 drm_panel_init(&ctx->panel, dev, &hx8394_drm_funcs, in hx8394_probe()
523 ret = drm_panel_of_backlight(&ctx->panel); in hx8394_probe()
527 drm_panel_add(&ctx->panel); in hx8394_probe()
532 drm_panel_remove(&ctx->panel); in hx8394_probe()
536 dev_dbg(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", in hx8394_probe()
537 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in hx8394_probe()
538 drm_mode_vrefresh(ctx->desc->mode), in hx8394_probe()
539 mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); in hx8394_probe()
551 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in hx8394_remove()
553 drm_panel_remove(&ctx->panel); in hx8394_remove()
558 { .compatible = "powkiddy,x55-panel", .data = &powkiddy_x55_desc },