summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSvyatoslav Ryhel <clamor95@gmail.com>2024-01-23 19:16:22 +0200
committerAnatolij Gustschin <agust@denx.de>2024-04-21 09:07:01 +0200
commit8a8bfd8c137ced359958b8409b73d7f72466b89d (patch)
treed56035e3cd3366b3cee1cf908a4fd07d7bc8361d
parent97b6914e2b125ae47ae6711cb0975a18b75c1634 (diff)
video: tegra20: dc: add powergate
Add powergate use on T114 to complete resetting of DC. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/video/tegra20/tegra-dc.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/video/tegra20/tegra-dc.c b/drivers/video/tegra20/tegra-dc.c
index 56a23b3c979..cc4b5b70015 100644
--- a/drivers/video/tegra20/tegra-dc.c
+++ b/drivers/video/tegra20/tegra-dc.c
@@ -20,6 +20,7 @@
#include <asm/arch/clock.h>
#include <asm/arch/funcmux.h>
#include <asm/arch/pinmux.h>
+#include <asm/arch/powergate.h>
#include <asm/arch/pwm.h>
#include "tegra-dc.h"
@@ -30,6 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
struct tegra_dc_soc_info {
bool has_timer;
bool has_rgb;
+ bool has_pgate;
};
/* Information about the display controller */
@@ -349,6 +351,28 @@ static int tegra_lcd_probe(struct udevice *dev)
funcmux_select(PERIPH_ID_DISP1, FUNCMUX_DEFAULT);
#endif
+ if (priv->soc->has_pgate) {
+ uint powergate;
+
+ if (priv->pipe)
+ powergate = TEGRA_POWERGATE_DISB;
+ else
+ powergate = TEGRA_POWERGATE_DIS;
+
+ ret = tegra_powergate_power_off(powergate);
+ if (ret < 0) {
+ log_err("failed to power off DISP gate: %d", ret);
+ return ret;
+ }
+
+ ret = tegra_powergate_sequence_power_up(powergate,
+ priv->dc_clk[0]);
+ if (ret < 0) {
+ log_err("failed to power up DISP gate: %d", ret);
+ return ret;
+ }
+ }
+
if (tegra_display_probe(priv, (void *)plat->base)) {
debug("%s: Failed to probe display driver\n", __func__);
return -1;
@@ -493,16 +517,19 @@ static const struct video_ops tegra_lcd_ops = {
static const struct tegra_dc_soc_info tegra20_dc_soc_info = {
.has_timer = true,
.has_rgb = true,
+ .has_pgate = false,
};
static const struct tegra_dc_soc_info tegra30_dc_soc_info = {
.has_timer = false,
.has_rgb = true,
+ .has_pgate = false,
};
static const struct tegra_dc_soc_info tegra114_dc_soc_info = {
.has_timer = false,
.has_rgb = false,
+ .has_pgate = true,
};
static const struct udevice_id tegra_lcd_ids[] = {