From ca66dca5eda6bd16b7b27fed2a034f2396df5627 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Fri, 5 Feb 2021 03:01:18 +0300 Subject: thermal: qcom: add support for adc-tm5 PMIC thermal monitor Add support for Thermal Monitoring part of PMIC5. This part is closely coupled with ADC, using it's channels directly. ADC-TM support generating interrupts on ADC value crossing low or high voltage bounds, which is used to support thermal trip points. Signed-off-by: Dmitry Baryshkov Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210205000118.493610-3-dmitry.baryshkov@linaro.org --- include/linux/iio/adc/qcom-vadc-common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux/iio') diff --git a/include/linux/iio/adc/qcom-vadc-common.h b/include/linux/iio/adc/qcom-vadc-common.h index 58216124d89d..33f60f43e1aa 100644 --- a/include/linux/iio/adc/qcom-vadc-common.h +++ b/include/linux/iio/adc/qcom-vadc-common.h @@ -158,6 +158,9 @@ int qcom_adc5_hw_scale(enum vadc_scale_fn_type scaletype, const struct adc5_data *data, u16 adc_code, int *result_mdec); +u16 qcom_adc_tm5_temp_volt_scale(unsigned int prescale_ratio, + u32 full_scale_code_volt, int temp); + int qcom_adc5_prescaling_from_dt(u32 num, u32 den); int qcom_adc5_hw_settle_time_from_dt(u32 value, const unsigned int *hw_settle); -- cgit v1.2.3