diff options
| -rw-r--r-- | Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt | 7 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 22 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_tx.c | 27 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_io_util.c | 22 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_io_util.h | 3 |
5 files changed, 26 insertions, 55 deletions
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt index 5c426f2c184a..ce4972a3d0e4 100644 --- a/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt +++ b/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt @@ -17,12 +17,6 @@ Optional properties: - label: A string used to describe the controller used. - qcom,supply-names: A list of strings that lists the names of the regulator supplies. -- qcom,supply-type: A list of strings that list the type of supply(ies) - mentioned above. This list maps in the order of - the supply names listed above. - regulator = supply with controlled output - switch = supply without controlled output. i.e. - voltage switch - qcom,supply-min-voltage-level: A list that specifies minimum voltage level of supply(ies) mentioned above. This list maps in the order of the supply names listed above. @@ -44,7 +38,6 @@ Example: vddio-supply = <&pm8226_l8>; vdda-supply = <&pm8226_l4>; qcom,supply-names = "vdd", "vddio", "vdda"; - qcom,supply-type = "regulator", "regulator", "regulator"; qcom,supply-min-voltage-level = <2800000 1800000 1200000>; qcom,supply-max-voltage-level = <2800000 1800000 1200000>; qcom,supply-peak-current = <150000 100000 100000>; diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index fd79453e98f6..75c336b42ab3 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -326,19 +326,6 @@ static int mdss_dsi_get_dt_vreg_data(struct device *dev, snprintf(mp->vreg_config[i].vreg_name, ARRAY_SIZE((mp->vreg_config[i].vreg_name)), "%s", st); - /* vreg-type */ - rc = of_property_read_string_index(of_node, "qcom,supply-type", - i, &st); - if (rc) { - pr_err("%s: error reading vreg type. rc=%d\n", - __func__, rc); - goto error; - } - if (!strncmp(st, "regulator", 9)) - mp->vreg_config[i].type = 0; - else if (!strncmp(st, "switch", 6)) - mp->vreg_config[i].type = 1; - /* vreg-min-voltage */ memset(val_array, 0, sizeof(u32) * dt_vreg_total); rc = of_property_read_u32_array(of_node, @@ -373,14 +360,13 @@ static int mdss_dsi_get_dt_vreg_data(struct device *dev, __func__, rc); goto error; } - mp->vreg_config[i].optimum_voltage = val_array[i]; + mp->vreg_config[i].peak_current = val_array[i]; - pr_debug("%s: %s type=%d, min=%d, max=%d, op=%d\n", - __func__, mp->vreg_config[i].vreg_name, - mp->vreg_config[i].type, + pr_debug("%s: %s min=%d, max=%d, pc=%d\n", __func__, + mp->vreg_config[i].vreg_name, mp->vreg_config[i].min_voltage, mp->vreg_config[i].max_voltage, - mp->vreg_config[i].optimum_voltage); + mp->vreg_config[i].peak_current); } devm_kfree(dev, val_array); diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index f5d36b3827b6..ad9ead8d3d17 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -3021,20 +3021,6 @@ static int hdmi_tx_get_dt_vreg_data(struct device *dev, } snprintf(mp->vreg_config[j].vreg_name, 32, "%s", st); - /* vreg-type */ - memset(prop_name, 0, sizeof(prop_name)); - snprintf(prop_name, 32, "%s-%s", COMPATIBLE_NAME, - "supply-type"); - memset(val_array, 0, sizeof(u32) * dt_vreg_total); - rc = of_property_read_u32_array(of_node, - prop_name, val_array, dt_vreg_total); - if (rc) { - DEV_ERR("%s: error read '%s' vreg type. rc=%d\n", - __func__, hdmi_tx_pm_name(module_type), rc); - goto error; - } - mp->vreg_config[j].type = val_array[i]; - /* vreg-min-voltage */ memset(prop_name, 0, sizeof(prop_name)); snprintf(prop_name, 32, "%s-%s", COMPATIBLE_NAME, @@ -3068,24 +3054,23 @@ static int hdmi_tx_get_dt_vreg_data(struct device *dev, /* vreg-op-mode */ memset(prop_name, 0, sizeof(prop_name)); snprintf(prop_name, 32, "%s-%s", COMPATIBLE_NAME, - "op-mode"); + "peak-current"); memset(val_array, 0, sizeof(u32) * dt_vreg_total); rc = of_property_read_u32_array(of_node, prop_name, val_array, dt_vreg_total); if (rc) { - DEV_ERR("%s: error read '%s' min volt. rc=%d\n", + DEV_ERR("%s: error read '%s' peak current. rc=%d\n", __func__, hdmi_tx_pm_name(module_type), rc); goto error; } - mp->vreg_config[j].optimum_voltage = val_array[i]; + mp->vreg_config[j].peak_current = val_array[i]; - DEV_DBG("%s: %s type=%d, min=%d, max=%d, op=%d\n", - __func__, mp->vreg_config[j].vreg_name, - mp->vreg_config[j].type, + DEV_DBG("%s: %s min=%d, max=%d, pc=%d\n", __func__, + mp->vreg_config[j].vreg_name, mp->vreg_config[j].min_voltage, mp->vreg_config[j].max_voltage, - mp->vreg_config[j].optimum_voltage); + mp->vreg_config[j].peak_current); ndx_mask >>= 1; j++; diff --git a/drivers/video/fbdev/msm/mdss_io_util.c b/drivers/video/fbdev/msm/mdss_io_util.c index 51267050c440..4cd96db2b329 100644 --- a/drivers/video/fbdev/msm/mdss_io_util.c +++ b/drivers/video/fbdev/msm/mdss_io_util.c @@ -132,6 +132,7 @@ int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg, { int i = 0, rc = 0; struct dss_vreg *curr_vreg = NULL; + enum dss_vreg_type type; if (config) { for (i = 0; i < num_vreg; i++) { @@ -146,7 +147,9 @@ int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg, curr_vreg->vreg = NULL; goto vreg_get_fail; } - if (curr_vreg->type == DSS_REG_LDO) { + type = (regulator_count_voltages(curr_vreg->vreg) > 0) + ? DSS_REG_LDO : DSS_REG_VS; + if (type == DSS_REG_LDO) { rc = regulator_set_voltage( curr_vreg->vreg, curr_vreg->min_voltage, @@ -158,10 +161,10 @@ int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg, curr_vreg->vreg_name); goto vreg_set_voltage_fail; } - if (curr_vreg->optimum_voltage >= 0) { + if (curr_vreg->peak_current >= 0) { rc = regulator_set_load( curr_vreg->vreg, - curr_vreg->optimum_voltage); + curr_vreg->peak_current); if (rc < 0) { DEV_ERR( "%pS->%s: %s set opt m fail\n", @@ -177,8 +180,11 @@ int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg, for (i = num_vreg-1; i >= 0; i--) { curr_vreg = &in_vreg[i]; if (curr_vreg->vreg) { - if (curr_vreg->type == DSS_REG_LDO) { - if (curr_vreg->optimum_voltage >= 0) { + type = (regulator_count_voltages( + curr_vreg->vreg) > 0) + ? DSS_REG_LDO : DSS_REG_VS; + if (type == DSS_REG_LDO) { + if (curr_vreg->peak_current >= 0) { regulator_set_load( curr_vreg->vreg, 0); } @@ -193,11 +199,11 @@ int msm_dss_config_vreg(struct device *dev, struct dss_vreg *in_vreg, return 0; vreg_unconfig: -if (curr_vreg->type == DSS_REG_LDO) +if (type == DSS_REG_LDO) regulator_set_load(curr_vreg->vreg, 0); vreg_set_opt_mode_fail: -if (curr_vreg->type == DSS_REG_LDO) +if (type == DSS_REG_LDO) regulator_set_voltage(curr_vreg->vreg, 0, curr_vreg->max_voltage); vreg_set_voltage_fail: @@ -207,6 +213,8 @@ vreg_set_voltage_fail: vreg_get_fail: for (i--; i >= 0; i--) { curr_vreg = &in_vreg[i]; + type = (regulator_count_voltages(curr_vreg->vreg) > 0) + ? DSS_REG_LDO : DSS_REG_VS; goto vreg_unconfig; } return rc; diff --git a/drivers/video/fbdev/msm/mdss_io_util.h b/drivers/video/fbdev/msm/mdss_io_util.h index 0ae62a38b71b..23341d6b3321 100644 --- a/drivers/video/fbdev/msm/mdss_io_util.h +++ b/drivers/video/fbdev/msm/mdss_io_util.h @@ -50,10 +50,9 @@ enum dss_vreg_type { struct dss_vreg { struct regulator *vreg; /* vreg handle */ char vreg_name[32]; - enum dss_vreg_type type; int min_voltage; int max_voltage; - int optimum_voltage; + int peak_current; }; struct dss_gpio { |
