OMAPDSS: Improve regulator names for DT
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 2 Jan 2014 10:54:31 +0000 (12:54 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 19 Mar 2014 09:03:06 +0000 (11:03 +0200)
The regulator names used for DSS components are somewhat ugly for DT
use. As we're just adding DT support, it's simple to change the
regulator names.

This patch makes the DSS driver get the regulators with somewhat cleaner
names when bootin with DT. For example, this allows us to define HDMI's
VDDA regulator in the DT data as:

vdda-supply = <...>;

instead of

vdda_hdmi_dac-supply = <...>;

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
drivers/video/omap2/dss/dsi.c
drivers/video/omap2/dss/hdmi4.c
drivers/video/omap2/dss/venc.c

index a820c37e323ed66d90f6cee54259cc4fd53c7fd6..782e8989fcfb7e3241e552a66f67abf6348ce613 100644 (file)
@@ -1151,7 +1151,10 @@ static int dsi_regulator_init(struct platform_device *dsidev)
        if (dsi->vdds_dsi_reg != NULL)
                return 0;
 
-       vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdds_dsi");
+       if (dsi->pdev->dev.of_node)
+               vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdd");
+       else
+               vdds_dsi = devm_regulator_get(&dsi->pdev->dev, "vdds_dsi");
 
        /* DT HACK: try VCXIO to make omapdss work for o4 sdp/panda */
        if (IS_ERR(vdds_dsi))
index 4a74538f9ea5ea87b8a0f49149700662c103c01a..ba6f02518ebef28d71d785e5eeb6b29aba790ac3 100644 (file)
@@ -88,7 +88,10 @@ static int hdmi_init_regulator(void)
        if (hdmi.vdda_hdmi_dac_reg != NULL)
                return 0;
 
-       reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac");
+       if (hdmi.pdev->dev.of_node)
+               reg = devm_regulator_get(&hdmi.pdev->dev, "vdda");
+       else
+               reg = devm_regulator_get(&hdmi.pdev->dev, "vdda_hdmi_dac");
 
        /* DT HACK: try VDAC to make omapdss work for o4 sdp/panda */
        if (IS_ERR(reg))
index 2cd7f7e42105a727b5213bde9950e32fcb7ca7b7..7d40e52ad6d1506598a5d59fa9a045653d7694de 100644 (file)
@@ -636,7 +636,10 @@ static int venc_init_regulator(void)
        if (venc.vdda_dac_reg != NULL)
                return 0;
 
-       vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac");
+       if (venc.pdev->dev.of_node)
+               vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda");
+       else
+               vdda_dac = devm_regulator_get(&venc.pdev->dev, "vdda_dac");
 
        if (IS_ERR(vdda_dac)) {
                if (PTR_ERR(vdda_dac) != -EPROBE_DEFER)