diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-03-04 23:10:55 +0100 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 15:13:27 +0200 |
commit | 8a36357ae3b2d1b4647d20bc806d524c21132572 (patch) | |
tree | f11cdb825a65492ca1f2982c654be5e4958a3926 /drivers/gpu/drm/omapdrm/dss/venc.c | |
parent | drm/omap: dss: Remove duplicated parameter to dss_mgr_(dis)connect() (diff) | |
download | linux-8a36357ae3b2d1b4647d20bc806d524c21132572.tar.xz linux-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/venc.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/venc.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c index 24a2b9a41864..7aa06b796481 100644 --- a/drivers/gpu/drm/omapdrm/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c @@ -614,25 +614,6 @@ static int venc_check_timings(struct omap_dss_device *dssdev, } } -static int venc_init_regulator(struct venc_device *venc) -{ - struct regulator *vdda_dac; - - if (venc->vdda_dac_reg != NULL) - return 0; - - vdda_dac = devm_regulator_get(&venc->pdev->dev, "vdda"); - if (IS_ERR(vdda_dac)) { - if (PTR_ERR(vdda_dac) != -EPROBE_DEFER) - DSSERR("can't get VDDA_DAC regulator\n"); - return PTR_ERR(vdda_dac); - } - - venc->vdda_dac_reg = vdda_dac; - - return 0; -} - static int venc_dump_regs(struct seq_file *s, void *p) { struct venc_device *venc = s->private; @@ -713,13 +694,8 @@ static int venc_get_clocks(struct venc_device *venc) static int venc_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) { - struct venc_device *venc = dssdev_to_venc(dssdev); int r; - r = venc_init_regulator(venc); - if (r) - return r; - r = dss_mgr_connect(dssdev); if (r) return r; @@ -908,6 +884,14 @@ static int venc_probe(struct platform_device *pdev) goto err_free; } + venc->vdda_dac_reg = devm_regulator_get(&pdev->dev, "vdda"); + if (IS_ERR(venc->vdda_dac_reg)) { + r = PTR_ERR(venc->vdda_dac_reg); + if (r != -EPROBE_DEFER) + DSSERR("can't get VDDA_DAC regulator\n"); + goto err_free; + } + r = venc_get_clocks(venc); if (r) goto err_free; |