@@ -7,6 +7,7 @@
#include <linux/delay.h>
#include <linux/bitops.h>
#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
#include <linux/thermal.h>
#include "tsens.h"
@@ -168,8 +169,12 @@ static int init_8960(struct tsens_priv *priv)
u32 reg_cntl;
priv->tm_map = dev_get_regmap(priv->dev, NULL);
- if (!priv->tm_map)
- return -ENODEV;
+ if (!priv->tm_map) {
+ priv->tm_map = syscon_regmap_lookup_by_phandle(
+ priv->dev->of_node, "regmap");
+ if (IS_ERR(priv->tm_map))
+ return -ENODEV;
+ }
/*
* The status registers for each sensor are discontiguous
Devices based on 8060 tsens driver (ipq8064) use the reg of the gcc driver. Permit to load the regmap from a syscon phandle instead of fail as the reg are already used by another driver. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> --- drivers/thermal/qcom/tsens-8960.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)