diff options
Diffstat (limited to 'drivers/gpu/drm/msm/edp')
-rw-r--r-- | drivers/gpu/drm/msm/edp/edp_connector.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/edp/edp_ctrl.c | 29 |
2 files changed, 16 insertions, 33 deletions
diff --git a/drivers/gpu/drm/msm/edp/edp_connector.c b/drivers/gpu/drm/msm/edp/edp_connector.c index b4d1b4698..72360cd03 100644 --- a/drivers/gpu/drm/msm/edp/edp_connector.c +++ b/drivers/gpu/drm/msm/edp/edp_connector.c @@ -37,7 +37,7 @@ static void edp_connector_destroy(struct drm_connector *connector) struct edp_connector *edp_connector = to_edp_connector(connector); DBG(""); - drm_connector_unregister(connector); + drm_connector_cleanup(connector); kfree(edp_connector); @@ -124,10 +124,8 @@ struct drm_connector *msm_edp_connector_init(struct msm_edp *edp) int ret; edp_connector = kzalloc(sizeof(*edp_connector), GFP_KERNEL); - if (!edp_connector) { - ret = -ENOMEM; - goto fail; - } + if (!edp_connector) + return ERR_PTR(-ENOMEM); edp_connector->edp = edp; @@ -136,7 +134,7 @@ struct drm_connector *msm_edp_connector_init(struct msm_edp *edp) ret = drm_connector_init(edp->dev, connector, &edp_connector_funcs, DRM_MODE_CONNECTOR_eDP); if (ret) - goto fail; + return ERR_PTR(ret); drm_connector_helper_add(connector, &edp_connector_helper_funcs); @@ -147,17 +145,7 @@ struct drm_connector *msm_edp_connector_init(struct msm_edp *edp) connector->interlace_allowed = false; connector->doublescan_allowed = false; - ret = drm_connector_register(connector); - if (ret) - goto fail; - drm_mode_connector_attach_encoder(connector, edp->encoder); return connector; - -fail: - if (connector) - edp_connector_destroy(connector); - - return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c index 81200e9be..149bfe7dd 100644 --- a/drivers/gpu/drm/msm/edp/edp_ctrl.c +++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c @@ -21,8 +21,6 @@ #include "edp.h" #include "edp.xml.h" -#define VDDA_MIN_UV 1800000 /* uV units */ -#define VDDA_MAX_UV 1800000 /* uV units */ #define VDDA_UA_ON_LOAD 100000 /* uA units */ #define VDDA_UA_OFF_LOAD 100 /* uA units */ @@ -67,7 +65,7 @@ struct edp_ctrl { void __iomem *base; /* regulators */ - struct regulator *vdda_vreg; + struct regulator *vdda_vreg; /* 1.8 V */ struct regulator *lvl_vreg; /* clocks */ @@ -302,21 +300,24 @@ static void edp_clk_disable(struct edp_ctrl *ctrl, u32 clk_mask) static int edp_regulator_init(struct edp_ctrl *ctrl) { struct device *dev = &ctrl->pdev->dev; + int ret; DBG(""); ctrl->vdda_vreg = devm_regulator_get(dev, "vdda"); - if (IS_ERR(ctrl->vdda_vreg)) { - pr_err("%s: Could not get vdda reg, ret = %ld\n", __func__, - PTR_ERR(ctrl->vdda_vreg)); + ret = PTR_ERR_OR_ZERO(ctrl->vdda_vreg); + if (ret) { + pr_err("%s: Could not get vdda reg, ret = %d\n", __func__, + ret); ctrl->vdda_vreg = NULL; - return PTR_ERR(ctrl->vdda_vreg); + return ret; } ctrl->lvl_vreg = devm_regulator_get(dev, "lvl-vdd"); - if (IS_ERR(ctrl->lvl_vreg)) { - pr_err("Could not get lvl-vdd reg, %ld", - PTR_ERR(ctrl->lvl_vreg)); + ret = PTR_ERR_OR_ZERO(ctrl->lvl_vreg); + if (ret) { + pr_err("%s: Could not get lvl-vdd reg, ret = %d\n", __func__, + ret); ctrl->lvl_vreg = NULL; - return PTR_ERR(ctrl->lvl_vreg); + return ret; } return 0; @@ -326,12 +327,6 @@ static int edp_regulator_enable(struct edp_ctrl *ctrl) { int ret; - ret = regulator_set_voltage(ctrl->vdda_vreg, VDDA_MIN_UV, VDDA_MAX_UV); - if (ret) { - pr_err("%s:vdda_vreg set_voltage failed, %d\n", __func__, ret); - goto vdda_set_fail; - } - ret = regulator_set_load(ctrl->vdda_vreg, VDDA_UA_ON_LOAD); if (ret < 0) { pr_err("%s: vdda_vreg set regulator mode failed.\n", __func__); |