diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-03-05 00:10:55 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:27 +0300 |
commit | 8a36357ae3b2d1b4647d20bc806d524c21132572 (patch) | |
tree | f11cdb825a65492ca1f2982c654be5e4958a3926 /drivers/gpu/drm/omapdrm/dss/hdmi4.c | |
parent | a48bc6ac2c6cd85bc079fc859ab14ea844e812cd (diff) | |
download | linux-8a36357ae3b2d1b4647d20bc806d524c21132572.tar.bz2 |
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/hdmi4.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/hdmi4.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index 5216c5554741..6edb85898a7d 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c @@ -108,26 +108,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)) { - if (PTR_ERR(reg) != -EPROBE_DEFER) - 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; @@ -451,13 +431,8 @@ void hdmi4_core_disable(struct hdmi_core_data *core) 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; @@ -827,6 +802,14 @@ static int hdmi4_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 = hdmi4_init_output(hdmi); |