Commit b06e145f authored by Thierry Reding's avatar Thierry Reding
Browse files

drm/tegra: sor: Make the +5V HDMI supply optional



The SOR supports multiple display modes, but only when driving an HDMI
monitor does it make sense to control the +5V power supply. eDP and DP
don't need this, so make it optional.

This fixes a crash observed during system suspend/resume.

Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent a8817489
Loading
Loading
Loading
Loading
+16 −2
Original line number Original line Diff line number Diff line
@@ -3970,15 +3970,29 @@ static int tegra_sor_runtime_resume(struct device *dev)
static int tegra_sor_suspend(struct device *dev)
static int tegra_sor_suspend(struct device *dev)
{
{
	struct tegra_sor *sor = dev_get_drvdata(dev);
	struct tegra_sor *sor = dev_get_drvdata(dev);
	int err;


	return regulator_disable(sor->hdmi_supply);
	if (sor->hdmi_supply) {
		err = regulator_disable(sor->hdmi_supply);
		if (err < 0)
			return err;
	}

	return 0;
}
}


static int tegra_sor_resume(struct device *dev)
static int tegra_sor_resume(struct device *dev)
{
{
	struct tegra_sor *sor = dev_get_drvdata(dev);
	struct tegra_sor *sor = dev_get_drvdata(dev);
	int err;


	return regulator_enable(sor->hdmi_supply);
	if (sor->hdmi_supply) {
		err = regulator_enable(sor->hdmi_supply);
		if (err < 0)
			return err;
	}

	return 0;
}
}


static const struct dev_pm_ops tegra_sor_pm_ops = {
static const struct dev_pm_ops tegra_sor_pm_ops = {