diff options
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dsi.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dss.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/hdmi4.c | 37 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/hdmi5.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/venc.c | 7 |
5 files changed, 30 insertions, 74 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 394c129cfb3b..0a485c5b982e 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c | |||
@@ -5409,11 +5409,14 @@ static int dsi_probe(struct platform_device *pdev) | |||
5409 | 5409 | ||
5410 | /* DSI on OMAP3 doesn't have register DSI_GNQ, set number | 5410 | /* DSI on OMAP3 doesn't have register DSI_GNQ, set number |
5411 | * of data to 3 by default */ | 5411 | * of data to 3 by default */ |
5412 | if (dsi->data->quirks & DSI_QUIRK_GNQ) | 5412 | if (dsi->data->quirks & DSI_QUIRK_GNQ) { |
5413 | dsi_runtime_get(dsi); | ||
5413 | /* NB_DATA_LANES */ | 5414 | /* NB_DATA_LANES */ |
5414 | dsi->num_lanes_supported = 1 + REG_GET(dsi, DSI_GNQ, 11, 9); | 5415 | dsi->num_lanes_supported = 1 + REG_GET(dsi, DSI_GNQ, 11, 9); |
5415 | else | 5416 | dsi_runtime_put(dsi); |
5417 | } else { | ||
5416 | dsi->num_lanes_supported = 3; | 5418 | dsi->num_lanes_supported = 3; |
5419 | } | ||
5417 | 5420 | ||
5418 | r = dsi_init_output(dsi); | 5421 | r = dsi_init_output(dsi); |
5419 | if (r) | 5422 | if (r) |
@@ -5426,15 +5429,19 @@ static int dsi_probe(struct platform_device *pdev) | |||
5426 | } | 5429 | } |
5427 | 5430 | ||
5428 | r = of_platform_populate(dev->of_node, NULL, NULL, dev); | 5431 | r = of_platform_populate(dev->of_node, NULL, NULL, dev); |
5429 | if (r) | 5432 | if (r) { |
5430 | DSSERR("Failed to populate DSI child devices: %d\n", r); | 5433 | DSSERR("Failed to populate DSI child devices: %d\n", r); |
5434 | goto err_uninit_output; | ||
5435 | } | ||
5431 | 5436 | ||
5432 | r = component_add(&pdev->dev, &dsi_component_ops); | 5437 | r = component_add(&pdev->dev, &dsi_component_ops); |
5433 | if (r) | 5438 | if (r) |
5434 | goto err_uninit_output; | 5439 | goto err_of_depopulate; |
5435 | 5440 | ||
5436 | return 0; | 5441 | return 0; |
5437 | 5442 | ||
5443 | err_of_depopulate: | ||
5444 | of_platform_depopulate(dev); | ||
5438 | err_uninit_output: | 5445 | err_uninit_output: |
5439 | dsi_uninit_output(dsi); | 5446 | dsi_uninit_output(dsi); |
5440 | err_pm_disable: | 5447 | err_pm_disable: |
@@ -5470,19 +5477,12 @@ static int dsi_runtime_suspend(struct device *dev) | |||
5470 | /* wait for current handler to finish before turning the DSI off */ | 5477 | /* wait for current handler to finish before turning the DSI off */ |
5471 | synchronize_irq(dsi->irq); | 5478 | synchronize_irq(dsi->irq); |
5472 | 5479 | ||
5473 | dispc_runtime_put(dsi->dss->dispc); | ||
5474 | |||
5475 | return 0; | 5480 | return 0; |
5476 | } | 5481 | } |
5477 | 5482 | ||
5478 | static int dsi_runtime_resume(struct device *dev) | 5483 | static int dsi_runtime_resume(struct device *dev) |
5479 | { | 5484 | { |
5480 | struct dsi_data *dsi = dev_get_drvdata(dev); | 5485 | struct dsi_data *dsi = dev_get_drvdata(dev); |
5481 | int r; | ||
5482 | |||
5483 | r = dispc_runtime_get(dsi->dss->dispc); | ||
5484 | if (r) | ||
5485 | return r; | ||
5486 | 5486 | ||
5487 | dsi->is_enabled = true; | 5487 | dsi->is_enabled = true; |
5488 | /* ensure the irq handler sees the is_enabled value */ | 5488 | /* ensure the irq handler sees the is_enabled value */ |
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index 1aaf260aa9b8..7553c7fc1c45 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c | |||
@@ -1484,16 +1484,23 @@ static int dss_probe(struct platform_device *pdev) | |||
1484 | dss); | 1484 | dss); |
1485 | 1485 | ||
1486 | /* Add all the child devices as components. */ | 1486 | /* Add all the child devices as components. */ |
1487 | r = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); | ||
1488 | if (r) | ||
1489 | goto err_uninit_debugfs; | ||
1490 | |||
1487 | omapdss_gather_components(&pdev->dev); | 1491 | omapdss_gather_components(&pdev->dev); |
1488 | 1492 | ||
1489 | device_for_each_child(&pdev->dev, &match, dss_add_child_component); | 1493 | device_for_each_child(&pdev->dev, &match, dss_add_child_component); |
1490 | 1494 | ||
1491 | r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match); | 1495 | r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match); |
1492 | if (r) | 1496 | if (r) |
1493 | goto err_uninit_debugfs; | 1497 | goto err_of_depopulate; |
1494 | 1498 | ||
1495 | return 0; | 1499 | return 0; |
1496 | 1500 | ||
1501 | err_of_depopulate: | ||
1502 | of_platform_depopulate(&pdev->dev); | ||
1503 | |||
1497 | err_uninit_debugfs: | 1504 | err_uninit_debugfs: |
1498 | dss_debugfs_remove_file(dss->debugfs.clk); | 1505 | dss_debugfs_remove_file(dss->debugfs.clk); |
1499 | dss_debugfs_remove_file(dss->debugfs.dss); | 1506 | dss_debugfs_remove_file(dss->debugfs.dss); |
@@ -1522,6 +1529,8 @@ static int dss_remove(struct platform_device *pdev) | |||
1522 | { | 1529 | { |
1523 | struct dss_device *dss = platform_get_drvdata(pdev); | 1530 | struct dss_device *dss = platform_get_drvdata(pdev); |
1524 | 1531 | ||
1532 | of_platform_depopulate(&pdev->dev); | ||
1533 | |||
1525 | component_master_del(&pdev->dev, &dss_component_ops); | 1534 | component_master_del(&pdev->dev, &dss_component_ops); |
1526 | 1535 | ||
1527 | dss_debugfs_remove_file(dss->debugfs.clk); | 1536 | dss_debugfs_remove_file(dss->debugfs.clk); |
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 | ||
657 | err_cec_uninit: | 663 | err_cec_uninit: |
658 | hdmi4_cec_uninit(&hdmi->core); | 664 | hdmi4_cec_uninit(&hdmi->core); |
659 | err_pll_uninit: | 665 | err_pll_uninit: |
660 | hdmi_pll_uninit(&hdmi->pll); | 666 | hdmi_pll_uninit(&hdmi->pll); |
667 | err_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 | ||
836 | static 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 | |||
845 | static 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 | |||
857 | static const struct dev_pm_ops hdmi_pm_ops = { | ||
858 | .runtime_suspend = hdmi_runtime_suspend, | ||
859 | .runtime_resume = hdmi_runtime_resume, | ||
860 | }; | ||
861 | |||
862 | static const struct of_device_id hdmi_of_match[] = { | 844 | static 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 | }, |
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index b0e4a7463f8c..9e8556f67a29 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c | |||
@@ -825,32 +825,6 @@ static int hdmi5_remove(struct platform_device *pdev) | |||
825 | return 0; | 825 | return 0; |
826 | } | 826 | } |
827 | 827 | ||
828 | static int hdmi_runtime_suspend(struct device *dev) | ||
829 | { | ||
830 | struct omap_hdmi *hdmi = dev_get_drvdata(dev); | ||
831 | |||
832 | dispc_runtime_put(hdmi->dss->dispc); | ||
833 | |||
834 | return 0; | ||
835 | } | ||
836 | |||
837 | static int hdmi_runtime_resume(struct device *dev) | ||
838 | { | ||
839 | struct omap_hdmi *hdmi = dev_get_drvdata(dev); | ||
840 | int r; | ||
841 | |||
842 | r = dispc_runtime_get(hdmi->dss->dispc); | ||
843 | if (r < 0) | ||
844 | return r; | ||
845 | |||
846 | return 0; | ||
847 | } | ||
848 | |||
849 | static const struct dev_pm_ops hdmi_pm_ops = { | ||
850 | .runtime_suspend = hdmi_runtime_suspend, | ||
851 | .runtime_resume = hdmi_runtime_resume, | ||
852 | }; | ||
853 | |||
854 | static const struct of_device_id hdmi_of_match[] = { | 828 | static const struct of_device_id hdmi_of_match[] = { |
855 | { .compatible = "ti,omap5-hdmi", }, | 829 | { .compatible = "ti,omap5-hdmi", }, |
856 | { .compatible = "ti,dra7-hdmi", }, | 830 | { .compatible = "ti,dra7-hdmi", }, |
@@ -862,7 +836,6 @@ struct platform_driver omapdss_hdmi5hw_driver = { | |||
862 | .remove = hdmi5_remove, | 836 | .remove = hdmi5_remove, |
863 | .driver = { | 837 | .driver = { |
864 | .name = "omapdss_hdmi5", | 838 | .name = "omapdss_hdmi5", |
865 | .pm = &hdmi_pm_ops, | ||
866 | .of_match_table = hdmi_of_match, | 839 | .of_match_table = hdmi_of_match, |
867 | .suppress_bind_attrs = true, | 840 | .suppress_bind_attrs = true, |
868 | }, | 841 | }, |
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c index ff0b18c8e4ac..b5f52727f8b1 100644 --- a/drivers/gpu/drm/omapdrm/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c | |||
@@ -946,19 +946,12 @@ static int venc_runtime_suspend(struct device *dev) | |||
946 | if (venc->tv_dac_clk) | 946 | if (venc->tv_dac_clk) |
947 | clk_disable_unprepare(venc->tv_dac_clk); | 947 | clk_disable_unprepare(venc->tv_dac_clk); |
948 | 948 | ||
949 | dispc_runtime_put(venc->dss->dispc); | ||
950 | |||
951 | return 0; | 949 | return 0; |
952 | } | 950 | } |
953 | 951 | ||
954 | static int venc_runtime_resume(struct device *dev) | 952 | static int venc_runtime_resume(struct device *dev) |
955 | { | 953 | { |
956 | struct venc_device *venc = dev_get_drvdata(dev); | 954 | struct venc_device *venc = dev_get_drvdata(dev); |
957 | int r; | ||
958 | |||
959 | r = dispc_runtime_get(venc->dss->dispc); | ||
960 | if (r < 0) | ||
961 | return r; | ||
962 | 955 | ||
963 | if (venc->tv_dac_clk) | 956 | if (venc->tv_dac_clk) |
964 | clk_prepare_enable(venc->tv_dac_clk); | 957 | clk_prepare_enable(venc->tv_dac_clk); |