Commit b8072e8124c42605cebcb29a49ef5d9a4846566a
1 parent
d6932a87d6
Exists in
smarc_8mq-imx_v2020.04_5.4.24_2.1.0
and in
1 other branch
MLK-24001 video: imx8m: Fix DCSS shut down issue when HDMI FW is not loaded
When HDMI FW is not loaded by ROM, for example uuu download, or without FW in boot image. The DCSS driver still disable HDMI and shut itself, this causes hang before booting kernel. Add a flag for indicating whether the display is enabled, and check it in device remove. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 702b236c2a0f519f8e1cea5514e3723693f7c9b5)
Showing 1 changed file with 12 additions and 9 deletions Side-by-side Diff
drivers/video/imx/imx8m_dcss.c
... | ... | @@ -57,6 +57,7 @@ |
57 | 57 | |
58 | 58 | bool hpol; /* horizontal pulse polarity */ |
59 | 59 | bool vpol; /* vertical pulse polarity */ |
60 | + bool enabled; | |
60 | 61 | |
61 | 62 | fdt_addr_t addr; |
62 | 63 | }; |
... | ... | @@ -459,7 +460,7 @@ |
459 | 460 | if (ret) |
460 | 461 | return ret; |
461 | 462 | |
462 | - printf("pixelclock %u, hlen %u, vlen %u\n", | |
463 | + debug("pixelclock %u, hlen %u, vlen %u\n", | |
463 | 464 | priv->timings.pixelclock.typ, priv->timings.hactive.typ, priv->timings.vactive.typ); |
464 | 465 | |
465 | 466 | imx8m_dcss_power_init(); |
466 | 467 | |
... | ... | @@ -468,10 +469,11 @@ |
468 | 469 | |
469 | 470 | imx8m_dcss_reset(dev); |
470 | 471 | |
471 | - display_enable(priv->disp_dev, 32, NULL); | |
472 | + if (display_enable(priv->disp_dev, 32, NULL) == 0) { | |
473 | + imx8m_dcss_init(dev); | |
474 | + priv->enabled = true; | |
475 | + } | |
472 | 476 | |
473 | - imx8m_dcss_init(dev); | |
474 | - | |
475 | 477 | uc_priv->bpix = VIDEO_BPP32; |
476 | 478 | uc_priv->xsize = priv->timings.hactive.typ; |
477 | 479 | uc_priv->ysize = priv->timings.vactive.typ; |
... | ... | @@ -491,7 +493,7 @@ |
491 | 493 | { |
492 | 494 | struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); |
493 | 495 | |
494 | - printf("%s\n", __func__); | |
496 | + debug("%s\n", __func__); | |
495 | 497 | |
496 | 498 | /* Max size supported by LCDIF, because in bind, we can't probe panel */ |
497 | 499 | plat->size = 1920 * 1080 *4; |
498 | 500 | |
... | ... | @@ -503,11 +505,12 @@ |
503 | 505 | { |
504 | 506 | struct imx8m_dcss_priv *priv = dev_get_priv(dev); |
505 | 507 | |
506 | - printf("%s\n", __func__); | |
508 | + debug("%s\n", __func__); | |
507 | 509 | |
508 | - device_remove(priv->disp_dev, DM_REMOVE_NORMAL); | |
509 | - | |
510 | - imx8m_display_shutdown(dev); | |
510 | + if (priv->enabled) { | |
511 | + device_remove(priv->disp_dev, DM_REMOVE_NORMAL); | |
512 | + imx8m_display_shutdown(dev); | |
513 | + } | |
511 | 514 | |
512 | 515 | return 0; |
513 | 516 | } |