Skip to content

Commit 271502e

Browse files
committed
drm/tegra: output: Implement system suspend/resume
Implement generic system suspend/resume functions that can be used with any output type. Currently this only implements disabling and enabling of the IRQ functionality across system suspend/resume. This prevents an interrupt from happening before the display driver has fully resumed. Signed-off-by: Thierry Reding <[email protected]>
1 parent f90965a commit 271502e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

drivers/gpu/drm/tegra/output.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,19 @@ void tegra_output_find_possible_crtcs(struct tegra_output *output,
250250

251251
output->encoder.possible_crtcs = mask;
252252
}
253+
254+
int tegra_output_suspend(struct tegra_output *output)
255+
{
256+
if (output->hpd_irq)
257+
disable_irq(output->hpd_irq);
258+
259+
return 0;
260+
}
261+
262+
int tegra_output_resume(struct tegra_output *output)
263+
{
264+
if (output->hpd_irq)
265+
enable_irq(output->hpd_irq);
266+
267+
return 0;
268+
}

drivers/gpu/drm/tegra/sor.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3995,9 +3995,16 @@ static int __maybe_unused tegra_sor_suspend(struct device *dev)
39953995
struct tegra_sor *sor = dev_get_drvdata(dev);
39963996
int err;
39973997

3998+
err = tegra_output_suspend(&sor->output);
3999+
if (err < 0) {
4000+
dev_err(dev, "failed to suspend output: %d\n", err);
4001+
return err;
4002+
}
4003+
39984004
if (sor->hdmi_supply) {
39994005
err = regulator_disable(sor->hdmi_supply);
40004006
if (err < 0) {
4007+
tegra_output_resume(&sor->output);
40014008
return err;
40024009
}
40034010
}
@@ -4016,6 +4023,16 @@ static int __maybe_unused tegra_sor_resume(struct device *dev)
40164023
return err;
40174024
}
40184025

4026+
err = tegra_output_resume(&sor->output);
4027+
if (err < 0) {
4028+
dev_err(dev, "failed to resume output: %d\n", err);
4029+
4030+
if (sor->hdmi_supply)
4031+
regulator_disable(sor->hdmi_supply);
4032+
4033+
return err;
4034+
}
4035+
40194036
return 0;
40204037
}
40214038

0 commit comments

Comments
 (0)