Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tegra: dsi: Soft-reset controller on ->disable

This reset is necessary to properly clean up the internal state of the
controller.

Signed-off-by: Thierry Reding <treding@nvidia.com>

+25
+25
drivers/gpu/drm/tegra/dsi.c
··· 724 724 usleep_range(5000, 10000); 725 725 } 726 726 727 + static void tegra_dsi_soft_reset(struct tegra_dsi *dsi) 728 + { 729 + u32 value; 730 + 731 + value = tegra_dsi_readl(dsi, DSI_POWER_CONTROL); 732 + value &= ~DSI_POWER_CONTROL_ENABLE; 733 + tegra_dsi_writel(dsi, value, DSI_POWER_CONTROL); 734 + 735 + usleep_range(300, 1000); 736 + 737 + value = tegra_dsi_readl(dsi, DSI_POWER_CONTROL); 738 + value |= DSI_POWER_CONTROL_ENABLE; 739 + tegra_dsi_writel(dsi, value, DSI_POWER_CONTROL); 740 + 741 + usleep_range(300, 1000); 742 + 743 + value = tegra_dsi_readl(dsi, DSI_TRIGGER); 744 + if (value) 745 + tegra_dsi_writel(dsi, 0, DSI_TRIGGER); 746 + 747 + if (dsi->slave) 748 + tegra_dsi_soft_reset(dsi->slave); 749 + } 750 + 727 751 static int tegra_output_dsi_disable(struct tegra_output *output) 728 752 { 729 753 struct tegra_dc *dc = to_tegra_dc(output->encoder.crtc); ··· 786 762 if (err < 0) 787 763 dev_dbg(dsi->dev, "failed to idle DSI: %d\n", err); 788 764 765 + tegra_dsi_soft_reset(dsi); 789 766 tegra_dsi_disable(dsi); 790 767 791 768 dsi->enabled = false;