@@ -177,7 +177,6 @@ struct k3_j72xx_bandgap {
177
177
struct device * dev ;
178
178
void __iomem * base ;
179
179
void __iomem * cfg2_base ;
180
- void __iomem * fuse_base ;
181
180
struct k3_thermal_data * ts_data [K3_VTM_MAX_NUM_TS ];
182
181
};
183
182
@@ -276,7 +275,7 @@ static int k3_j72xx_bandgap_temp_to_adc_code(int temp)
276
275
}
277
276
278
277
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 )
280
279
{
281
280
int i , tmp , pow ;
282
281
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,
298
297
/* Extract the offset value using bit-mask */
299
298
if (ct_offsets [id ][i ] == -1 && i == 1 ) {
300
299
/* 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 );
303
302
pow = tmp & 0x80 ;
304
303
} else if (ct_offsets [id ][i ] == -1 && i == 2 ) {
305
304
/* 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 );
308
307
pow = tmp & 0x100 ;
309
308
} else {
310
- tmp = readl (bgp -> fuse_base + ct_offsets [id ][i ]);
309
+ tmp = readl (fuse_base + ct_offsets [id ][i ]);
311
310
tmp &= ct_bm [id ][i ];
312
311
tmp = tmp >> __ffs (ct_bm [id ][i ]);
313
312
@@ -356,6 +355,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
356
355
struct thermal_zone_device * ti_thermal ;
357
356
int * ref_table ;
358
357
struct err_values err_vals ;
358
+ void __iomem * fuse_base ;
359
359
360
360
const s64 golden_factors [] = {
361
361
-490019999999999936 ,
@@ -387,9 +387,9 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
387
387
return PTR_ERR (bgp -> cfg2_base );
388
388
389
389
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 );
393
393
394
394
driver_data = of_device_get_match_data (dev );
395
395
if (driver_data )
@@ -428,7 +428,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
428
428
}
429
429
430
430
/* 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 )
432
432
workaround_needed = false;
433
433
434
434
dev_dbg (bgp -> dev , "Work around %sneeded\n" ,
@@ -452,7 +452,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
452
452
err_vals .refs [1 ] = PLUS30CREF ;
453
453
err_vals .refs [2 ] = PLUS125CREF ;
454
454
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 );
456
456
}
457
457
458
458
if (id == 0 && workaround_needed )
0 commit comments