msm: limits: Add S1 supply current limiting driver for MSM8909

This driver is a current limit management module to help manage
instantaneous peak current drawn by multiple subsystems on shared
supply. The inputs to the mitigation algorithm are current states
of different subsystems sharing this supply like cpu frequency,
gpu frequency, number of cores online, soc temperature, core leakage,
and modem state. It throttles cpu frequency and limits number of
online cores to reduce the dynamic current so as to keep the total
current drawn from supply in safe limits.

Change-Id: I4592b8be48bad3709e8cfb09da53f23279a8ff9b
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
This commit is contained in:
Manaf Meethalavalappu Pallikunhi 2014-10-27 19:36:20 +05:30 committed by Gerrit - the friendly Code Review server
parent c121d8aac6
commit 2b81902ec5
5 changed files with 2264 additions and 1 deletions

View File

@ -0,0 +1,37 @@
PMIC supply(S1) current limiting driver(SUPPLY_LM)
=====================================
This driver is a current limit management module to help manage
instantaneous peak current drawn by multiple subsystems on shared
supply. The inputs to the mitigation algorithm are current states
of different subsystems sharing this supply like cpu frequency,
gpu frequency, number of cores online, soc temperature, core leakage,
and modem state. It throttles cpu frequency and limits number of
online cores to reduce the dynamic current so as to keep the total
current drawn from supply in safe limits.
The device tree parameters for SUPPLY_LM driver are:
Required parameters:
- compatible : Must be "qcom,supply-lm"
- interrupts : SUPPLY_LM modem to apps interrupt details.
- reg : Base addresses of the SUPPLY_LM modem interrupt data and
its size in bytes.
- reg-names : Name of SUPPLY_LM modem register in reg node.
- qcom,supply-lm-very-hot-temp-range : SUPPLY_LM very hot temperature range
info. It expects trigger and clear thresholds in order.
- qcom,supply-lm-hot-temp-range : SUPPLY_LM hot temperature range info.
It expects trigger and clear thresholds in order.
- gpu-dev-opp: Phandle for gpu dev.
Example:
qcom,supply-lm {
compatible = "qcom,supply-lm";
interrupts = <0 133 4>;
reg = <0x01946000 0x8>; /* TCSR_TCSR_S1LM_MODEM_TO_APPS_INT and
* TCSR_TCSR_S1LM_MODEM_TO_APPS_INT_DATA */
reg-names = "intr_reg";
qcom,supply-lm-very-hot-temp-range = <75 72>;
qcom,supply-lm-hot-temp-range = <65 62>;
gpu-dev-opp = <&msm_gpu>;
};

View File

@ -129,6 +129,15 @@ config THERMAL_MONITOR
entity starts running in the userspace. Monitors TSENS temperature
and limits the max frequency of the cores.
config SUPPLY_LM_MONITOR
bool "SUPPLY current monitor driver"
depends on THERMAL && PM_OPP && CPU_FREQ
help
This enables to monitor power states of different HW blocks
including cpu, gpu and modem, number of cores online and SoC
temperature. Based on these inputs, the driver throttles
apps subsystem.
config SPEAR_THERMAL
bool "SPEAr thermal sensor driver"
depends on PLAT_SPEAR

View File

@ -29,3 +29,4 @@ obj-$(CONFIG_THERMAL_QPNP_ADC_TM) += qpnp-adc-tm.o
obj-$(CONFIG_THERMAL_MONITOR) += msm_thermal.o msm_thermal-dev.o
obj-$(CONFIG_LIMITS_MONITOR) += lmh_interface.o
obj-$(CONFIG_LIMITS_LITE_HW) += lmh_lite.o
obj-$(CONFIG_SUPPLY_LM_MONITOR) += supply_lm_core.o

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,74 @@
#include <linux/tracepoint.h>
#ifdef TRACE_MSM_LMH
#ifdef TRACE_SUPPLY_LM
DECLARE_EVENT_CLASS(supply_lm_scm_ctl,
TP_PROTO(unsigned int value),
TP_ARGS(value),
TP_STRUCT__entry(
__field(unsigned int, value)
),
TP_fast_assign(
__entry->value = value;
),
TP_printk("inp=0x%x", __entry->value)
);
DEFINE_EVENT(supply_lm_scm_ctl, supply_lm_pre_scm,
TP_PROTO(unsigned int value),
TP_ARGS(value)
);
DEFINE_EVENT(supply_lm_scm_ctl, supply_lm_post_scm,
TP_PROTO(unsigned int ret),
TP_ARGS(ret)
);
DECLARE_EVENT_CLASS(supply_lm_inp_ctl,
TP_PROTO(unsigned int inp, unsigned int val),
TP_ARGS(inp, val),
TP_STRUCT__entry(
__field(unsigned int, inp)
__field(unsigned int, val)
),
TP_fast_assign(
__entry->inp = inp;
__entry->val = val;
),
TP_printk("inp=%u val=%u",
__entry->inp, __entry->val)
);
DEFINE_EVENT(supply_lm_inp_ctl, supply_lm_inp_start_trig,
TP_PROTO(unsigned int inp, unsigned int val),
TP_ARGS(inp, val)
);
DEFINE_EVENT(supply_lm_inp_ctl, supply_lm_inp_end_trig,
TP_PROTO(unsigned int inp, unsigned int val),
TP_ARGS(inp, val)
);
#elif defined(TRACE_MSM_LMH)
DECLARE_EVENT_CLASS(msm_lmh_print_sensor_reading,
TP_PROTO(const char *sensor_name, unsigned int intensity),