82
82
#define LVTS_GOLDEN_TEMP_DEFAULT 50
83
83
#define LVTS_COEFF_A_MT8195 -250460
84
84
#define LVTS_COEFF_B_MT8195 250460
85
+ #define LVTS_COEFF_A_MT7988 -204650
86
+ #define LVTS_COEFF_B_MT7988 204650
85
87
86
88
#define LVTS_MSR_IMMEDIATE_MODE 0
87
89
#define LVTS_MSR_FILTERED_MODE 1
88
90
89
91
#define LVTS_MSR_READ_TIMEOUT_US 400
90
92
#define LVTS_MSR_READ_WAIT_US (LVTS_MSR_READ_TIMEOUT_US / 2)
91
93
94
+ #define LVTS_HW_SHUTDOWN_MT7988 105000
92
95
#define LVTS_HW_SHUTDOWN_MT8195 105000
93
96
94
97
#define LVTS_MINIMUM_THRESHOLD 20000
@@ -1267,6 +1270,33 @@ static void lvts_remove(struct platform_device *pdev)
1267
1270
lvts_debugfs_exit (lvts_td );
1268
1271
}
1269
1272
1273
+ static const struct lvts_ctrl_data mt7988_lvts_ap_data_ctrl [] = {
1274
+ {
1275
+ .cal_offset = { 0x00 , 0x04 , 0x08 , 0x0c },
1276
+ .lvts_sensor = {
1277
+ { .dt_id = MT7988_CPU_0 },
1278
+ { .dt_id = MT7988_CPU_1 },
1279
+ { .dt_id = MT7988_ETH2P5G_0 },
1280
+ { .dt_id = MT7988_ETH2P5G_1 }
1281
+ },
1282
+ .num_lvts_sensor = 4 ,
1283
+ .offset = 0x0 ,
1284
+ .hw_tshut_temp = LVTS_HW_SHUTDOWN_MT7988 ,
1285
+ },
1286
+ {
1287
+ .cal_offset = { 0x14 , 0x18 , 0x1c , 0x20 },
1288
+ .lvts_sensor = {
1289
+ { .dt_id = MT7988_TOPS_0 },
1290
+ { .dt_id = MT7988_TOPS_1 },
1291
+ { .dt_id = MT7988_ETHWARP_0 },
1292
+ { .dt_id = MT7988_ETHWARP_1 }
1293
+ },
1294
+ .num_lvts_sensor = 4 ,
1295
+ .offset = 0x100 ,
1296
+ .hw_tshut_temp = LVTS_HW_SHUTDOWN_MT7988 ,
1297
+ }
1298
+ };
1299
+
1270
1300
static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl [] = {
1271
1301
{
1272
1302
.cal_offset = { 0x04 , 0x07 },
@@ -1346,6 +1376,13 @@ static const struct lvts_ctrl_data mt8195_lvts_ap_data_ctrl[] = {
1346
1376
}
1347
1377
};
1348
1378
1379
+ static const struct lvts_data mt7988_lvts_ap_data = {
1380
+ .lvts_ctrl = mt7988_lvts_ap_data_ctrl ,
1381
+ .num_lvts_ctrl = ARRAY_SIZE (mt7988_lvts_ap_data_ctrl ),
1382
+ .temp_factor = LVTS_COEFF_A_MT7988 ,
1383
+ .temp_offset = LVTS_COEFF_B_MT7988 ,
1384
+ };
1385
+
1349
1386
static const struct lvts_data mt8195_lvts_mcu_data = {
1350
1387
.lvts_ctrl = mt8195_lvts_mcu_data_ctrl ,
1351
1388
.num_lvts_ctrl = ARRAY_SIZE (mt8195_lvts_mcu_data_ctrl ),
@@ -1361,6 +1398,7 @@ static const struct lvts_data mt8195_lvts_ap_data = {
1361
1398
};
1362
1399
1363
1400
static const struct of_device_id lvts_of_match [] = {
1401
+ { .compatible = "mediatek,mt7988-lvts-ap" , .data = & mt7988_lvts_ap_data },
1364
1402
{ .compatible = "mediatek,mt8195-lvts-mcu" , .data = & mt8195_lvts_mcu_data },
1365
1403
{ .compatible = "mediatek,mt8195-lvts-ap" , .data = & mt8195_lvts_ap_data },
1366
1404
{},
0 commit comments