Lines Matching +full:display +full:- +full:related

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 */
93 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hsd060bhw4_init_sequence()
107 /* 5.19.3 SETDISP: Set display related register (B2h) */ in hsd060bhw4_init_sequence()
111 /* 5.19.4 SETCYC: Set display waveform cycles (B4h) */ in hsd060bhw4_init_sequence()
140 /* 5.19.25 SETGAMMA: Set gamma curve related setting (E0h) */ 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()
224 /* 5.19.3 SETDISP: Set display related register (B2h) */ in powkiddy_x55_init_sequence()
228 /* 5.19.4 SETCYC: Set display waveform cycles (B4h) */ in powkiddy_x55_init_sequence()
261 /* 5.19.25 SETGAMMA: Set gamma curve related setting (E0h) */ 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()
344 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in mchp_ac40t08a_init_sequence()
362 /* 5.19.3 SETDISP: Set display related register (B2h) */ in mchp_ac40t08a_init_sequence()
366 /* 5.19.4 SETCYC: Set display waveform cycles (B4h) */ in mchp_ac40t08a_init_sequence()
408 /* 5.19.25 SETGAMMA: Set gamma curve related setting (E0h) */ in mchp_ac40t08a_init_sequence()
421 /* Unknown command, not listed in the HX8394-F datasheet (C0H) */ in mchp_ac40t08a_init_sequence()
433 /* Unknown command, not listed in the HX8394-F datasheet (D4h) */ in mchp_ac40t08a_init_sequence()
462 /* Unknown command, not listed in the HX8394-F datasheet (C6h) */ in mchp_ac40t08a_init_sequence()
495 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hx8394_enable()
498 ret = ctx->desc->init_sequence(ctx); in hx8394_enable()
500 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in hx8394_enable()
506 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in hx8394_enable()
515 dev_err(ctx->dev, "Failed to turn on the display: %d\n", ret); in hx8394_enable()
532 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hx8394_disable()
537 dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); in hx8394_disable()
550 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_unprepare()
552 regulator_disable(ctx->iovcc); in hx8394_unprepare()
553 regulator_disable(ctx->vcc); in hx8394_unprepare()
563 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_prepare()
565 ret = regulator_enable(ctx->vcc); in hx8394_prepare()
567 dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); in hx8394_prepare()
571 ret = regulator_enable(ctx->iovcc); in hx8394_prepare()
573 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in hx8394_prepare()
577 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in hx8394_prepare()
584 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_prepare()
585 regulator_disable(ctx->vcc); in hx8394_prepare()
595 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in hx8394_get_modes()
597 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in hx8394_get_modes()
598 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in hx8394_get_modes()
599 drm_mode_vrefresh(ctx->desc->mode)); in hx8394_get_modes()
600 return -ENOMEM; in hx8394_get_modes()
605 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in hx8394_get_modes()
606 connector->display_info.width_mm = mode->width_mm; in hx8394_get_modes()
607 connector->display_info.height_mm = mode->height_mm; in hx8394_get_modes()
617 return ctx->orientation; in hx8394_get_orientation()
631 struct device *dev = &dsi->dev; in hx8394_probe()
637 return -ENOMEM; in hx8394_probe()
639 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); in hx8394_probe()
640 if (IS_ERR(ctx->reset_gpio)) in hx8394_probe()
641 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in hx8394_probe()
644 ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); in hx8394_probe()
646 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); in hx8394_probe()
652 ctx->dev = dev; in hx8394_probe()
653 ctx->desc = of_device_get_match_data(dev); in hx8394_probe()
655 dsi->mode_flags = ctx->desc->mode_flags; in hx8394_probe()
656 dsi->format = ctx->desc->format; in hx8394_probe()
657 dsi->lanes = ctx->desc->lanes; in hx8394_probe()
659 ctx->vcc = devm_regulator_get(dev, "vcc"); in hx8394_probe()
660 if (IS_ERR(ctx->vcc)) in hx8394_probe()
661 return dev_err_probe(dev, PTR_ERR(ctx->vcc), in hx8394_probe()
664 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in hx8394_probe()
665 if (IS_ERR(ctx->iovcc)) in hx8394_probe()
666 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in hx8394_probe()
669 drm_panel_init(&ctx->panel, dev, &hx8394_drm_funcs, in hx8394_probe()
672 ret = drm_panel_of_backlight(&ctx->panel); in hx8394_probe()
676 drm_panel_add(&ctx->panel); in hx8394_probe()
681 drm_panel_remove(&ctx->panel); in hx8394_probe()
685 dev_dbg(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", in hx8394_probe()
686 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in hx8394_probe()
687 drm_mode_vrefresh(ctx->desc->mode), in hx8394_probe()
688 mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); in hx8394_probe()
700 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in hx8394_remove()
702 drm_panel_remove(&ctx->panel); in hx8394_remove()
707 { .compatible = "powkiddy,x55-panel", .data = &powkiddy_x55_desc },
708 { .compatible = "microchip,ac40t08a-mipi-panel", .data = &mchp_ac40t08a_desc },