Skip to content

Commit 156f0e2

Browse files
bryanbrattlofDaniel Lezcano
authored andcommitted
thermal/drivers/k3_j72xx_bandgap: Remove fuse_base from structure
'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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent 311f328 commit 156f0e2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/thermal/k3_j72xx_bandgap.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ struct k3_j72xx_bandgap {
177177
struct device *dev;
178178
void __iomem *base;
179179
void __iomem *cfg2_base;
180-
void __iomem *fuse_base;
181180
struct k3_thermal_data *ts_data[K3_VTM_MAX_NUM_TS];
182181
};
183182

@@ -276,7 +275,7 @@ static int k3_j72xx_bandgap_temp_to_adc_code(int temp)
276275
}
277276

278277
static void get_efuse_values(int id, struct k3_thermal_data *data, int *err,
279-
struct k3_j72xx_bandgap *bgp)
278+
void __iomem *fuse_base)
280279
{
281280
int i, tmp, pow;
282281
int ct_offsets[5][K3_VTM_CORRECTION_TEMP_CNT] = {
@@ -298,16 +297,16 @@ static void get_efuse_values(int id, struct k3_thermal_data *data, int *err,
298297
/* Extract the offset value using bit-mask */
299298
if (ct_offsets[id][i] == -1 && i == 1) {
300299
/* 25C offset Case of Sensor 2 split between 2 regs */
301-
tmp = (readl(bgp->fuse_base + 0x8) & 0xE0000000) >> (29);
302-
tmp |= ((readl(bgp->fuse_base + 0xC) & 0x1F) << 3);
300+
tmp = (readl(fuse_base + 0x8) & 0xE0000000) >> (29);
301+
tmp |= ((readl(fuse_base + 0xC) & 0x1F) << 3);
303302
pow = tmp & 0x80;
304303
} else if (ct_offsets[id][i] == -1 && i == 2) {
305304
/* 125C Case of Sensor 3 split between 2 regs */
306-
tmp = (readl(bgp->fuse_base + 0x4) & 0xF8000000) >> (27);
307-
tmp |= ((readl(bgp->fuse_base + 0x8) & 0xF) << 5);
305+
tmp = (readl(fuse_base + 0x4) & 0xF8000000) >> (27);
306+
tmp |= ((readl(fuse_base + 0x8) & 0xF) << 5);
308307
pow = tmp & 0x100;
309308
} else {
310-
tmp = readl(bgp->fuse_base + ct_offsets[id][i]);
309+
tmp = readl(fuse_base + ct_offsets[id][i]);
311310
tmp &= ct_bm[id][i];
312311
tmp = tmp >> __ffs(ct_bm[id][i]);
313312

@@ -356,6 +355,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
356355
struct thermal_zone_device *ti_thermal;
357356
int *ref_table;
358357
struct err_values err_vals;
358+
void __iomem *fuse_base;
359359

360360
const s64 golden_factors[] = {
361361
-490019999999999936,
@@ -387,9 +387,9 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
387387
return PTR_ERR(bgp->cfg2_base);
388388

389389
res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
390-
bgp->fuse_base = devm_ioremap_resource(dev, res);
391-
if (IS_ERR(bgp->fuse_base))
392-
return PTR_ERR(bgp->fuse_base);
390+
fuse_base = devm_ioremap_resource(dev, res);
391+
if (IS_ERR(fuse_base))
392+
return PTR_ERR(fuse_base);
393393

394394
driver_data = of_device_get_match_data(dev);
395395
if (driver_data)
@@ -428,7 +428,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
428428
}
429429

430430
/* Workaround not needed if bit30/bit31 is set even for J721e */
431-
if (workaround_needed && (readl(bgp->fuse_base + 0x0) & 0xc0000000) == 0xc0000000)
431+
if (workaround_needed && (readl(fuse_base + 0x0) & 0xc0000000) == 0xc0000000)
432432
workaround_needed = false;
433433

434434
dev_dbg(bgp->dev, "Work around %sneeded\n",
@@ -452,7 +452,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
452452
err_vals.refs[1] = PLUS30CREF;
453453
err_vals.refs[2] = PLUS125CREF;
454454
err_vals.refs[3] = PLUS150CREF;
455-
get_efuse_values(id, &data[id], err_vals.errs, bgp);
455+
get_efuse_values(id, &data[id], err_vals.errs, fuse_base);
456456
}
457457

458458
if (id == 0 && workaround_needed)

0 commit comments

Comments
 (0)