diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-03-05 01:10:55 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:27 +0300 |
commit | 8a36357ae3b2d1b4647d20bc806d524c21132572 (patch) | |
tree | f11cdb825a65492ca1f2982c654be5e4958a3926 /drivers/gpu/drm/omapdrm/dss/hdmi5.c | |
parent | a48bc6ac2c6cd85bc079fc859ab14ea844e812cd (diff) | |
download | linux-8a36357ae3b2d1b4647d20bc806d524c21132572.tar.xz |
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/hdmi5.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/hdmi5.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c index 363bc5843e0f..db20a578091b 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c @@ -117,24 +117,6 @@ static irqreturn_t hdmi_irq_handler(int irq, void *data) return IRQ_HANDLED; } -static int hdmi_init_regulator(struct omap_hdmi *hdmi) -{ - struct regulator *reg; - - if (hdmi->vdda_reg != NULL) - return 0; - - reg = devm_regulator_get(&hdmi->pdev->dev, "vdda"); - if (IS_ERR(reg)) { - DSSERR("can't get VDDA regulator\n"); - return PTR_ERR(reg); - } - - hdmi->vdda_reg = reg; - - return 0; -} - static int hdmi_power_on_core(struct omap_hdmi *hdmi) { int r; @@ -454,13 +436,8 @@ static void hdmi_core_disable(struct omap_hdmi *hdmi) static int hdmi_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) { - struct omap_hdmi *hdmi = dssdev_to_hdmi(dssdev); int r; - r = hdmi_init_regulator(hdmi); - if (r) - return r; - r = dss_mgr_connect(dssdev); if (r) return r; @@ -817,6 +794,14 @@ static int hdmi5_probe(struct platform_device *pdev) goto err_free; } + hdmi->vdda_reg = devm_regulator_get(&pdev->dev, "vdda"); + if (IS_ERR(hdmi->vdda_reg)) { + r = PTR_ERR(hdmi->vdda_reg); + if (r != -EPROBE_DEFER) + DSSERR("can't get VDDA regulator\n"); + goto err_free; + } + pm_runtime_enable(&pdev->dev); r = hdmi5_init_output(hdmi); |