diff options
author | Amit Kucheria <amit.kucheria@linaro.org> | 2019-03-20 16:17:50 +0300 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2019-05-14 16:59:12 +0300 |
commit | c19970548edc35921ed7606951d203d7887e2ea9 (patch) | |
tree | 47baf5692b9e2791cc8f2d934b4b5faa80f1cc5f /drivers/thermal/qcom/tsens.c | |
parent | 582a0c4194a528d435bf0d638605c05c755d41df (diff) | |
download | linux-c19970548edc35921ed7606951d203d7887e2ea9.tar.xz |
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.c | 5 |
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; |