Skip to content

Commit 6efdde0

Browse files
digetxthierryreding
authored andcommitted
drm/tegra: hdmi: Add OPP support
The HDMI on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now HDMI driver must use OPP API for driving the controller's clock rate because OPP API takes care of reconfiguring the domain's performance state based on HDMI clock rate. Add OPP support to the HDMI driver. Reviewed-by: Ulf Hansson <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 4ce3048 commit 6efdde0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

drivers/gpu/drm/tegra/hdmi.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
#include <linux/math64.h>
1212
#include <linux/module.h>
1313
#include <linux/of_device.h>
14+
#include <linux/pm_opp.h>
1415
#include <linux/pm_runtime.h>
1516
#include <linux/regulator/consumer.h>
1617
#include <linux/reset.h>
1718

19+
#include <soc/tegra/common.h>
1820
#include <sound/hdmi-codec.h>
1921

2022
#include <drm/drm_atomic_helper.h>
@@ -1237,7 +1239,7 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder)
12371239
h_back_porch = mode->htotal - mode->hsync_end;
12381240
h_front_porch = mode->hsync_start - mode->hdisplay;
12391241

1240-
err = clk_set_rate(hdmi->clk, hdmi->pixel_clock);
1242+
err = dev_pm_opp_set_rate(hdmi->dev, hdmi->pixel_clock);
12411243
if (err < 0) {
12421244
dev_err(hdmi->dev, "failed to set HDMI clock frequency: %d\n",
12431245
err);
@@ -1872,7 +1874,14 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
18721874
}
18731875

18741876
platform_set_drvdata(pdev, hdmi);
1875-
pm_runtime_enable(&pdev->dev);
1877+
1878+
err = devm_pm_runtime_enable(&pdev->dev);
1879+
if (err)
1880+
return err;
1881+
1882+
err = devm_tegra_core_dev_init_opp_table_common(&pdev->dev);
1883+
if (err)
1884+
return err;
18761885

18771886
INIT_LIST_HEAD(&hdmi->client.list);
18781887
hdmi->client.ops = &hdmi_client_ops;
@@ -1893,8 +1902,6 @@ static int tegra_hdmi_remove(struct platform_device *pdev)
18931902
struct tegra_hdmi *hdmi = platform_get_drvdata(pdev);
18941903
int err;
18951904

1896-
pm_runtime_disable(&pdev->dev);
1897-
18981905
err = host1x_client_unregister(&hdmi->client);
18991906
if (err < 0) {
19001907
dev_err(&pdev->dev, "failed to unregister host1x client: %d\n",

0 commit comments

Comments
 (0)