misc: Allow kernel to be compiled with SEC_DEBUG disabled

* Guards of sec_debug.h include removed in those files that call
  functions declared in that header. The header defines empty
  functions when CONFIG_SEC_DEBUG is not defined.
* Expose extern declaration of sec_class in qpnp-power-on.c when
  CONFIG_SEC_DEBUG is not defined.
* Guard debug level sysfs tuneables.

Change-Id: I4e8b1ae7dd1dce0dec5434da64832165b2659aff
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
Kevin F. Haggerty 2018-11-27 22:22:08 -07:00 committed by Francescodario Cuzzocrea
parent 4d38417e8b
commit 8b524d00d5
5 changed files with 11 additions and 12 deletions

View File

@ -36,9 +36,7 @@
#include <asm/tls.h>
#include <asm/system_misc.h>
#ifdef CONFIG_SEC_DEBUG
#include <mach/sec_debug.h>
#endif
#include <trace/events/exception.h>

View File

@ -43,9 +43,8 @@
#include "spm.h"
#include "pm-boot.h"
#include "clock.h"
#ifdef CONFIG_SEC_DEBUG
#include <mach/sec_debug.h>
#endif
#define CREATE_TRACE_POINTS
#include <mach/trace_msm_low_power.h>

View File

@ -32,11 +32,11 @@
#include <mach/msm_iomap.h>
#include <mach/restart.h>
#include <mach/socinfo.h>
#ifdef CONFIG_SEC_DEBUG
#include <mach/sec_debug.h>
#include <linux/notifier.h>
#include <linux/ftrace.h>
#endif
#include <mach/irqs.h>
#include <mach/scm.h>
#include "msm_watchdog.h"
@ -66,9 +66,9 @@
#endif
static int restart_mode;
#ifndef CONFIG_SEC_DEBUG
void *restart_reason;
#endif
#ifdef CONFIG_USER_RESET_DEBUG
#define RESET_CAUSE_LPM_REBOOT 0x95
@ -334,11 +334,11 @@ static void msm_restart_prepare(const char *cmd)
printk(KERN_NOTICE "Going down for restart now\n");
warm_reboot_set = 0;
#ifdef CONFIG_SEC_DEBUG
if (!restart_reason)
restart_reason = ioremap_nocache((unsigned long)(MSM_IMEM_BASE \
+ RESTART_REASON_ADDR), SZ_4K);
#endif
if (cmd != NULL) {
printk(KERN_NOTICE " Reboot cmd=%s\n",cmd);
if (!strncmp(cmd, "bootloader", 10)) {

View File

@ -164,6 +164,7 @@ static DEVICE_ATTR(qsc_control, S_IRUGO | S_IWUSR ,
qsc_control_show, qsc_control_store);
#endif /*QSC_CONTROL*/
#ifdef CONFIG_SEC_DEBUG
static unsigned int convert_debug_level_str(const char *str)
{
if (strncasecmp(str, "0xA0A0", 6) == 0)
@ -222,6 +223,7 @@ static ssize_t debug_level_store(struct device *dev,
static DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR ,
debug_level_show, debug_level_store);
#endif // CONFIG_SEC_DEBUG
#if defined(CONFIG_MACH_APEXQ) || defined(CONFIG_MACH_AEGIS2)
static ssize_t slideCount_show
@ -363,7 +365,9 @@ static struct device_attribute *sec_misc_attrs[] = {
&dev_attr_emmc_checksum_done,
&dev_attr_emmc_checksum_pass,
&dev_attr_rory_control,
#ifdef CONFIG_SEC_DEBUG
&dev_attr_debug_level,
#endif // CONFIG_SEC_DEBUG
#if defined(CONFIG_MACH_APEXQ) || defined(CONFIG_MACH_AEGIS2)
&dev_attr_slideCount,
#endif

View File

@ -24,9 +24,7 @@
#include <linux/nmi.h>
#include <linux/dmi.h>
#include <linux/coresight.h>
#ifdef CONFIG_SEC_DEBUG
#include <mach/sec_debug.h>
#endif
#define PANIC_TIMER_STEP 100
#define PANIC_BLINK_SPD 18