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

Commit 4fff60ad authored by Tingwei Zhang's avatar Tingwei Zhang
Browse files

soc: qcom: add support for sysmon drivers



Add support for sysmon drivers on msm-4.9 Kernel.
This driver is needed for msm8953 to communicate
with other subsystem.

Change-Id: I3048b84c28e859369193867fa80dc0159cd7c22c
Signed-off-by: default avatarTingwei Zhang <tingwei@codeaurora.org>
parent 9d4600a1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -549,6 +549,14 @@ config MSM_SUBSYSTEM_RESTART
         It also notifies userspace of transitions between these states via
         sysfs.

config MSM_SYSMON_COMM
	bool "MSM System Monitor communication support"
	depends on MSM_SMD && MSM_SUBSYSTEM_RESTART
	help
	  This option adds support for MSM System Monitor library, which
	  provides an API that may be used for notifying subsystems within
	  the SoC about other subsystems' power-up/down state-changes.

config MSM_PIL
       bool "Peripheral image loading"
       select FW_LOADER
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ ifdef CONFIG_MSM_SUBSYSTEM_RESTART
       obj-y += ramdump.o
       obj-y += microdump_collector.o
endif
obj-$(CONFIG_MSM_SYSMON_COMM) += sysmon.o sysmon-qmi.o
obj-$(CONFIG_MSM_JTAGV8) += jtagv8.o jtagv8-etm.o
obj-$(CONFIG_QCOM_COMMAND_DB) += cmd-db.o
obj-$(CONFIG_MSM_QBT1000) += qbt1000.o
+58 −0
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013,2016,2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __HSIC_SYSMON_H__
#define __HSIC_SYSMON_H__

/**
 * enum hsic_sysmon_device_id - Supported HSIC subsystem devices
 */
enum hsic_sysmon_device_id {
	HSIC_SYSMON_DEV_EXT_MODEM,
	HSIC_SYSMON_DEV_EXT_MODEM_2,
	NUM_HSIC_SYSMON_DEVS
};

#if IS_ENABLED(CONFIG_MSM_HSIC_SYSMON) || \
	IS_ENABLED(CONFIG_MSM_HSIC_SYSMON_MODULE)

extern int hsic_sysmon_open(enum hsic_sysmon_device_id id);
extern void hsic_sysmon_close(enum hsic_sysmon_device_id id);
extern int hsic_sysmon_read(enum hsic_sysmon_device_id id, char *data,
			    size_t len, size_t *actual_len, int timeout);
extern int hsic_sysmon_write(enum hsic_sysmon_device_id id, const char *data,
			     size_t len, int timeout);

#else /* CONFIG_MSM_HSIC_SYSMON || CONFIG_MSM_HSIC_SYSMON_MODULE */

static inline int hsic_sysmon_open(enum hsic_sysmon_device_id id)
{
	return -ENODEV;
}

static inline void hsic_sysmon_close(enum hsic_sysmon_device_id id) { }

static inline int hsic_sysmon_read(enum hsic_sysmon_device_id id, char *data,
				   size_t len, size_t *actual_len, int timeout)
{
	return -ENODEV;
}

static inline int hsic_sysmon_write(enum hsic_sysmon_device_id id,
				    const char *data, size_t len, int timeout)
{
	return -ENODEV;
}

#endif /* CONFIG_MSM_HSIC_SYSMON || CONFIG_MSM_HSIC_SYSMON_MODULE */

#endif /* __HSIC_SYSMON_H__ */
+18 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2016,2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -15,9 +15,26 @@
#ifndef __MSM_SYSMON_H
#define __MSM_SYSMON_H

#include <soc/qcom/smd.h>
#include <soc/qcom/subsystem_notif.h>
#include <soc/qcom/subsystem_restart.h>

/**
 * enum subsys_id - Destination subsystems for events.
 */
enum subsys_id {
	/* SMD subsystems */
	SYSMON_SS_MODEM     = SMD_APPS_MODEM,
	SYSMON_SS_LPASS     = SMD_APPS_QDSP,
	SYSMON_SS_WCNSS     = SMD_APPS_WCNSS,
	SYSMON_SS_DSPS      = SMD_APPS_DSPS,
	SYSMON_SS_Q6FW      = SMD_APPS_Q6FW,

	/* Non-SMD subsystems */
	SYSMON_SS_EXT_MODEM = SMD_NUM_TYPE,
	SYSMON_NUM_SS
};

/**
 * enum ssctl_ssr_event_enum_type - Subsystem notification type.
 */