Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9c74911 authored by Lijuan Gao's avatar Lijuan Gao
Browse files

power: reset: Disable sdi if the CONFIG_MSM_DLOAD_MODE is not defined



Set download_mode as 0 if the CONFIG_MSM_DLOAD_MODE is not defined.
So the sdi could be disabled when the driver initially starts.

And fixed build error when the CONFIG_MSM_DLOAD_MODE is not defined.

CRs-fixed: 1034475
Change-Id: I7f9e3b4231f091e69ba55d22b42db6f5964cb5b9
Signed-off-by: default avatarLijuan Gao <lijuang@codeaurora.org>
parent e4aa3259
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -47,7 +47,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 */
@@ -55,12 +55,15 @@ static void __iomem *msm_ps_hold;
static phys_addr_t tcsr_boot_misc_detect;
static void scm_disable_sdi(void);

#ifdef CONFIG_MSM_DLOAD_MODE
/* Runtime could be only changed value once.
* 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;
#else
static const int download_mode;
#endif

#ifdef CONFIG_MSM_DLOAD_MODE
#define EDL_MODE_PROP "qcom,msm-imem-emergency_download_mode"
@@ -71,6 +74,8 @@ static void *dload_mode_addr;
static bool dload_mode_enabled;
static void *emergency_dload_mode_addr;
static bool scm_dload_supported;
static struct kobject dload_kobj;
static void *dload_type_addr;

static int dload_set(const char *val, struct kernel_param *kp);
/* interface for exporting attributes */
@@ -403,6 +408,7 @@ static void do_msm_poweroff(void)
	return;
}

#ifdef CONFIG_MSM_DLOAD_MODE
static ssize_t attr_show(struct kobject *kobj, struct attribute *attr,
				char *buf)
{
@@ -480,6 +486,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)
{