msm: thermal: Add support to set PMIC software mode

Previously auto mode (or low power mode) is only enabled when CX is
below SVS, and now we would like to enable that when CX is below
Nominal. We can enable automode for VDD_CX when below Nominal
except at certain threshold, where the CX current can exceed the
peak current requirement for automode.

During boot, a polling thread will check temperature for all
temp sensors. As long as one temp sensor is above the threshold,
we disable automode for CX. When all the temp sensors are below
threshold hysteresis, we re-enable automode.

New module parameter were added as below:
sys/module/msm_thermal/pmic_sw_mode/vdd_dig/mode

vdd_dig can be replaced by other rail names

mode:
PMIC_AUTO_MODE = 0
PMIC_PWM_MODE  = 2

Change-Id: I1247ea82e3f5dc0754fb9e31bed89f2d69573e37
Signed-off-by: Jennifer Liu <chihning@codeaurora.org>
3 files changed