summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/qcom/tsens-common.c
diff options
context:
space:
mode:
authorAmit Kucheria2019-03-20 14:17:55 +0100
committerEduardo Valentin2019-05-14 15:59:19 +0200
commit1b6e3e517fadcfbbe0f88eb676ebffafc20fd49c (patch)
treec6e43fd07dd6b746922852dbba61e3029808e010 /drivers/thermal/qcom/tsens-common.c
parentdrivers: thermal: tsens: change data type for sensor IDs (diff)
downloadkernel-qcow2-linux-1b6e3e517fadcfbbe0f88eb676ebffafc20fd49c.tar.gz
kernel-qcow2-linux-1b6e3e517fadcfbbe0f88eb676ebffafc20fd49c.tar.xz
kernel-qcow2-linux-1b6e3e517fadcfbbe0f88eb676ebffafc20fd49c.zip
drivers: thermal: tsens: Introduce IP-specific max_sensor count
The IP can support 'm' sensors while the platform can enable 'n' sensors of the 'm' where n <= m. Track maximum sensors supported by the IP so that we can correctly track what subset of the sensors are supported on the platform. Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/qcom/tsens-common.c')
-rw-r--r--drivers/thermal/qcom/tsens-common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
index c76f8cfb25a2..5607c5cc635c 100644
--- a/drivers/thermal/qcom/tsens-common.c
+++ b/drivers/thermal/qcom/tsens-common.c
@@ -198,7 +198,7 @@ int __init init_common(struct tsens_priv *priv)
goto err_put_device;
}
/* now alloc regmap_fields in tm_map */
- for (i = 0, j = LAST_TEMP_0; i < priv->num_sensors; i++, j++) {
+ for (i = 0, j = LAST_TEMP_0; i < priv->feat->max_sensors; i++, j++) {
priv->rf[j] = devm_regmap_field_alloc(dev, priv->tm_map,
priv->fields[j]);
if (IS_ERR(priv->rf[j])) {
@@ -206,7 +206,7 @@ int __init init_common(struct tsens_priv *priv)
goto err_put_device;
}
}
- for (i = 0, j = VALID_0; i < priv->num_sensors; i++, j++) {
+ for (i = 0, j = VALID_0; i < priv->feat->max_sensors; i++, j++) {
priv->rf[j] = devm_regmap_field_alloc(dev, priv->tm_map,
priv->fields[j]);
if (IS_ERR(priv->rf[j])) {