From: Bryan Brattlof <b...@ti.com>

commit d1bd8644407db9b730391bd39315ad9fb0916faf from
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git

commit 156f0e2fda420c4a4a7b244a909df04086039bd6 upstream

'fuse_base' is only needed during the initial probe function to provide
data for a software trimming method for some of TI's devices affected by
the i2128 erratum. The devices not affected will not use this region

Remove fuse_base from the main k3_j72xx_bandgap structure

Signed-off-by: Bryan Brattlof <b...@ti.com>
Link: https://lore.kernel.org/r/20221031232702.10339-4...@ti.com
Signed-off-by: Daniel Lezcano <daniel.lezc...@kernel.org>
Signed-off-by: Keerthy <j-keer...@ti.com>
Signed-off-by: Vignesh Raghavendra <vigne...@ti.com>
Signed-off-by: Xulin Sun <xulin....@windriver.com>
---
 drivers/thermal/k3_j72xx_bandgap.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/thermal/k3_j72xx_bandgap.c 
b/drivers/thermal/k3_j72xx_bandgap.c
index 851bb8fc69ad..ca2747c6c907 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -180,7 +180,6 @@ struct k3_j72xx_bandgap {
        struct device *dev;
        void __iomem *base;
        void __iomem *cfg2_base;
-       void __iomem *fuse_base;
        struct k3_thermal_data *ts_data[K3_VTM_MAX_NUM_TS];
 };
 
@@ -330,7 +329,7 @@ static int k3_j72xx_bandgap_temp_to_adc_code(int temp)
 }
 
 static void get_efuse_values(int id, struct k3_thermal_data *data, int *err,
-                            struct k3_j72xx_bandgap *bgp)
+                            void __iomem *fuse_base)
 {
        int i, tmp, pow;
        int ct_offsets[5][K3_VTM_CORRECTION_TEMP_CNT] = {
@@ -352,16 +351,16 @@ static void get_efuse_values(int id, struct 
k3_thermal_data *data, int *err,
                /* Extract the offset value using bit-mask */
                if (ct_offsets[id][i] == -1 && i == 1) {
                        /* 25C offset Case of Sensor 2 split between 2 regs */
-                       tmp = (readl(bgp->fuse_base + 0x8) & 0xE0000000) >> 
(29);
-                       tmp |= ((readl(bgp->fuse_base + 0xC) & 0x1F) << 3);
+                       tmp = (readl(fuse_base + 0x8) & 0xE0000000) >> (29);
+                       tmp |= ((readl(fuse_base + 0xC) & 0x1F) << 3);
                        pow = tmp & 0x80;
                } else if (ct_offsets[id][i] == -1 && i == 2) {
                        /* 125C Case of Sensor 3 split between 2 regs */
-                       tmp = (readl(bgp->fuse_base + 0x4) & 0xF8000000) >> 
(27);
-                       tmp |= ((readl(bgp->fuse_base + 0x8) & 0xF) << 5);
+                       tmp = (readl(fuse_base + 0x4) & 0xF8000000) >> (27);
+                       tmp |= ((readl(fuse_base + 0x8) & 0xF) << 5);
                        pow = tmp & 0x100;
                } else {
-                       tmp = readl(bgp->fuse_base + ct_offsets[id][i]);
+                       tmp = readl(fuse_base + ct_offsets[id][i]);
                        tmp &= ct_bm[id][i];
                        tmp = tmp >> __ffs(ct_bm[id][i]);
 
@@ -467,6 +466,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device 
*pdev)
        struct thermal_zone_device *ti_thermal;
        int *ref_table;
        struct err_values err_vals;
+       void __iomem *fuse_base;
 
        const s64 golden_factors[] = {
                -490019999999999936,
@@ -498,9 +498,9 @@ static int k3_j72xx_bandgap_probe(struct platform_device 
*pdev)
                return PTR_ERR(bgp->cfg2_base);
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-       bgp->fuse_base = devm_ioremap_resource(dev, res);
-       if (IS_ERR(bgp->fuse_base))
-               return PTR_ERR(bgp->fuse_base);
+       fuse_base = devm_ioremap_resource(dev, res);
+       if (IS_ERR(fuse_base))
+               return PTR_ERR(fuse_base);
 
        driver_data = of_device_get_match_data(dev);
        if (driver_data)
@@ -539,7 +539,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device 
*pdev)
        }
 
        /* Workaround not needed if bit30/bit31 is set even for J721e */
-       if (workaround_needed && (readl(bgp->fuse_base + 0x0) & 0xc0000000) == 
0xc0000000)
+       if (workaround_needed && (readl(fuse_base + 0x0) & 0xc0000000) == 
0xc0000000)
                workaround_needed = false;
 
        dev_dbg(bgp->dev, "Work around %sneeded\n",
@@ -564,7 +564,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device 
*pdev)
                        err_vals.refs[1] = PLUS30CREF;
                        err_vals.refs[2] = PLUS125CREF;
                        err_vals.refs[3] = PLUS150CREF;
-                       get_efuse_values(id, &data[id], err_vals.errs, bgp);
+                       get_efuse_values(id, &data[id], err_vals.errs, 
fuse_base);
                }
 
                if (id == 0 && workaround_needed)
-- 
2.35.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13206): 
https://lists.yoctoproject.org/g/linux-yocto/message/13206
Mute This Topic: https://lists.yoctoproject.org/mt/102074930/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to