Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+18
+1
Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
··· 181 181 See ../reset/reset.txt for details. 182 182 - reset-names: Must include the following entries: 183 183 - dsi 184 + - avdd-dsi-supply: phandle of a supply that powers the DSI controller 184 185 - nvidia,mipi-calibrate: Should contain a phandle and a specifier specifying 185 186 which pads are used by this DSI output and need to be calibrated. See also 186 187 ../mipi/nvidia,tegra114-mipi.txt.
+17
drivers/gpu/drm/tegra/dsi.c
··· 14 14 #include <linux/platform_device.h> 15 15 #include <linux/reset.h> 16 16 17 + #include <linux/regulator/consumer.h> 18 + 17 19 #include <drm/drm_mipi_dsi.h> 18 20 #include <drm/drm_panel.h> 19 21 ··· 50 48 51 49 struct tegra_mipi_device *mipi; 52 50 struct mipi_dsi_host host; 51 + 52 + struct regulator *vdd; 53 53 }; 54 54 55 55 static inline struct tegra_dsi * ··· 825 821 return err; 826 822 } 827 823 824 + dsi->vdd = devm_regulator_get(&pdev->dev, "avdd-dsi-csi"); 825 + if (IS_ERR(dsi->vdd)) { 826 + dev_err(&pdev->dev, "cannot get VDD supply\n"); 827 + return PTR_ERR(dsi->vdd); 828 + } 829 + 830 + err = regulator_enable(dsi->vdd); 831 + if (err < 0) { 832 + dev_err(&pdev->dev, "cannot enable VDD supply\n"); 833 + return err; 834 + } 835 + 828 836 err = tegra_dsi_setup_clocks(dsi); 829 837 if (err < 0) { 830 838 dev_err(&pdev->dev, "cannot setup clocks\n"); ··· 892 876 mipi_dsi_host_unregister(&dsi->host); 893 877 tegra_mipi_free(dsi->mipi); 894 878 879 + regulator_disable(dsi->vdd); 895 880 clk_disable_unprepare(dsi->clk_parent); 896 881 clk_disable_unprepare(dsi->clk_lp); 897 882 clk_disable_unprepare(dsi->clk);