aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt1
-rw-r--r--drivers/gpu/drm/tegra/hdmi.c32
2 files changed, 24 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
index efa8b8451f93..f13a6b8263d3 100644
--- a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
+++ b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
@@ -136,6 +136,7 @@ of the following host1x client modules:
136 - compatible: "nvidia,tegra<chip>-hdmi" 136 - compatible: "nvidia,tegra<chip>-hdmi"
137 - reg: Physical base address and length of the controller's registers. 137 - reg: Physical base address and length of the controller's registers.
138 - interrupts: The interrupt outputs from the controller. 138 - interrupts: The interrupt outputs from the controller.
139 - hdmi-supply: supply for the +5V HDMI connector pin
139 - vdd-supply: regulator for supply voltage 140 - vdd-supply: regulator for supply voltage
140 - pll-supply: regulator for PLL 141 - pll-supply: regulator for PLL
141 - clocks: Must contain an entry for each entry in clock-names. 142 - clocks: Must contain an entry for each entry in clock-names.
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index 6928015d11a4..8b797913470a 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -42,6 +42,7 @@ struct tegra_hdmi {
42 struct device *dev; 42 struct device *dev;
43 bool enabled; 43 bool enabled;
44 44
45 struct regulator *hdmi;
45 struct regulator *vdd; 46 struct regulator *vdd;
46 struct regulator *pll; 47 struct regulator *pll;
47 48
@@ -710,6 +711,12 @@ static int tegra_output_hdmi_enable(struct tegra_output *output)
710 h_back_porch = mode->htotal - mode->hsync_end; 711 h_back_porch = mode->htotal - mode->hsync_end;
711 h_front_porch = mode->hsync_start - mode->hdisplay; 712 h_front_porch = mode->hsync_start - mode->hdisplay;
712 713
714 err = regulator_enable(hdmi->vdd);
715 if (err < 0) {
716 dev_err(hdmi->dev, "failed to enable VDD regulator: %d\n", err);
717 return err;
718 }
719
713 err = regulator_enable(hdmi->pll); 720 err = regulator_enable(hdmi->pll);
714 if (err < 0) { 721 if (err < 0) {
715 dev_err(hdmi->dev, "failed to enable PLL regulator: %d\n", err); 722 dev_err(hdmi->dev, "failed to enable PLL regulator: %d\n", err);
@@ -950,6 +957,7 @@ static int tegra_output_hdmi_disable(struct tegra_output *output)
950 reset_control_assert(hdmi->rst); 957 reset_control_assert(hdmi->rst);
951 clk_disable(hdmi->clk); 958 clk_disable(hdmi->clk);
952 regulator_disable(hdmi->pll); 959 regulator_disable(hdmi->pll);
960 regulator_disable(hdmi->vdd);
953 961
954 hdmi->enabled = false; 962 hdmi->enabled = false;
955 963
@@ -1256,13 +1264,6 @@ static int tegra_hdmi_init(struct host1x_client *client)
1256 struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client); 1264 struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client);
1257 int err; 1265 int err;
1258 1266
1259 err = regulator_enable(hdmi->vdd);
1260 if (err < 0) {
1261 dev_err(client->dev, "failed to enable VDD regulator: %d\n",
1262 err);
1263 return err;
1264 }
1265
1266 hdmi->output.type = TEGRA_OUTPUT_HDMI; 1267 hdmi->output.type = TEGRA_OUTPUT_HDMI;
1267 hdmi->output.dev = client->dev; 1268 hdmi->output.dev = client->dev;
1268 hdmi->output.ops = &hdmi_ops; 1269 hdmi->output.ops = &hdmi_ops;
@@ -1279,6 +1280,13 @@ static int tegra_hdmi_init(struct host1x_client *client)
1279 dev_err(client->dev, "debugfs setup failed: %d\n", err); 1280 dev_err(client->dev, "debugfs setup failed: %d\n", err);
1280 } 1281 }
1281 1282
1283 err = regulator_enable(hdmi->hdmi);
1284 if (err < 0) {
1285 dev_err(client->dev, "failed to enable HDMI regulator: %d\n",
1286 err);
1287 return err;
1288 }
1289
1282 return 0; 1290 return 0;
1283} 1291}
1284 1292
@@ -1287,6 +1295,8 @@ static int tegra_hdmi_exit(struct host1x_client *client)
1287 struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client); 1295 struct tegra_hdmi *hdmi = host1x_client_to_hdmi(client);
1288 int err; 1296 int err;
1289 1297
1298 regulator_disable(hdmi->hdmi);
1299
1290 if (IS_ENABLED(CONFIG_DEBUG_FS)) { 1300 if (IS_ENABLED(CONFIG_DEBUG_FS)) {
1291 err = tegra_hdmi_debugfs_exit(hdmi); 1301 err = tegra_hdmi_debugfs_exit(hdmi);
1292 if (err < 0) 1302 if (err < 0)
@@ -1306,8 +1316,6 @@ static int tegra_hdmi_exit(struct host1x_client *client)
1306 return err; 1316 return err;
1307 } 1317 }
1308 1318
1309 regulator_disable(hdmi->vdd);
1310
1311 return 0; 1319 return 0;
1312} 1320}
1313 1321
@@ -1399,6 +1407,12 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
1399 return err; 1407 return err;
1400 } 1408 }
1401 1409
1410 hdmi->hdmi = devm_regulator_get(&pdev->dev, "hdmi");
1411 if (IS_ERR(hdmi->hdmi)) {
1412 dev_err(&pdev->dev, "failed to get HDMI regulator\n");
1413 return PTR_ERR(hdmi->hdmi);
1414 }
1415
1402 hdmi->vdd = devm_regulator_get(&pdev->dev, "vdd"); 1416 hdmi->vdd = devm_regulator_get(&pdev->dev, "vdd");
1403 if (IS_ERR(hdmi->vdd)) { 1417 if (IS_ERR(hdmi->vdd)) {
1404 dev_err(&pdev->dev, "failed to get VDD regulator\n"); 1418 dev_err(&pdev->dev, "failed to get VDD regulator\n");