aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss/hdmi4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/hdmi4.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi4.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index cf6230eac31a..aabdda394c9c 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -635,10 +635,14 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)
635 635
636 hdmi->dss = dss; 636 hdmi->dss = dss;
637 637
638 r = hdmi_pll_init(dss, hdmi->pdev, &hdmi->pll, &hdmi->wp); 638 r = hdmi_runtime_get(hdmi);
639 if (r) 639 if (r)
640 return r; 640 return r;
641 641
642 r = hdmi_pll_init(dss, hdmi->pdev, &hdmi->pll, &hdmi->wp);
643 if (r)
644 goto err_runtime_put;
645
642 r = hdmi4_cec_init(hdmi->pdev, &hdmi->core, &hdmi->wp); 646 r = hdmi4_cec_init(hdmi->pdev, &hdmi->core, &hdmi->wp);
643 if (r) 647 if (r)
644 goto err_pll_uninit; 648 goto err_pll_uninit;
@@ -652,12 +656,16 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)
652 hdmi->debugfs = dss_debugfs_create_file(dss, "hdmi", hdmi_dump_regs, 656 hdmi->debugfs = dss_debugfs_create_file(dss, "hdmi", hdmi_dump_regs,
653 hdmi); 657 hdmi);
654 658
659 hdmi_runtime_put(hdmi);
660
655 return 0; 661 return 0;
656 662
657err_cec_uninit: 663err_cec_uninit:
658 hdmi4_cec_uninit(&hdmi->core); 664 hdmi4_cec_uninit(&hdmi->core);
659err_pll_uninit: 665err_pll_uninit:
660 hdmi_pll_uninit(&hdmi->pll); 666 hdmi_pll_uninit(&hdmi->pll);
667err_runtime_put:
668 hdmi_runtime_put(hdmi);
661 return r; 669 return r;
662} 670}
663 671
@@ -833,32 +841,6 @@ static int hdmi4_remove(struct platform_device *pdev)
833 return 0; 841 return 0;
834} 842}
835 843
836static int hdmi_runtime_suspend(struct device *dev)
837{
838 struct omap_hdmi *hdmi = dev_get_drvdata(dev);
839
840 dispc_runtime_put(hdmi->dss->dispc);
841
842 return 0;
843}
844
845static int hdmi_runtime_resume(struct device *dev)
846{
847 struct omap_hdmi *hdmi = dev_get_drvdata(dev);
848 int r;
849
850 r = dispc_runtime_get(hdmi->dss->dispc);
851 if (r < 0)
852 return r;
853
854 return 0;
855}
856
857static const struct dev_pm_ops hdmi_pm_ops = {
858 .runtime_suspend = hdmi_runtime_suspend,
859 .runtime_resume = hdmi_runtime_resume,
860};
861
862static const struct of_device_id hdmi_of_match[] = { 844static const struct of_device_id hdmi_of_match[] = {
863 { .compatible = "ti,omap4-hdmi", }, 845 { .compatible = "ti,omap4-hdmi", },
864 {}, 846 {},
@@ -869,7 +851,6 @@ struct platform_driver omapdss_hdmi4hw_driver = {
869 .remove = hdmi4_remove, 851 .remove = hdmi4_remove,
870 .driver = { 852 .driver = {
871 .name = "omapdss_hdmi", 853 .name = "omapdss_hdmi",
872 .pm = &hdmi_pm_ops,
873 .of_match_table = hdmi_of_match, 854 .of_match_table = hdmi_of_match,
874 .suppress_bind_attrs = true, 855 .suppress_bind_attrs = true,
875 }, 856 },