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/sdi.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/sdi.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/sdi.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c index 4b3a24d98065..1fb25e2c5f87 100644 --- a/drivers/gpu/drm/omapdrm/dss/sdi.c +++ b/drivers/gpu/drm/omapdrm/dss/sdi.c @@ -252,35 +252,11 @@ static int sdi_check_timings(struct omap_dss_device *dssdev, return 0; } -static int sdi_init_regulator(struct sdi_device *sdi) -{ - struct regulator *vdds_sdi; - - if (sdi->vdds_sdi_reg) - return 0; - - vdds_sdi = devm_regulator_get(&sdi->pdev->dev, "vdds_sdi"); - if (IS_ERR(vdds_sdi)) { - if (PTR_ERR(vdds_sdi) != -EPROBE_DEFER) - DSSERR("can't get VDDS_SDI regulator\n"); - return PTR_ERR(vdds_sdi); - } - - sdi->vdds_sdi_reg = vdds_sdi; - - return 0; -} - static int sdi_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) { - struct sdi_device *sdi = dssdev_to_sdi(dssdev); int r; - r = sdi_init_regulator(sdi); - if (r) - return r; - r = dss_mgr_connect(dssdev); if (r) return r; @@ -379,6 +355,14 @@ int sdi_init_port(struct dss_device *dss, struct platform_device *pdev, sdi->pdev = pdev; port->data = sdi; + sdi->vdds_sdi_reg = devm_regulator_get(&pdev->dev, "vdds_sdi"); + if (IS_ERR(sdi->vdds_sdi_reg)) { + r = PTR_ERR(sdi->vdds_sdi_reg); + if (r != -EPROBE_DEFER) + DSSERR("can't get VDDS_SDI regulator\n"); + goto err_free; + } + r = sdi_init_output(sdi); if (r) goto err_free; |