summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorLingutla Chandrasekhar <clingutla@codeaurora.org>2017-01-12 10:24:16 +0530
committerLingutla Chandrasekhar <clingutla@codeaurora.org>2017-01-12 15:25:45 +0530
commit4d5af6434692e2f878c0079528ecb0a226b1fa64 (patch)
tree9287d1ec1ee73a3bf4fc979a4db00d7783be9f18 /drivers/power
parent2dc96b1cbbdcf5aef3780696708012d55fec57f2 (diff)
power: reset: fix compilation errors when dload disabled.
If download mode disabled, msm-poweroff driver compilation will throw errors. Fix them by moving download mode support under the flag. Change-Id: I7a3f946d72cb4e500e3e762e4a6a5f2c8b90cb8c Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/reset/msm-poweroff.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/power/reset/msm-poweroff.c b/drivers/power/reset/msm-poweroff.c
index cd02ed5bd46a..38e822de34a7 100644
--- a/drivers/power/reset/msm-poweroff.c
+++ b/drivers/power/reset/msm-poweroff.c
@@ -48,7 +48,7 @@
static int restart_mode;
-static void *restart_reason, *dload_type_addr;
+static void *restart_reason;
static bool scm_pmic_arbiter_disable_supported;
static bool scm_deassert_ps_hold_supported;
/* Download mode master kill-switch */
@@ -60,8 +60,6 @@ static void scm_disable_sdi(void);
* There is no API from TZ to re-enable the registers.
* So the SDI cannot be re-enabled when it already by-passed.
*/
-static int download_mode = 1;
-static struct kobject dload_kobj;
#ifdef CONFIG_QCOM_DLOAD_MODE
#define EDL_MODE_PROP "qcom,msm-imem-emergency_download_mode"
@@ -71,7 +69,9 @@ static struct kobject dload_kobj;
#endif
static int in_panic;
-static void *dload_mode_addr;
+static int download_mode = 1;
+static struct kobject dload_kobj;
+static void *dload_mode_addr, *dload_type_addr;
static bool dload_mode_enabled;
static void *emergency_dload_mode_addr;
#ifdef CONFIG_RANDOMIZE_BASE
@@ -268,9 +268,9 @@ static void halt_spmi_pmic_arbiter(void)
static void msm_restart_prepare(const char *cmd)
{
-#ifdef CONFIG_QCOM_DLOAD_MODE
bool need_warm_reset = false;
+#ifdef CONFIG_QCOM_DLOAD_MODE
/* Write download mode flags if we're panic'ing
* Write download mode flags if restart_mode says so
@@ -409,6 +409,7 @@ static void do_msm_poweroff(void)
return;
}
+#ifdef CONFIG_QCOM_DLOAD_MODE
static ssize_t attr_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
@@ -486,6 +487,7 @@ static struct attribute *reset_attrs[] = {
static struct attribute_group reset_attr_group = {
.attrs = reset_attrs,
};
+#endif
static int msm_restart_probe(struct platform_device *pdev)
{
@@ -599,11 +601,12 @@ skip_sysfs_create:
if (scm_is_call_available(SCM_SVC_PWR, SCM_IO_DEASSERT_PS_HOLD) > 0)
scm_deassert_ps_hold_supported = true;
+#ifdef CONFIG_QCOM_DLOAD_MODE
download_mode = scm_is_secure_device();
set_dload_mode(download_mode);
if (!download_mode)
scm_disable_sdi();
-
+#endif
return 0;
err_restart_reason: