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

Commit 44814513 authored by Santosh Mardi's avatar Santosh Mardi Committed by Gerrit - the friendly Code Review server
Browse files

drivers: soc: qcom: add initial support for memlat scmi client driver



Add initial support for memlat scmi client driver which registers
into scmi framework for memlat vendor protocol extension.

Also registers with memlat interface driver.

Change-Id: I123944213014a2f61c8df0b1ad822cfde5ff03c4
Signed-off-by: default avatarSantosh Mardi <gsantosh@codeaurora.org>
parent 7737ef93
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -720,6 +720,19 @@ config QTI_SYSTEM_PM
config QTI_SYSTEM_PM_RPM
	bool

config QTI_HW_MEMLAT_SCMI_CLIENT
	tristate "Qualcomm Technologies Inc. SCMI client driver for HW MEMLAT"
	depends on QTI_HW_MEMLAT
	default n
	help
	  SCMI client driver registers itself with SCMI framework for memlat
	  vendor protocol, and also registers with the memlat hw interface
	  driver.

	  This driver deliver the memlat vendor protocol handle to interface
	  driver, and interface driver will use this handle to communicate with
	  memlat HW.

if MSM_PM
menuconfig MSM_IDLE_STATS
	bool "Collect idle statistics"
+1 −0
Original line number Diff line number Diff line
@@ -93,3 +93,4 @@ obj-$(CONFIG_MSM_RPM_SMD) += rpm-smd-debug.o
endif
obj-$(CONFIG_QTI_SYS_PM_VX) += sys_pm_vx.o
obj-$(CONFIG_ICNSS2) += icnss2/
obj-$(CONFIG_QTI_HW_MEMLAT_SCMI_CLIENT)	+= memlat_scmi.o
+40 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
 */

#include <linux/scmi_protocol.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/platform_device.h>

extern void rimps_memlat_init(struct scmi_handle *handle);

static int scmi_memlat_probe(struct scmi_device *sdev)
{
	struct scmi_handle *handle = sdev->handle;

	if (!handle || !handle->memlat_ops)
		return -ENODEV;

	rimps_memlat_init(handle);
	return 0;
}

static const struct scmi_device_id scmi_id_table[] = {
	{ SCMI_PROTOCOL_MEMLAT },
};
MODULE_DEVICE_TABLE(scmi, scmi_id_table);

static struct scmi_driver scmi_memlat_drv = {
	.name		= "scmi-memlat-driver",
	.probe		= scmi_memlat_probe,
	.id_table	= scmi_id_table,
};
module_scmi_driver(scmi_memlat_drv);

MODULE_DESCRIPTION("ARM SCMI Memlat driver");
MODULE_LICENSE("GPL v2");