diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2021-03-01 00:58:57 +0100 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2021-05-07 07:05:16 +0200 |
commit | d53be2a2e98129ecf32009893ec46b1ce644721a (patch) | |
tree | a501ae76b98989a5c6b16762c185212c081b840b /target/linux/ipq806x/patches-5.10/0063-3-tsens-fix-kernel-5_4.patch | |
parent | 861b82d36ae43efec8d16e61b82482e38996af92 (diff) | |
download | upstream-d53be2a2e98129ecf32009893ec46b1ce644721a.tar.gz upstream-d53be2a2e98129ecf32009893ec46b1ce644721a.tar.bz2 upstream-d53be2a2e98129ecf32009893ec46b1ce644721a.zip |
ipq806x: copy kernel 5.4 patches to 5.10
Copy kernel 5.4 patches and config to 5.10
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x/patches-5.10/0063-3-tsens-fix-kernel-5_4.patch')
-rw-r--r-- | target/linux/ipq806x/patches-5.10/0063-3-tsens-fix-kernel-5_4.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-5.10/0063-3-tsens-fix-kernel-5_4.patch b/target/linux/ipq806x/patches-5.10/0063-3-tsens-fix-kernel-5_4.patch new file mode 100644 index 0000000000..6c056db3b7 --- /dev/null +++ b/target/linux/ipq806x/patches-5.10/0063-3-tsens-fix-kernel-5_4.patch @@ -0,0 +1,68 @@ +--- a/drivers/thermal/qcom/tsens-ipq8064.c ++++ b/drivers/thermal/qcom/tsens-ipq8064.c +@@ -18,6 +18,7 @@ + #include <linux/regmap.h> + #include <linux/thermal.h> + #include <linux/nvmem-consumer.h> ++#include <linux/of_platform.h> + #include <linux/io.h> + #include <linux/interrupt.h> + #include "tsens.h" +@@ -320,15 +321,42 @@ static void hw_init(struct tsens_priv *p + INIT_WORK(&priv->tsens_work, tsens_scheduler_fn); + } + ++static const struct regmap_config tsens_config = { ++ .name = "tm", ++ .reg_bits = 32, ++ .val_bits = 32, ++ .reg_stride = 4, ++}; ++ + static int init_ipq8064(struct tsens_priv *priv) + { +- int ret, i; ++ struct device *dev = priv->dev; + u32 reg_cntl, offset = 0; ++ struct resource *res; ++ resource_size_t size; ++ void __iomem *base; ++ int ret, i; ++ struct platform_device *op = of_find_device_by_node(priv->dev->of_node); ++ ++ if (!op) ++ return -EINVAL; + +- init_common(priv); +- if (!priv->tm_map) +- return -ENODEV; ++ /* old DTs where SROT and TM were in a contiguous 2K block */ ++ priv->tm_offset = 0x1000; + ++ res = platform_get_resource(op, IORESOURCE_MEM, 0); ++ size = resource_size(res); ++ base = devm_ioremap(&op->dev, res->start, size); ++ if (IS_ERR(base)) { ++ ret = PTR_ERR(base); ++ goto err_put_device; ++ } ++ ++ priv->tm_map = devm_regmap_init_mmio(dev, base, &tsens_config); ++ if (IS_ERR(priv->tm_map)) { ++ ret = PTR_ERR(priv->tm_map); ++ goto err_put_device; ++ } + /* + * The status registers for each sensor are discontiguous + * because some SoCs have 5 sensors while others have more +@@ -367,6 +395,10 @@ static int init_ipq8064(struct tsens_pri + return ret; + + return 0; ++ ++err_put_device: ++ put_device(&op->dev); ++ return ret; + } + + static int calibrate_ipq8064(struct tsens_priv *priv) |