summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadmanabhan Komanduru <pkomandu@codeaurora.org>2015-04-24 21:33:16 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:42:10 -0700
commit089b71fcf93742d2195d7cba2a502722f3e4e8bb (patch)
tree0e0837ecfaa17c3ecaf70a06f81c71267255a1a3
parentb0e9f4abc48b4581996d17a6711ad1b3769dd3f3 (diff)
ARM: dts: msm: add DSI PHY regulators to MDSS DSI node
Currently, we turn off the DSI ctrl/PHY regulators during suspend as part of panel power control API which might cause the regulators to be turned off before the DSI controller and PHY is disabled. Hence, add the DSI PHY regulators to the MDSS DSI node for multiple chipsets and control these regulators as part of DSI clock control API. Change-Id: I134ad45155605db049088efb5d819e142bafdc12 Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org> [cip@codeaurora.org: Removed msm8996-mdss.dtsi from commit] Signed-off-by: Clarence Ip <cip@codeaurora.org>
-rw-r--r--Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt34
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.c54
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.h3
-rw-r--r--drivers/video/fbdev/msm/msm_mdss_io_8974.c89
4 files changed, 101 insertions, 79 deletions
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt
index ea440c97f51e..38a07a8d1d4b 100644
--- a/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-dsi-ctrl.txt
@@ -35,10 +35,12 @@ Optional properties:
- qcom,platform-bist-ctrl: An array of length 6 that specifies the PHY
BIST ctrl settings.
- vcca-supply: Phandle for vcca regulator device node.
-- qcom,ctrl-supply-entries: A node that lists the elements of the supply used by the
- DSI controller and PHY. There can be more than one instance
- of this binding, in which case the entry would be appended
- with the supply entry index.
+- qcom,<type>-supply-entries: A node that lists the elements of the supply used by the
+ a particular "type" of DSI modulee. The module "types"
+ can be "core", "ctrl", and "phy". Within the same type,
+ there can be more than one instance of this binding,
+ in which case the entry would be appended with the
+ supply entry index.
e.g. qcom,ctrl-supply-entry@0
-- qcom,supply-name: name of the supply (vdd/vdda/vddio)
-- qcom,supply-min-voltage: minimum voltage level (uV)
@@ -49,12 +51,6 @@ Optional properties:
-- qcom,supply-post-on-sleep: time to sleep (ms) after turning on
-- qcom,supply-pre-off-sleep: time to sleep (ms) before turning off
-- qcom,supply-post-off-sleep: time to sleep (ms) after turning off
-- qcom,core-supply-entries: A node that lists the elements of the supply used to
- power the DSI core. There can be more than one instance
- of this binding, in which case the entry would be appended
- with the supply entry index. For a detailed description of
- fields in the supply entry, refer to the qcom,ctrl-supply-entries
- binding above.
- qcom,platform-enable-gpio: Specifies the panel lcd/display enable gpio.
- qcom,platform-reset-gpio: Specifies the panel reset gpio.
- qcom,platform-te-gpio: Specifies the gpio used for TE.
@@ -133,6 +129,24 @@ Example:
};
};
+ qcom,phy-supply-entries {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ qcom,phy-supply-entry@0 {
+ reg = <0>;
+ qcom,supply-name = "vddio";
+ qcom,supply-min-voltage = <1800000>;
+ qcom,supply-max-voltage = <1800000>;
+ qcom,supply-enable-load = <100000>;
+ qcom,supply-disable-load = <100>;
+ qcom,supply-pre-on-sleep = <0>;
+ qcom,supply-post-on-sleep = <20>;
+ qcom,supply-pre-off-sleep = <0>;
+ qcom,supply-post-off-sleep = <0>;
+ };
+ };
+
qcom,ctrl-supply-entries {
#address-cells = <1>;
#size-cells = <0>;
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c
index 7779bbf29cf8..b2d7843e5a44 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.c
+++ b/drivers/video/fbdev/msm/mdss_dsi.c
@@ -154,7 +154,6 @@ static int mdss_dsi_panel_power_off(struct mdss_panel_data *pdata)
{
int ret = 0;
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
- int i = 0;
if (pdata == NULL) {
pr_err("%s: Invalid input data\n", __func__);
@@ -183,20 +182,12 @@ static int mdss_dsi_panel_power_off(struct mdss_panel_data *pdata)
udelay(2000);
}
- for (i = DSI_MAX_PM - 1; i >= 0; i--) {
- /*
- * Core power module will be disabled when the
- * clocks are disabled
- */
- if (DSI_CORE_PM == i)
- continue;
- ret = msm_dss_enable_vreg(
- ctrl_pdata->power_data[i].vreg_config,
- ctrl_pdata->power_data[i].num_vreg, 0);
- if (ret)
- pr_err("%s: failed to disable vregs for %s\n",
- __func__, __mdss_dsi_pm_name(i));
- }
+ ret = msm_dss_enable_vreg(
+ ctrl_pdata->power_data[DSI_PANEL_PM].vreg_config,
+ ctrl_pdata->power_data[DSI_PANEL_PM].num_vreg, 0);
+ if (ret)
+ pr_err("%s: failed to disable vregs for %s\n",
+ __func__, __mdss_dsi_pm_name(DSI_PANEL_PM));
end:
return ret;
@@ -206,7 +197,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
{
int ret = 0;
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
- int i = 0;
if (pdata == NULL) {
pr_err("%s: Invalid input data\n", __func__);
@@ -216,22 +206,15 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
panel_data);
- for (i = 0; i < DSI_MAX_PM; i++) {
- /*
- * Core power module will be enabled when the
- * clocks are enabled
- */
- if (DSI_CORE_PM == i)
- continue;
- ret = msm_dss_enable_vreg(
- ctrl_pdata->power_data[i].vreg_config,
- ctrl_pdata->power_data[i].num_vreg, 1);
- if (ret) {
- pr_err("%s: failed to enable vregs for %s\n",
- __func__, __mdss_dsi_pm_name(i));
- goto error;
- }
+ ret = msm_dss_enable_vreg(
+ ctrl_pdata->power_data[DSI_PANEL_PM].vreg_config,
+ ctrl_pdata->power_data[DSI_PANEL_PM].num_vreg, 1);
+ if (ret) {
+ pr_err("%s: failed to enable vregs for %s\n",
+ __func__, __mdss_dsi_pm_name(DSI_PANEL_PM));
+ return ret;
}
+
if (ctrl_pdata->panel_bias_vreg) {
pr_debug("%s: Enable panel bias vreg. ndx = %d\n",
__func__, ctrl_pdata->ndx);
@@ -241,8 +224,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
udelay(2000);
}
- i--;
-
/*
* If continuous splash screen feature is enabled, then we need to
* request all the GPIOs that have already been configured in the
@@ -260,13 +241,6 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata)
__func__, ret);
}
-error:
- if (ret) {
- for (; i >= 0; i--)
- msm_dss_enable_vreg(
- ctrl_pdata->power_data[i].vreg_config,
- ctrl_pdata->power_data[i].num_vreg, 0);
- }
return ret;
}
diff --git a/drivers/video/fbdev/msm/mdss_dsi.h b/drivers/video/fbdev/msm/mdss_dsi.h
index 8bfb5aba2411..21ad2e5c115a 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.h
+++ b/drivers/video/fbdev/msm/mdss_dsi.h
@@ -122,6 +122,7 @@ enum dsi_lane_map_type {
enum dsi_pm_type {
DSI_CORE_PM,
DSI_CTRL_PM,
+ DSI_PHY_PM,
DSI_PANEL_PM,
DSI_MAX_PM
};
@@ -520,6 +521,7 @@ static inline const char *__mdss_dsi_pm_name(enum dsi_pm_type module)
switch (module) {
case DSI_CORE_PM: return "DSI_CORE_PM";
case DSI_CTRL_PM: return "DSI_CTRL_PM";
+ case DSI_PHY_PM: return "DSI_PHY_PM";
case DSI_PANEL_PM: return "PANEL_PM";
default: return "???";
}
@@ -531,6 +533,7 @@ static inline const char *__mdss_dsi_pm_supply_node_name(
switch (module) {
case DSI_CORE_PM: return "qcom,core-supply-entries";
case DSI_CTRL_PM: return "qcom,ctrl-supply-entries";
+ case DSI_PHY_PM: return "qcom,phy-supply-entries";
case DSI_PANEL_PM: return "qcom,panel-supply-entries";
default: return "???";
}
diff --git a/drivers/video/fbdev/msm/msm_mdss_io_8974.c b/drivers/video/fbdev/msm/msm_mdss_io_8974.c
index 267d5d171e97..047f1090926f 100644
--- a/drivers/video/fbdev/msm/msm_mdss_io_8974.c
+++ b/drivers/video/fbdev/msm/msm_mdss_io_8974.c
@@ -1449,6 +1449,7 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
int enable)
{
int rc = 0;
+ int i = 0;
struct mdss_panel_data *pdata = NULL;
if (!ctrl) {
@@ -1464,16 +1465,31 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
if (enable) {
if (!ctrl->core_power) {
- /* enable mdss gdsc */
- pr_debug("%s: Enable MDP FS\n", __func__);
- rc = msm_dss_enable_vreg(
- ctrl->power_data[DSI_CORE_PM].vreg_config,
- ctrl->power_data[DSI_CORE_PM].num_vreg, 1);
- if (rc) {
- pr_err("%s: failed to enable vregs for %s\n",
- __func__,
- __mdss_dsi_pm_name(DSI_CORE_PM));
- goto error;
+ /*
+ * Enable DSI core power
+ * 1.> PANEL_PM are controlled as part of
+ * panel_power_ctrl. Needed not be handled here.
+ * 2.> PHY_PM and CTRL_PM need to be enabled/disabled
+ * only during unblank/blank. Their state should
+ * not be changed during static screen.
+ */
+ pr_debug("%s: Enable DSI core power\n", __func__);
+ for (i = 0; i < DSI_MAX_PM; i++) {
+ if ((DSI_PANEL_PM == i) ||
+ ((DSI_CORE_PM != i) &&
+ (pdata->panel_info.blank_state !=
+ MDSS_PANEL_BLANK_BLANK) &&
+ !pdata->panel_info.cont_splash_enabled))
+ continue;
+ rc = msm_dss_enable_vreg(
+ ctrl->power_data[i].vreg_config,
+ ctrl->power_data[i].num_vreg, 1);
+ if (rc) {
+ pr_err("%s: failed to enable vregs for %s\n",
+ __func__,
+ __mdss_dsi_pm_name(i));
+ goto error;
+ }
}
ctrl->core_power = true;
}
@@ -1559,21 +1575,28 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
*/
mdss_dsi_bus_clk_stop(ctrl);
- /* disable mdss gdsc only if dsi phy was successfully clamped*/
+ /* disable DSI core power if dsi phy was successfully clamped */
if (rc) {
- pr_debug("%s: leaving mdss gdsc on\n", __func__);
+ pr_debug("%s: leaving DSI core power on\n", __func__);
} else {
- pr_debug("%s: Disable MDP FS\n", __func__);
- rc = msm_dss_enable_vreg(
- ctrl->power_data[DSI_CORE_PM].vreg_config,
- ctrl->power_data[DSI_CORE_PM].num_vreg, 0);
- if (rc) {
- pr_warn("%s: failed to disable vregs for %s\n",
- __func__,
- __mdss_dsi_pm_name(DSI_CORE_PM));
- rc = 0;
- } else {
- ctrl->core_power = false;
+ pr_debug("%s: Disable DSI core power\n", __func__);
+ for (i = DSI_MAX_PM - 1; i >= 0; i--) {
+ if ((DSI_PANEL_PM == i) ||
+ ((DSI_CORE_PM != i) &&
+ (pdata->panel_info.blank_state !=
+ MDSS_PANEL_BLANK_BLANK)))
+ continue;
+ rc = msm_dss_enable_vreg(
+ ctrl->power_data[i].vreg_config,
+ ctrl->power_data[i].num_vreg, 0);
+ if (rc) {
+ pr_warn("%s: failed to disable vregs for %s\n",
+ __func__,
+ __mdss_dsi_pm_name(i));
+ rc = 0;
+ } else {
+ ctrl->core_power = false;
+ }
}
}
}
@@ -1582,12 +1605,20 @@ static int mdss_dsi_core_power_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
error_ulps:
mdss_dsi_bus_clk_stop(ctrl);
error_bus_clk_start:
- if (msm_dss_enable_vreg(ctrl->power_data[DSI_CORE_PM].vreg_config,
- ctrl->power_data[DSI_CORE_PM].num_vreg, 0))
- pr_warn("%s: failed to disable vregs for %s\n",
- __func__, __mdss_dsi_pm_name(DSI_CORE_PM));
- else
- ctrl->core_power = false;
+ for (i = DSI_MAX_PM - 1; i >= 0; i--) {
+ if ((DSI_PANEL_PM == i) || ((DSI_CORE_PM != i) &&
+ (pdata->panel_info.blank_state !=
+ MDSS_PANEL_BLANK_BLANK)))
+ continue;
+ rc = msm_dss_enable_vreg(ctrl->power_data[i].vreg_config,
+ ctrl->power_data[i].num_vreg, 0);
+ if (rc) {
+ pr_warn("%s: failed to disable vregs for %s\n",
+ __func__, __mdss_dsi_pm_name(i));
+ } else {
+ ctrl->core_power = false;
+ }
+ }
error:
return rc;
}