msm: mdss: Organize regulator supplies used by DSI controller
Regulator supplies in the DSI driver are used for two different purposes. One set of regulators is used as a supply for the DSI controller while another set is used to supply voltage to the panel attached to the DSI controller. To support advanced power saving features, it is required to be able to power down just the DSI controller while keeping the panel on. To enable this, organize the supplies into logical power modules. Change-Id: I54f3ccba1c5ad1fe5c66e8700a012d22ab2684d6 Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
This commit is contained in:
parent
c6d38586a7
commit
939991ddb2
5 changed files with 475 additions and 331 deletions
|
@ -32,11 +32,11 @@ Required properties:
|
|||
Optional properties:
|
||||
- label: A string used to describe the controller used.
|
||||
|
||||
- qcom,platform-supply-entry<1..n>: A node that lists the elements of the supply. 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,platform-supply-entry1
|
||||
- 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.
|
||||
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)
|
||||
-- qcom,supply-max-voltage: maximum voltage level (uV)
|
||||
|
@ -46,6 +46,12 @@ 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,panel-supply-entries: A node that lists the elements of the supply used to
|
||||
power the DSI panel. 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.
|
||||
|
@ -91,37 +97,53 @@ Example:
|
|||
qcom,platform-enable-gpio = <&msmgpio 58 1>;
|
||||
qcom,platform-bklight-en-gpio = <&msmgpio 86 0>;
|
||||
qcom,platform-mode-gpio = <&msmgpio 7 0>;
|
||||
qcom,platform-supply-entry1 {
|
||||
qcom,supply-name = "vdd";
|
||||
qcom,supply-min-voltage = <2800000>;
|
||||
qcom,supply-max-voltage = <2800000>;
|
||||
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 = <20>;
|
||||
|
||||
qcom,ctrl-supply-entries {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
qcom,ctrl-supply-entry@0 {
|
||||
reg = <0>;
|
||||
qcom,supply-name = "vdda";
|
||||
qcom,supply-min-voltage = <1200000>;
|
||||
qcom,supply-max-voltage = <1200000>;
|
||||
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,platform-supply-entry2 {
|
||||
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 = <30>;
|
||||
qcom,supply-pre-off-sleep = <0>;
|
||||
qcom,supply-post-off-sleep = <30>;
|
||||
};
|
||||
qcom,platform-supply-entry3 {
|
||||
qcom,supply-name = "vdda";
|
||||
qcom,supply-min-voltage = <1200000>;
|
||||
qcom,supply-max-voltage = <1200000>;
|
||||
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 = <30>;
|
||||
|
||||
qcom,panel-supply-entries {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
qcom,panel-supply-entry@0 {
|
||||
reg = <0>;
|
||||
qcom,supply-name = "vdd";
|
||||
qcom,supply-min-voltage = <2800000>;
|
||||
qcom,supply-max-voltage = <2800000>;
|
||||
qcom,supply-enable-load = <100000>;
|
||||
qcom,supply-disable-load = <100>;
|
||||
qcom,supply-pre-on-sleep = <0>;
|
||||
qcom,supply-post-on-sleep = <0>;
|
||||
qcom,supply-pre-off-sleep = <0>;
|
||||
qcom,supply-post-off-sleep = <0>;
|
||||
};
|
||||
|
||||
qcom,panel-supply-entry@1 {
|
||||
reg = <1>;
|
||||
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 = <0>;
|
||||
qcom,supply-pre-off-sleep = <0>;
|
||||
qcom,supply-post-off-sleep = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1050,7 +1050,7 @@ static int msm_dsi_cal_clk_rate(struct mdss_panel_data *pdata,
|
|||
|
||||
static int msm_dsi_on(struct mdss_panel_data *pdata)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 0, i;
|
||||
u32 clk_rate;
|
||||
struct mdss_panel_info *pinfo;
|
||||
struct mipi_panel_info *mipi;
|
||||
|
@ -1070,13 +1070,15 @@ static int msm_dsi_on(struct mdss_panel_data *pdata)
|
|||
|
||||
mutex_lock(&ctrl_pdata->mutex);
|
||||
|
||||
ret = msm_dss_enable_vreg(
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 1);
|
||||
if (ret) {
|
||||
pr_err("%s: DSI power on failed\n", __func__);
|
||||
mutex_unlock(&ctrl_pdata->mutex);
|
||||
return ret;
|
||||
for (i = 0; !ret && (i < DSI_MAX_PM); i++) {
|
||||
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_vreg;
|
||||
}
|
||||
}
|
||||
|
||||
msm_dsi_ahb_ctrl(1);
|
||||
|
@ -1165,14 +1167,22 @@ static int msm_dsi_on(struct mdss_panel_data *pdata)
|
|||
msm_dsi_set_irq(ctrl_pdata, DSI_INTR_ERROR_MASK);
|
||||
dsi_host_private->clk_count = 1;
|
||||
dsi_host_private->dsi_on = 1;
|
||||
mutex_unlock(&ctrl_pdata->mutex);
|
||||
|
||||
error_vreg:
|
||||
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);
|
||||
}
|
||||
|
||||
mutex_unlock(&ctrl_pdata->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_dsi_off(struct mdss_panel_data *pdata)
|
||||
{
|
||||
int ret = 0;
|
||||
int ret = 0, i;
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
|
||||
|
||||
if (pdata == NULL) {
|
||||
|
@ -1194,11 +1204,13 @@ static int msm_dsi_off(struct mdss_panel_data *pdata)
|
|||
msm_dsi_phy_off(dsi_host_private->dsi_base);
|
||||
msm_dsi_ahb_ctrl(0);
|
||||
|
||||
ret = msm_dss_enable_vreg(
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 0);
|
||||
if (ret) {
|
||||
pr_err("%s: Panel power off failed\n", __func__);
|
||||
for (i = DSI_MAX_PM - 1; i >= 0; i--) {
|
||||
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));
|
||||
}
|
||||
dsi_host_private->clk_count = 0;
|
||||
dsi_host_private->dsi_on = 0;
|
||||
|
@ -1211,7 +1223,7 @@ static int msm_dsi_off(struct mdss_panel_data *pdata)
|
|||
static int msm_dsi_cont_on(struct mdss_panel_data *pdata)
|
||||
{
|
||||
struct mdss_panel_info *pinfo;
|
||||
int ret = 0;
|
||||
int ret = 0, i;
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
|
||||
|
||||
if (pdata == NULL) {
|
||||
|
@ -1228,13 +1240,15 @@ static int msm_dsi_cont_on(struct mdss_panel_data *pdata)
|
|||
|
||||
pinfo = &pdata->panel_info;
|
||||
mutex_lock(&ctrl_pdata->mutex);
|
||||
ret = msm_dss_enable_vreg(
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 1);
|
||||
if (ret) {
|
||||
pr_err("%s: DSI power on failed\n", __func__);
|
||||
mutex_unlock(&ctrl_pdata->mutex);
|
||||
return ret;
|
||||
for (i = 0; !ret && (i < DSI_MAX_PM); i++) {
|
||||
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_vreg;
|
||||
}
|
||||
}
|
||||
pinfo->panel_power_on = 1;
|
||||
ret = mdss_dsi_panel_reset(pdata, 1);
|
||||
|
@ -1250,8 +1264,17 @@ static int msm_dsi_cont_on(struct mdss_panel_data *pdata)
|
|||
msm_dsi_set_irq(ctrl_pdata, DSI_INTR_ERROR_MASK);
|
||||
dsi_host_private->clk_count = 1;
|
||||
dsi_host_private->dsi_on = 1;
|
||||
|
||||
error_vreg:
|
||||
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);
|
||||
}
|
||||
|
||||
mutex_unlock(&ctrl_pdata->mutex);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int msm_dsi_bta_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
|
||||
|
@ -1483,6 +1506,7 @@ static int msm_dsi_probe(struct platform_device *pdev)
|
|||
struct device_node *dsi_pan_node = NULL;
|
||||
bool cmd_cfg_cont_splash = false;
|
||||
struct resource *mdss_dsi_mres;
|
||||
int i;
|
||||
|
||||
pr_debug("%s\n", __func__);
|
||||
|
||||
|
@ -1572,11 +1596,13 @@ static int msm_dsi_probe(struct platform_device *pdev)
|
|||
goto error_pan_node;
|
||||
}
|
||||
|
||||
rc = msm_dsi_io_init(pdev, &(ctrl_pdata->power_data));
|
||||
if (rc) {
|
||||
dev_err(&pdev->dev, "%s: failed to init DSI IO, rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error_io_init;
|
||||
for (i = 0; i < DSI_MAX_PM; i++) {
|
||||
rc = msm_dsi_io_init(pdev, &(ctrl_pdata->power_data[i]));
|
||||
if (rc) {
|
||||
dev_err(&pdev->dev, "%s: failed to init IO for %s\n",
|
||||
__func__, __mdss_dsi_pm_name(i));
|
||||
goto error_io_init;
|
||||
}
|
||||
}
|
||||
|
||||
pr_debug("%s: Dsi Ctrl->0 initialized\n", __func__);
|
||||
|
@ -1611,7 +1637,8 @@ static int msm_dsi_probe(struct platform_device *pdev)
|
|||
pr_debug("%s success\n", __func__);
|
||||
return 0;
|
||||
error_device_register:
|
||||
msm_dsi_io_deinit(pdev, &(ctrl_pdata->power_data));
|
||||
for (i = DSI_MAX_PM - 1; i >= 0; i--)
|
||||
msm_dsi_io_deinit(pdev, &(ctrl_pdata->power_data[i]));
|
||||
error_io_init:
|
||||
dsi_ctrl_config_deinit(pdev, ctrl_pdata);
|
||||
error_pan_node:
|
||||
|
@ -1633,6 +1660,8 @@ error_no_mem:
|
|||
|
||||
static int msm_dsi_remove(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata = platform_get_drvdata(pdev);
|
||||
if (!ctrl_pdata) {
|
||||
pr_err("%s: no driver data\n", __func__);
|
||||
|
@ -1640,7 +1669,8 @@ static int msm_dsi_remove(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
msm_dsi_clear_irq(ctrl_pdata, ctrl_pdata->dsi_irq_mask);
|
||||
msm_dsi_io_deinit(pdev, &(ctrl_pdata->power_data));
|
||||
for (i = DSI_MAX_PM - 1; i >= 0; i--)
|
||||
msm_dsi_io_deinit(pdev, &(ctrl_pdata->power_data[i]));
|
||||
dsi_ctrl_config_deinit(pdev, ctrl_pdata);
|
||||
iounmap(dsi_host_private->dsi_base);
|
||||
dsi_host_private->dsi_base = NULL;
|
||||
|
|
|
@ -180,28 +180,29 @@ static int dsi_parse_gpio(struct platform_device *pdev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void dsi_ctrl_config_deinit(struct platform_device *pdev,
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata)
|
||||
static void mdss_dsi_put_dt_vreg_data(struct device *dev,
|
||||
struct dss_module_power *module_power)
|
||||
{
|
||||
struct dss_module_power *module_power = &(ctrl_pdata->power_data);
|
||||
if (!module_power) {
|
||||
pr_err("%s: invalid input\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (module_power->vreg_config) {
|
||||
devm_kfree(&(pdev->dev), module_power->vreg_config);
|
||||
devm_kfree(dev, module_power->vreg_config);
|
||||
module_power->vreg_config = NULL;
|
||||
}
|
||||
module_power->num_vreg = 0;
|
||||
}
|
||||
|
||||
static int dsi_parse_vreg(struct device *dev, struct dss_module_power *mp)
|
||||
static int mdss_dsi_get_dt_vreg_data(struct device *dev,
|
||||
struct dss_module_power *mp, enum dsi_pm_type module)
|
||||
{
|
||||
int i = 0, rc = 0;
|
||||
u32 tmp = 0;
|
||||
struct device_node *supply_node = NULL;
|
||||
struct device_node *np = NULL;
|
||||
struct device_node *of_node = NULL, *supply_node = NULL;
|
||||
const char *pm_supply_name = NULL;
|
||||
struct device_node *supply_root_node = NULL;
|
||||
|
||||
if (!dev || !mp) {
|
||||
pr_err("%s: invalid input\n", __func__);
|
||||
|
@ -209,16 +210,22 @@ static int dsi_parse_vreg(struct device *dev, struct dss_module_power *mp)
|
|||
return rc;
|
||||
}
|
||||
|
||||
np = dev->of_node;
|
||||
of_node = dev->of_node;
|
||||
|
||||
mp->num_vreg = 0;
|
||||
for_each_child_of_node(np, supply_node) {
|
||||
if (!strncmp(supply_node->name, "qcom,platform-supply-entry",
|
||||
strlen("qcom,platform-supply-entry")))
|
||||
++mp->num_vreg;
|
||||
pm_supply_name = __mdss_dsi_pm_supply_node_name(module);
|
||||
supply_root_node = of_get_child_by_name(of_node, pm_supply_name);
|
||||
if (!supply_root_node) {
|
||||
pr_err("no supply entry present\n");
|
||||
goto novreg;
|
||||
}
|
||||
|
||||
for_each_child_of_node(supply_root_node, supply_node) {
|
||||
mp->num_vreg++;
|
||||
}
|
||||
|
||||
if (mp->num_vreg == 0) {
|
||||
pr_err("%s: no vreg\n", __func__);
|
||||
pr_debug("%s: no vreg\n", __func__);
|
||||
goto novreg;
|
||||
} else {
|
||||
pr_debug("%s: vreg found. count=%d\n", __func__, mp->num_vreg);
|
||||
|
@ -232,111 +239,116 @@ static int dsi_parse_vreg(struct device *dev, struct dss_module_power *mp)
|
|||
goto error;
|
||||
}
|
||||
|
||||
for_each_child_of_node(np, supply_node) {
|
||||
if (!strncmp(supply_node->name, "qcom,platform-supply-entry",
|
||||
strlen("qcom,platform-supply-entry"))) {
|
||||
const char *st = NULL;
|
||||
/* vreg-name */
|
||||
rc = of_property_read_string(supply_node,
|
||||
"qcom,supply-name", &st);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading name. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
strlcpy(mp->vreg_config[i].vreg_name, st,
|
||||
sizeof(mp->vreg_config[i].vreg_name));
|
||||
/* vreg-min-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-min-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading min volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].min_voltage = tmp;
|
||||
|
||||
/* vreg-max-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-max-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading max volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].max_voltage = tmp;
|
||||
|
||||
/* enable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-enable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading enable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].enable_load = tmp;
|
||||
|
||||
/* disable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-disable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading disable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].disable_load = tmp;
|
||||
|
||||
/* pre-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].pre_on_sleep = (!rc ? tmp : 0);
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].pre_off_sleep = (!rc ? tmp : 0);
|
||||
|
||||
/* post-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].post_on_sleep = (!rc ? tmp : 0);
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].post_off_sleep = (!rc ? tmp : 0);
|
||||
|
||||
pr_debug("%s: %s min=%d, max=%d, enable=%d, disable=%d, preonsleep=%d, postonsleep=%d, preoffsleep=%d, postoffsleep=%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].enable_load,
|
||||
mp->vreg_config[i].disable_load,
|
||||
mp->vreg_config[i].pre_on_sleep,
|
||||
mp->vreg_config[i].post_on_sleep,
|
||||
mp->vreg_config[i].pre_off_sleep,
|
||||
mp->vreg_config[i].post_off_sleep
|
||||
);
|
||||
++i;
|
||||
for_each_child_of_node(supply_root_node, supply_node) {
|
||||
const char *st = NULL;
|
||||
/* vreg-name */
|
||||
rc = of_property_read_string(supply_node,
|
||||
"qcom,supply-name", &st);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading name. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
snprintf(mp->vreg_config[i].vreg_name,
|
||||
ARRAY_SIZE((mp->vreg_config[i].vreg_name)), "%s", st);
|
||||
/* vreg-min-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-min-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading min volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].min_voltage = tmp;
|
||||
|
||||
/* vreg-max-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-max-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading max volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].max_voltage = tmp;
|
||||
|
||||
/* enable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-enable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading enable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].enable_load = tmp;
|
||||
|
||||
/* disable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-disable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading disable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].disable_load = tmp;
|
||||
|
||||
/* pre-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].pre_on_sleep = tmp;
|
||||
}
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].pre_off_sleep = tmp;
|
||||
}
|
||||
|
||||
/* post-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].post_on_sleep = tmp;
|
||||
}
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].post_off_sleep = tmp;
|
||||
}
|
||||
|
||||
pr_debug("%s: %s min=%d, max=%d, enable=%d, disable=%d, preonsleep=%d, postonsleep=%d, preoffsleep=%d, postoffsleep=%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].enable_load,
|
||||
mp->vreg_config[i].disable_load,
|
||||
mp->vreg_config[i].pre_on_sleep,
|
||||
mp->vreg_config[i].post_on_sleep,
|
||||
mp->vreg_config[i].pre_off_sleep,
|
||||
mp->vreg_config[i].post_off_sleep
|
||||
);
|
||||
++i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return rc;
|
||||
|
||||
error:
|
||||
if (mp->vreg_config) {
|
||||
|
@ -397,16 +409,30 @@ static int dsi_parse_phy(struct platform_device *pdev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void dsi_ctrl_config_deinit(struct platform_device *pdev,
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = DSI_MAX_PM - 1; i >= 0; i--) {
|
||||
mdss_dsi_put_dt_vreg_data(&pdev->dev,
|
||||
&ctrl_pdata->power_data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int dsi_ctrl_config_init(struct platform_device *pdev,
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata)
|
||||
{
|
||||
int rc;
|
||||
int rc = 0, i;
|
||||
|
||||
rc = dsi_parse_vreg(&pdev->dev, &ctrl_pdata->power_data);
|
||||
if (rc) {
|
||||
pr_err("%s:%d unable to get the regulator resources",
|
||||
__func__, __LINE__);
|
||||
return rc;
|
||||
for (i = 0; i < DSI_MAX_PM; i++) {
|
||||
rc = mdss_dsi_get_dt_vreg_data(&pdev->dev,
|
||||
&ctrl_pdata->power_data[i], i);
|
||||
if (rc) {
|
||||
DEV_ERR("%s: '%s' get_dt_vreg_data failed.rc=%d\n",
|
||||
__func__, __mdss_dsi_pm_name(i), rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
rc = dsi_parse_gpio(pdev, ctrl_pdata);
|
||||
|
|
|
@ -32,7 +32,10 @@ static int mdss_dsi_pinctrl_set_state(struct mdss_dsi_ctrl_pdata *ctrl_pdata,
|
|||
|
||||
static int mdss_dsi_regulator_init(struct platform_device *pdev)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
|
||||
int i = 0;
|
||||
|
||||
if (!pdev) {
|
||||
pr_err("%s: invalid input\n", __func__);
|
||||
|
@ -45,15 +48,23 @@ static int mdss_dsi_regulator_init(struct platform_device *pdev)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
return msm_dss_config_vreg(&pdev->dev,
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 1);
|
||||
for (i = 0; !rc && (i < DSI_MAX_PM); i++) {
|
||||
rc = msm_dss_config_vreg(&pdev->dev,
|
||||
ctrl_pdata->power_data[i].vreg_config,
|
||||
ctrl_pdata->power_data[i].num_vreg, 1);
|
||||
if (rc)
|
||||
pr_err("%s: failed to init vregs for %s\n",
|
||||
__func__, __mdss_dsi_pm_name(i));
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata, int enable)
|
||||
{
|
||||
int ret;
|
||||
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__);
|
||||
|
@ -66,13 +77,15 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata, int enable)
|
|||
pr_debug("%s: enable=%d\n", __func__, enable);
|
||||
|
||||
if (enable) {
|
||||
ret = msm_dss_enable_vreg(
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 1);
|
||||
if (ret) {
|
||||
pr_err("%s:Failed to enable vregs.rc=%d\n",
|
||||
__func__, ret);
|
||||
goto error;
|
||||
for (i = 0; i < DSI_MAX_PM; i++) {
|
||||
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_enable;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pdata->panel_info.mipi.lp11_init) {
|
||||
|
@ -83,11 +96,7 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata, int enable)
|
|||
if (ret) {
|
||||
pr_err("%s: Panel reset failed. rc=%d\n",
|
||||
__func__, ret);
|
||||
if (msm_dss_enable_vreg(
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 0))
|
||||
pr_err("Disable vregs failed\n");
|
||||
goto error;
|
||||
goto error_enable;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -100,14 +109,24 @@ static int mdss_dsi_panel_power_on(struct mdss_panel_data *pdata, int enable)
|
|||
if (mdss_dsi_pinctrl_set_state(ctrl_pdata, false))
|
||||
pr_debug("reset disable: pinctrl not enabled\n");
|
||||
|
||||
ret = msm_dss_enable_vreg(
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 0);
|
||||
if (ret) {
|
||||
pr_err("%s: Failed to disable vregs.rc=%d\n",
|
||||
__func__, ret);
|
||||
for (i = DSI_MAX_PM - 1; i >= 0; i--) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
error_enable:
|
||||
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);
|
||||
}
|
||||
|
||||
error:
|
||||
return ret;
|
||||
}
|
||||
|
@ -128,11 +147,13 @@ static void mdss_dsi_put_dt_vreg_data(struct device *dev,
|
|||
}
|
||||
|
||||
static int mdss_dsi_get_dt_vreg_data(struct device *dev,
|
||||
struct dss_module_power *mp)
|
||||
struct dss_module_power *mp, enum dsi_pm_type module)
|
||||
{
|
||||
int i = 0, rc = 0;
|
||||
u32 tmp = 0;
|
||||
struct device_node *of_node = NULL, *supply_node = NULL;
|
||||
const char *pm_supply_name = NULL;
|
||||
struct device_node *supply_root_node = NULL;
|
||||
|
||||
if (!dev || !mp) {
|
||||
pr_err("%s: invalid input\n", __func__);
|
||||
|
@ -143,11 +164,17 @@ static int mdss_dsi_get_dt_vreg_data(struct device *dev,
|
|||
of_node = dev->of_node;
|
||||
|
||||
mp->num_vreg = 0;
|
||||
for_each_child_of_node(of_node, supply_node) {
|
||||
if (!strncmp(supply_node->name, "qcom,platform-supply-entry",
|
||||
26))
|
||||
++mp->num_vreg;
|
||||
pm_supply_name = __mdss_dsi_pm_supply_node_name(module);
|
||||
supply_root_node = of_get_child_by_name(of_node, pm_supply_name);
|
||||
if (!supply_root_node) {
|
||||
pr_err("no supply entry present\n");
|
||||
goto novreg;
|
||||
}
|
||||
|
||||
for_each_child_of_node(supply_root_node, supply_node) {
|
||||
mp->num_vreg++;
|
||||
}
|
||||
|
||||
if (mp->num_vreg == 0) {
|
||||
pr_debug("%s: no vreg\n", __func__);
|
||||
goto novreg;
|
||||
|
@ -163,109 +190,113 @@ static int mdss_dsi_get_dt_vreg_data(struct device *dev,
|
|||
goto error;
|
||||
}
|
||||
|
||||
for_each_child_of_node(of_node, supply_node) {
|
||||
if (!strncmp(supply_node->name, "qcom,platform-supply-entry",
|
||||
26)) {
|
||||
const char *st = NULL;
|
||||
/* vreg-name */
|
||||
rc = of_property_read_string(supply_node,
|
||||
"qcom,supply-name", &st);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading name. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
snprintf(mp->vreg_config[i].vreg_name,
|
||||
ARRAY_SIZE((mp->vreg_config[i].vreg_name)),
|
||||
"%s", st);
|
||||
/* vreg-min-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-min-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading min volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].min_voltage = tmp;
|
||||
|
||||
/* vreg-max-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-max-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading max volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].max_voltage = tmp;
|
||||
|
||||
/* enable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-enable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading enable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].enable_load = tmp;
|
||||
|
||||
/* disable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-disable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading disable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].disable_load = tmp;
|
||||
|
||||
/* pre-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].pre_on_sleep = (!rc ? tmp : 0);
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].pre_off_sleep = (!rc ? tmp : 0);
|
||||
|
||||
/* post-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].post_on_sleep = (!rc ? tmp : 0);
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
mp->vreg_config[i].post_off_sleep = (!rc ? tmp : 0);
|
||||
|
||||
pr_debug("%s: %s min=%d, max=%d, enable=%d, disable=%d, preonsleep=%d, postonsleep=%d, preoffsleep=%d, postoffsleep=%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].enable_load,
|
||||
mp->vreg_config[i].disable_load,
|
||||
mp->vreg_config[i].pre_on_sleep,
|
||||
mp->vreg_config[i].post_on_sleep,
|
||||
mp->vreg_config[i].pre_off_sleep,
|
||||
mp->vreg_config[i].post_off_sleep
|
||||
);
|
||||
++i;
|
||||
for_each_child_of_node(supply_root_node, supply_node) {
|
||||
const char *st = NULL;
|
||||
/* vreg-name */
|
||||
rc = of_property_read_string(supply_node,
|
||||
"qcom,supply-name", &st);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading name. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
snprintf(mp->vreg_config[i].vreg_name,
|
||||
ARRAY_SIZE((mp->vreg_config[i].vreg_name)), "%s", st);
|
||||
/* vreg-min-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-min-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading min volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].min_voltage = tmp;
|
||||
|
||||
/* vreg-max-voltage */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-max-voltage", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading max volt. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].max_voltage = tmp;
|
||||
|
||||
/* enable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-enable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading enable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].enable_load = tmp;
|
||||
|
||||
/* disable-load */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-disable-load", &tmp);
|
||||
if (rc) {
|
||||
pr_err("%s: error reading disable load. rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error;
|
||||
}
|
||||
mp->vreg_config[i].disable_load = tmp;
|
||||
|
||||
/* pre-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].pre_on_sleep = tmp;
|
||||
}
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-pre-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply pre sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].pre_off_sleep = tmp;
|
||||
}
|
||||
|
||||
/* post-sleep */
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-on-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].post_on_sleep = tmp;
|
||||
}
|
||||
|
||||
rc = of_property_read_u32(supply_node,
|
||||
"qcom,supply-post-off-sleep", &tmp);
|
||||
if (rc) {
|
||||
pr_debug("%s: error reading supply post sleep value. rc=%d\n",
|
||||
__func__, rc);
|
||||
rc = 0;
|
||||
} else {
|
||||
mp->vreg_config[i].post_off_sleep = tmp;
|
||||
}
|
||||
|
||||
pr_debug("%s: %s min=%d, max=%d, enable=%d, disable=%d, preonsleep=%d, postonsleep=%d, preoffsleep=%d, postoffsleep=%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].enable_load,
|
||||
mp->vreg_config[i].disable_load,
|
||||
mp->vreg_config[i].pre_on_sleep,
|
||||
mp->vreg_config[i].post_on_sleep,
|
||||
mp->vreg_config[i].pre_off_sleep,
|
||||
mp->vreg_config[i].post_off_sleep
|
||||
);
|
||||
++i;
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
@ -1185,7 +1216,7 @@ end:
|
|||
|
||||
static int mdss_dsi_ctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
int rc = 0;
|
||||
int rc = 0, i = 0;
|
||||
u32 index;
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
|
||||
struct device_node *dsi_pan_node = NULL;
|
||||
|
@ -1262,12 +1293,14 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev)
|
|||
pr_warn("%s: failed to get pin resources\n", __func__);
|
||||
|
||||
/* Parse the regulator information */
|
||||
rc = mdss_dsi_get_dt_vreg_data(&pdev->dev,
|
||||
&ctrl_pdata->power_data);
|
||||
if (rc) {
|
||||
pr_err("%s: failed to get vreg data from dt, rc=%d\n",
|
||||
__func__, rc);
|
||||
goto error_vreg;
|
||||
for (i = 0; i < DSI_MAX_PM; i++) {
|
||||
rc = mdss_dsi_get_dt_vreg_data(&pdev->dev,
|
||||
&ctrl_pdata->power_data[i], i);
|
||||
if (rc) {
|
||||
DEV_ERR("%s: '%s' get_dt_vreg_data failed.rc=%d\n",
|
||||
__func__, __mdss_dsi_pm_name(i), rc);
|
||||
goto error_vreg;
|
||||
}
|
||||
}
|
||||
|
||||
/* DSI panels can be different between controllers */
|
||||
|
@ -1304,7 +1337,9 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev)
|
|||
error_pan_node:
|
||||
of_node_put(dsi_pan_node);
|
||||
error_vreg:
|
||||
mdss_dsi_put_dt_vreg_data(&pdev->dev, &ctrl_pdata->power_data);
|
||||
for (; i >= 0; i--)
|
||||
mdss_dsi_put_dt_vreg_data(&pdev->dev,
|
||||
&ctrl_pdata->power_data[i]);
|
||||
error_no_mem:
|
||||
devm_kfree(&pdev->dev, ctrl_pdata);
|
||||
|
||||
|
@ -1315,17 +1350,23 @@ static int mdss_dsi_ctrl_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct msm_fb_data_type *mfd;
|
||||
struct mdss_dsi_ctrl_pdata *ctrl_pdata = platform_get_drvdata(pdev);
|
||||
int i = 0;
|
||||
|
||||
if (!ctrl_pdata) {
|
||||
pr_err("%s: no driver data\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (msm_dss_config_vreg(&pdev->dev,
|
||||
ctrl_pdata->power_data.vreg_config,
|
||||
ctrl_pdata->power_data.num_vreg, 1) < 0)
|
||||
pr_err("%s: failed to de-init vregs\n", __func__);
|
||||
mdss_dsi_put_dt_vreg_data(&pdev->dev, &ctrl_pdata->power_data);
|
||||
for (i = DSI_MAX_PM - 1; i >= 0; i--) {
|
||||
if (msm_dss_config_vreg(&pdev->dev,
|
||||
ctrl_pdata->power_data[i].vreg_config,
|
||||
ctrl_pdata->power_data[i].num_vreg, 1) < 0)
|
||||
pr_err("%s: failed to de-init vregs for %s\n",
|
||||
__func__, __mdss_dsi_pm_name(i));
|
||||
mdss_dsi_put_dt_vreg_data(&pdev->dev,
|
||||
&ctrl_pdata->power_data[i]);
|
||||
}
|
||||
|
||||
mfd = platform_get_drvdata(pdev);
|
||||
msm_dss_iounmap(&ctrl_pdata->mmss_misc_io);
|
||||
msm_dss_iounmap(&ctrl_pdata->phy_io);
|
||||
|
|
|
@ -97,6 +97,12 @@ enum dsi_lane_map_type {
|
|||
DSI_LANE_MAP_3210,
|
||||
};
|
||||
|
||||
enum dsi_pm_type {
|
||||
DSI_CTRL_PM,
|
||||
DSI_PANEL_PM,
|
||||
DSI_MAX_PM
|
||||
};
|
||||
|
||||
#define CTRL_STATE_UNKNOWN 0x00
|
||||
#define CTRL_STATE_PANEL_INIT BIT(0)
|
||||
#define CTRL_STATE_MDP_ACTIVE BIT(1)
|
||||
|
@ -278,7 +284,7 @@ struct mdss_dsi_ctrl_pdata {
|
|||
struct dsi_drv_cm_data shared_pdata;
|
||||
u32 pclk_rate;
|
||||
u32 byte_clk_rate;
|
||||
struct dss_module_power power_data;
|
||||
struct dss_module_power power_data[DSI_MAX_PM];
|
||||
u32 dsi_irq_mask;
|
||||
struct mdss_hw *dsi_hw;
|
||||
struct mdss_panel_recovery *recovery;
|
||||
|
@ -368,6 +374,25 @@ int mdss_dsi_panel_init(struct device_node *node,
|
|||
struct mdss_dsi_ctrl_pdata *ctrl_pdata,
|
||||
bool cmd_cfg_cont_splash);
|
||||
|
||||
static inline const char *__mdss_dsi_pm_name(enum dsi_pm_type module)
|
||||
{
|
||||
switch (module) {
|
||||
case DSI_CTRL_PM: return "DSI_CTRL_PM";
|
||||
case DSI_PANEL_PM: return "PANEL_PM";
|
||||
default: return "???";
|
||||
}
|
||||
}
|
||||
|
||||
static inline const char *__mdss_dsi_pm_supply_node_name(
|
||||
enum dsi_pm_type module)
|
||||
{
|
||||
switch (module) {
|
||||
case DSI_CTRL_PM: return "qcom,ctrl-supply-entries";
|
||||
case DSI_PANEL_PM: return "qcom,panel-supply-entries";
|
||||
default: return "???";
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool mdss_dsi_broadcast_mode_enabled(void)
|
||||
{
|
||||
return ctrl_list[DSI_CTRL_MASTER]->shared_pdata.broadcast_enable &&
|
||||
|
|
Loading…
Add table
Reference in a new issue