summaryrefslogtreecommitdiff
path: root/drivers/thermal/qcom/tsens.c
diff options
context:
space:
mode:
authorAmit Kucheria <amit.kucheria@linaro.org>2019-03-20 18:47:50 +0530
committerEduardo Valentin <edubezval@gmail.com>2019-05-14 06:59:12 -0700
commitc19970548edc35921ed7606951d203d7887e2ea9 (patch)
tree47baf5692b9e2791cc8f2d934b4b5faa80f1cc5f /drivers/thermal/qcom/tsens.c
parent582a0c4194a528d435bf0d638605c05c755d41df (diff)
drivers: thermal: tsens: Introduce reg_fields to deal with register description
As we add support for newer versions of the TSENS IP, the current approach isn't scaling because registers and bitfields get moved around, requiring platform-specific hacks in the code. By moving to regmap, we can hide the register level differences away from the code. Define a common set of registers and bit-fields that we care about across the various tsens IP versions. Signed-off-by: Amit Kucheria <amit.kucheria@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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 0b5be08d515f..b91a0b88d33c 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -144,9 +144,8 @@ static int tsens_probe(struct platform_device *pdev)
else
priv->sensor[i].hw_id = i;
}
- for (i = 0; i < REG_ARRAY_SIZE; i++) {
- priv->reg_offsets[i] = data->reg_offsets[i];
- }
+ priv->feat = data->feat;
+ priv->fields = data->fields;
if (!priv->ops || !priv->ops->init || !priv->ops->get_temp)
return -EINVAL;