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>
This commit is contained in:
Laurent Pinchart
2018-03-05 00:10:55 +02:00
committed by Tomi Valkeinen
parent a48bc6ac2c
commit 8a36357ae3
6 changed files with 72 additions and 161 deletions

View File

@@ -1137,26 +1137,6 @@ static void dsi_runtime_put(struct dsi_data *dsi)
WARN_ON(r < 0 && r != -ENOSYS);
}
static int dsi_regulator_init(struct dsi_data *dsi)
{
struct regulator *vdds_dsi;
if (dsi->vdds_dsi_reg != NULL)
return 0;
vdds_dsi = devm_regulator_get(dsi->dev, "vdd");
if (IS_ERR(vdds_dsi)) {
if (PTR_ERR(vdds_dsi) != -EPROBE_DEFER)
DSSERR("can't get DSI VDD regulator\n");
return PTR_ERR(vdds_dsi);
}
dsi->vdds_dsi_reg = vdds_dsi;
return 0;
}
static void _dsi_print_reset_status(struct dsi_data *dsi)
{
u32 l;
@@ -1353,10 +1333,6 @@ static int dsi_pll_enable(struct dss_pll *pll)
DSSDBG("PLL init\n");
r = dsi_regulator_init(dsi);
if (r)
return r;
r = dsi_runtime_get(dsi);
if (r)
return r;
@@ -4908,13 +4884,8 @@ static int dsi_get_clocks(struct dsi_data *dsi)
static int dsi_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
struct dsi_data *dsi = to_dsi_data(dssdev);
int r;
r = dsi_regulator_init(dsi);
if (r)
return r;
r = dss_mgr_connect(dssdev);
if (r)
return r;
@@ -5384,6 +5355,13 @@ static int dsi_probe(struct platform_device *pdev)
return r;
}
dsi->vdds_dsi_reg = devm_regulator_get(dev, "vdd");
if (IS_ERR(dsi->vdds_dsi_reg)) {
if (PTR_ERR(dsi->vdds_dsi_reg) != -EPROBE_DEFER)
DSSERR("can't get DSI VDD regulator\n");
return PTR_ERR(dsi->vdds_dsi_reg);
}
soc = soc_device_match(dsi_soc_devices);
if (soc)
dsi->data = soc->data;