android_kernel_xiaomi_sm8450/include/soc/qcom/dcvs.h
Amir Vajid a138240069 drivers: dcvs: add support for multiple ddr types
Add the ability to support different DDR frequency tables
for different DRAM types in qcom dcvs. This includes adding
an API for clients to retrieve the correct DT child node
that contains a "qcom,ddr-type" property with a DDR type
that matches the current hardware. Use this API in memlat
to support multiple cpufreq-memfreq tables for different
DDR types.

Change-Id: I6ce5cf9b483785ae2dbe1f28cf0979dee3432333
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
2021-07-13 11:28:29 -07:00

80 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/
#ifndef _QCOM_DCVS_H
#define _QCOM_DCVS_H
#include <linux/kernel.h>
#define QCOM_DCVS_WIDTH_PROP "qcom,bus-width"
#define QCOM_DCVS_HW_PROP "qcom,dcvs-hw-type"
#define QCOM_DCVS_PATH_PROP "qcom,dcvs-path-type"
enum dcvs_hw_type {
DCVS_DDR,
DCVS_LLCC,
DCVS_L3,
DCVS_DDRQOS,
NUM_DCVS_HW_TYPES
};
enum dcvs_path_type {
DCVS_SLOW_PATH,
DCVS_FAST_PATH,
DCVS_PERCPU_PATH,
NUM_DCVS_PATHS
};
struct dcvs_freq {
u32 ib;
u32 ab;
enum dcvs_hw_type hw_type;
};
#if IS_ENABLED(CONFIG_QCOM_DCVS)
int qcom_dcvs_register_voter(const char *name, enum dcvs_hw_type hw_type,
enum dcvs_path_type path_type);
int qcom_dcvs_unregister_voter(const char *name, enum dcvs_hw_type hw_type,
enum dcvs_path_type path_type);
int qcom_dcvs_update_votes(const char *name, struct dcvs_freq *votes,
u32 update_mask, enum dcvs_path_type path);
struct kobject *qcom_dcvs_kobject_get(enum dcvs_hw_type type);
int qcom_dcvs_hw_minmax_get(enum dcvs_hw_type hw_type, u32 *min, u32 *max);
struct device_node *qcom_dcvs_get_ddr_child_node(struct device_node *of_parent);
#else
static inline int qcom_dcvs_register_voter(const char *name,
enum dcvs_hw_type hw_type, enum dcvs_path_type path_type)
{
return -ENODEV;
}
static inline int qcom_dcvs_unregister_voter(const char *name,
enum dcvs_hw_type hw_type, enum dcvs_path_type path_type)
{
return -ENODEV;
}
static inline int qcom_dcvs_update_votes(const char *name,
struct dcvs_freq *votes, u32 update_mask,
enum dcvs_path_type path)
{
return -ENODEV;
}
static inline struct kobject *qcom_dcvs_kobject_get(enum dcvs_hw_type type)
{
return NULL;
}
static inline int qcom_dcvs_hw_minmax_get(enum dcvs_hw_type hw_type, u32 *min,
u32 *max)
{
return -ENODEV;
}
static inline struct device_node *qcom_dcvs_get_ddr_child_node(
struct device_node *of_parent)
{
return NULL;
}
#endif
#endif /* _QCOM_DCVS_H */