aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss/dpi.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-05 00:10:55 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 16:13:27 +0300
commit8a36357ae3b2d1b4647d20bc806d524c21132572 (patch)
treef11cdb825a65492ca1f2982c654be5e4958a3926 /drivers/gpu/drm/omapdrm/dss/dpi.c
parentdrm/omap: dss: Remove duplicated parameter to dss_mgr_(dis)connect() (diff)
downloadlinux-dev-8a36357ae3b2d1b4647d20bc806d524c21132572.tar.xz
linux-dev-8a36357ae3b2d1b4647d20bc806d524c21132572.zip
drm/omap: dss: Get regulators at probe time
Regulators for the DPI, DSI, HDMI, SDI and VENC outputs are all looked up when connecting the output omap_dss_device. There's no need to delay regulator handling to that time, get the regulators at probe time. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/dpi.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dpi.c69
1 files changed, 33 insertions, 36 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 533d87e11bf5..35d63c686393 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -551,38 +551,6 @@ static int dpi_verify_pll(struct dss_pll *pll)
return 0;
}
-static const struct soc_device_attribute dpi_soc_devices[] = {
- { .machine = "OMAP3[456]*" },
- { .machine = "[AD]M37*" },
- { /* sentinel */ }
-};
-
-static int dpi_init_regulator(struct dpi_data *dpi)
-{
- struct regulator *vdds_dsi;
-
- /*
- * The DPI uses the DSI VDDS on OMAP34xx, OMAP35xx, OMAP36xx, AM37xx and
- * DM37xx only.
- */
- if (!soc_device_match(dpi_soc_devices))
- return 0;
-
- if (dpi->vdds_dsi_reg)
- return 0;
-
- vdds_dsi = devm_regulator_get(&dpi->pdev->dev, "vdds_dsi");
- if (IS_ERR(vdds_dsi)) {
- if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
- DSSERR("can't get VDDS_DSI regulator\n");
- return PTR_ERR(vdds_dsi);
- }
-
- dpi->vdds_dsi_reg = vdds_dsi;
-
- return 0;
-}
-
static void dpi_init_pll(struct dpi_data *dpi)
{
struct dss_pll *pll;
@@ -646,10 +614,6 @@ static int dpi_connect(struct omap_dss_device *dssdev,
struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
int r;
- r = dpi_init_regulator(dpi);
- if (r)
- return r;
-
dpi_init_pll(dpi);
r = dss_mgr_connect(dssdev);
@@ -737,6 +701,35 @@ static void dpi_uninit_output_port(struct device_node *port)
omapdss_device_unregister(out);
}
+static const struct soc_device_attribute dpi_soc_devices[] = {
+ { .machine = "OMAP3[456]*" },
+ { .machine = "[AD]M37*" },
+ { /* sentinel */ }
+};
+
+static int dpi_init_regulator(struct dpi_data *dpi)
+{
+ struct regulator *vdds_dsi;
+
+ /*
+ * The DPI uses the DSI VDDS on OMAP34xx, OMAP35xx, OMAP36xx, AM37xx and
+ * DM37xx only.
+ */
+ if (!soc_device_match(dpi_soc_devices))
+ return 0;
+
+ vdds_dsi = devm_regulator_get(&dpi->pdev->dev, "vdds_dsi");
+ if (IS_ERR(vdds_dsi)) {
+ if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
+ DSSERR("can't get VDDS_DSI regulator\n");
+ return PTR_ERR(vdds_dsi);
+ }
+
+ dpi->vdds_dsi_reg = vdds_dsi;
+
+ return 0;
+}
+
int dpi_init_port(struct dss_device *dss, struct platform_device *pdev,
struct device_node *port, enum dss_model dss_model)
{
@@ -769,6 +762,10 @@ int dpi_init_port(struct dss_device *dss, struct platform_device *pdev,
mutex_init(&dpi->lock);
+ r = dpi_init_regulator(dpi);
+ if (r)
+ return r;
+
return dpi_init_output_port(dpi, port);
}