diff options
author | Amit Kucheria <amit.kucheria@linaro.org> | 2018-09-12 15:22:52 +0530 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2018-10-22 17:34:33 -0700 |
commit | c130a7602e3bc2c6fd896c1d56478fca47a38c02 (patch) | |
tree | 32acd533a49ed8af9cbcbb9903a917c1a10e6fb2 /drivers/thermal/qcom/tsens.c | |
parent | thermal: tsens: Add the SROT address map (diff) | |
download | wireguard-linux-c130a7602e3bc2c6fd896c1d56478fca47a38c02.tar.xz wireguard-linux-c130a7602e3bc2c6fd896c1d56478fca47a38c02.zip |
thermal: tsens: Pass register offsets as private data
Registers have moved around across TSENS generations. For example, the
CTRL register was at offset 0x0 in the SROT region on msm8916 but is at
offset 0x4 in newer v2 based TSENS HW blocks.
Allow passing offsets of important registers so that we can continue to
use common functions.
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/qcom/tsens.c')
-rw-r--r-- | drivers/thermal/qcom/tsens.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 9a8e8f7b4ae1..f1ec9bbe4717 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -144,6 +144,9 @@ static int tsens_probe(struct platform_device *pdev) else tmdev->sensor[i].hw_id = i; } + for (i = 0; i < REG_ARRAY_SIZE; i++) { + tmdev->reg_offsets[i] = data->reg_offsets[i]; + } if (!tmdev->ops || !tmdev->ops->init || !tmdev->ops->get_temp) return -EINVAL; |