aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-03-14 09:07:50 -0400
committerThierry Reding <treding@nvidia.com>2014-06-05 17:09:28 -0400
commit3b077afb3a7d84bffbf6598697a17655933671d2 (patch)
tree2ec1c63741014ad84bff96390928ef10ab2da3fe
parentbcfc7acbca8d9f40c4b55c6f0dad1519287f81fa (diff)
drm/tegra: dsi - Implement VDD supply support
The DSI controllers are powered by a (typically 1.2V) regulator. Usually this is always on, so there was no need to support enabling or disabling it thus far. But in order not to consume any power when DSI is inactive, give the driver a chance to enable or disable the supply as needed. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt1
-rw-r--r--drivers/gpu/drm/tegra/dsi.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
index f13a6b8263d3..b48f4ef31d93 100644
--- a/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
+++ b/Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
@@ -181,6 +181,7 @@ of the following host1x client modules:
181 See ../reset/reset.txt for details. 181 See ../reset/reset.txt for details.
182 - reset-names: Must include the following entries: 182 - reset-names: Must include the following entries:
183 - dsi 183 - dsi
184 - avdd-dsi-supply: phandle of a supply that powers the DSI controller
184 - nvidia,mipi-calibrate: Should contain a phandle and a specifier specifying 185 - nvidia,mipi-calibrate: Should contain a phandle and a specifier specifying
185 which pads are used by this DSI output and need to be calibrated. See also 186 which pads are used by this DSI output and need to be calibrated. See also
186 ../mipi/nvidia,tegra114-mipi.txt. 187 ../mipi/nvidia,tegra114-mipi.txt.
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 5e2bd843dbe2..fbb13ce1ed18 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -14,6 +14,8 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/reset.h> 15#include <linux/reset.h>
16 16
17#include <linux/regulator/consumer.h>
18
17#include <drm/drm_mipi_dsi.h> 19#include <drm/drm_mipi_dsi.h>
18#include <drm/drm_panel.h> 20#include <drm/drm_panel.h>
19 21
@@ -48,6 +50,8 @@ struct tegra_dsi {
48 50
49 struct tegra_mipi_device *mipi; 51 struct tegra_mipi_device *mipi;
50 struct mipi_dsi_host host; 52 struct mipi_dsi_host host;
53
54 struct regulator *vdd;
51}; 55};
52 56
53static inline struct tegra_dsi * 57static inline struct tegra_dsi *
@@ -821,6 +825,18 @@ static int tegra_dsi_probe(struct platform_device *pdev)
821 return err; 825 return err;
822 } 826 }
823 827
828 dsi->vdd = devm_regulator_get(&pdev->dev, "avdd-dsi-csi");
829 if (IS_ERR(dsi->vdd)) {
830 dev_err(&pdev->dev, "cannot get VDD supply\n");
831 return PTR_ERR(dsi->vdd);
832 }
833
834 err = regulator_enable(dsi->vdd);
835 if (err < 0) {
836 dev_err(&pdev->dev, "cannot enable VDD supply\n");
837 return err;
838 }
839
824 err = tegra_dsi_setup_clocks(dsi); 840 err = tegra_dsi_setup_clocks(dsi);
825 if (err < 0) { 841 if (err < 0) {
826 dev_err(&pdev->dev, "cannot setup clocks\n"); 842 dev_err(&pdev->dev, "cannot setup clocks\n");
@@ -876,6 +892,7 @@ static int tegra_dsi_remove(struct platform_device *pdev)
876 mipi_dsi_host_unregister(&dsi->host); 892 mipi_dsi_host_unregister(&dsi->host);
877 tegra_mipi_free(dsi->mipi); 893 tegra_mipi_free(dsi->mipi);
878 894
895 regulator_disable(dsi->vdd);
879 clk_disable_unprepare(dsi->clk_parent); 896 clk_disable_unprepare(dsi->clk_parent);
880 clk_disable_unprepare(dsi->clk_lp); 897 clk_disable_unprepare(dsi->clk_lp);
881 clk_disable_unprepare(dsi->clk); 898 clk_disable_unprepare(dsi->clk);