Symbol: lvts_ctrl
drivers/thermal/mediatek/lvts_thermal.c
1002
static void lvts_ctrl_monitor_enable(struct device *dev, struct lvts_ctrl *lvts_ctrl, bool enable)
drivers/thermal/mediatek/lvts_thermal.c
1012
if (lvts_ctrl->mode == LVTS_MSR_IMMEDIATE_MODE)
drivers/thermal/mediatek/lvts_thermal.c
1016
lvts_for_each_valid_sensor(i, lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
1025
writel(sensor_map | BIT(9), LVTS_MONCTL0(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1034
static void lvts_write_config(struct lvts_ctrl *lvts_ctrl, const u32 *cmds, int nr_cmds)
drivers/thermal/mediatek/lvts_thermal.c
1042
writel(cmds[i], LVTS_CONFIG(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1047
static int lvts_irq_init(struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
1082
writel(0, LVTS_MONINT(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1101
static int lvts_ctrl_set_enable(struct lvts_ctrl *lvts_ctrl, int enable)
drivers/thermal/mediatek/lvts_thermal.c
1110
writel(enable, LVTS_CLKEN(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1115
static int lvts_ctrl_connect(struct device *dev, struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
1117
const struct lvts_data *lvts_data = lvts_ctrl->lvts_data;
drivers/thermal/mediatek/lvts_thermal.c
1120
lvts_write_config(lvts_ctrl, lvts_data->conn_cmd, lvts_data->num_conn_cmd);
drivers/thermal/mediatek/lvts_thermal.c
1130
id = readl(LVTS_ID(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1137
static int lvts_ctrl_initialize(struct device *dev, struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
1139
const struct lvts_data *lvts_data = lvts_ctrl->lvts_data;
drivers/thermal/mediatek/lvts_thermal.c
1141
lvts_write_config(lvts_ctrl, lvts_data->init_cmd, lvts_data->num_init_cmd);
drivers/thermal/mediatek/lvts_thermal.c
1146
static int lvts_ctrl_calibrate(struct device *dev, struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
1150
LVTS_EDATA00(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
1151
LVTS_EDATA01(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
1152
LVTS_EDATA02(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
1153
LVTS_EDATA03(lvts_ctrl->base)
drivers/thermal/mediatek/lvts_thermal.c
1164
writel(lvts_ctrl->calibration[i], lvts_edata[i]);
drivers/thermal/mediatek/lvts_thermal.c
1173
if (lvts_ctrl->lvts_data->msr_offset)
drivers/thermal/mediatek/lvts_thermal.c
1174
writel(lvts_ctrl->lvts_data->msr_offset,
drivers/thermal/mediatek/lvts_thermal.c
1175
LVTS_MSROFT(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1180
static int lvts_ctrl_configure(struct device *dev, struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
1195
writel(value, LVTS_TSSEL(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1224
writel(value, LVTS_MSRCTL0(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1267
writel(value, LVTS_MONCTL1(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1280
writel(value, LVTS_MONCTL2(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1282
return lvts_irq_init(lvts_ctrl);
drivers/thermal/mediatek/lvts_thermal.c
1285
static int lvts_ctrl_start(struct device *dev, struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
1287
struct lvts_sensor *lvts_sensors = lvts_ctrl->sensors;
drivers/thermal/mediatek/lvts_thermal.c
1298
u32 *sensor_bitmap = lvts_ctrl->mode == LVTS_MSR_IMMEDIATE_MODE ?
drivers/thermal/mediatek/lvts_thermal.c
1301
lvts_for_each_valid_sensor(i, lvts_ctrl) {
drivers/thermal/mediatek/lvts_thermal.c
1346
if (lvts_ctrl->mode == LVTS_MSR_IMMEDIATE_MODE) {
drivers/thermal/mediatek/lvts_thermal.c
1360
writel(sensor_map, LVTS_MSRCTL1(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1367
writel(sensor_map | BIT(9), LVTS_MONCTL0(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
1376
struct lvts_ctrl *lvts_ctrl;
drivers/thermal/mediatek/lvts_thermal.c
138
#define lvts_for_each_valid_sensor(i, lvts_ctrl) \
drivers/thermal/mediatek/lvts_thermal.c
1391
lvts_ctrl = &lvts_td->lvts_ctrl[i];
drivers/thermal/mediatek/lvts_thermal.c
140
if (!((lvts_ctrl)->valid_sensor_mask & BIT(i))) \
drivers/thermal/mediatek/lvts_thermal.c
1405
ret = lvts_ctrl_set_enable(lvts_ctrl, true);
drivers/thermal/mediatek/lvts_thermal.c
1411
ret = lvts_ctrl_connect(dev, lvts_ctrl);
drivers/thermal/mediatek/lvts_thermal.c
1417
ret = lvts_ctrl_initialize(dev, lvts_ctrl);
drivers/thermal/mediatek/lvts_thermal.c
1423
ret = lvts_ctrl_calibrate(dev, lvts_ctrl);
drivers/thermal/mediatek/lvts_thermal.c
1429
ret = lvts_ctrl_configure(dev, lvts_ctrl);
drivers/thermal/mediatek/lvts_thermal.c
1435
ret = lvts_ctrl_start(dev, lvts_ctrl);
drivers/thermal/mediatek/lvts_thermal.c
150
const struct lvts_ctrl_data *lvts_ctrl;
drivers/thermal/mediatek/lvts_thermal.c
1509
lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false);
drivers/thermal/mediatek/lvts_thermal.c
1565
lvts_ctrl_monitor_enable(dev, &lvts_td->lvts_ctrl[i], false);
drivers/thermal/mediatek/lvts_thermal.c
1567
lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false);
drivers/thermal/mediatek/lvts_thermal.c
1587
lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], true);
drivers/thermal/mediatek/lvts_thermal.c
1589
lvts_ctrl_monitor_enable(dev, &lvts_td->lvts_ctrl[i], true);
drivers/thermal/mediatek/lvts_thermal.c
187
struct lvts_ctrl *lvts_ctrl;
drivers/thermal/mediatek/lvts_thermal.c
2019
.lvts_ctrl = mt7987_lvts_ap_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2032
.lvts_ctrl = mt7988_lvts_ap_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2046
.lvts_ctrl = mt8186_lvts_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2061
.lvts_ctrl = mt8188_lvts_mcu_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2076
.lvts_ctrl = mt8188_lvts_ap_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2091
.lvts_ctrl = mt8192_lvts_mcu_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2106
.lvts_ctrl = mt8192_lvts_ap_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2121
.lvts_ctrl = mt8195_lvts_mcu_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2136
.lvts_ctrl = mt8195_lvts_ap_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2151
.lvts_ctrl = mt8196_lvts_mcu_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
2163
.lvts_ctrl = mt8196_lvts_ap_data_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
261
struct lvts_ctrl *lvts_ctrl;
drivers/thermal/mediatek/lvts_thermal.c
272
lvts_ctrl = &lvts_td->lvts_ctrl[i];
drivers/thermal/mediatek/lvts_thermal.c
283
regset->base = lvts_ctrl->base;
drivers/thermal/mediatek/lvts_thermal.c
344
struct lvts_ctrl *lvts_ctrl = container_of(lvts_sensor, struct lvts_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
346
const struct lvts_data *lvts_data = lvts_ctrl->lvts_data;
drivers/thermal/mediatek/lvts_thermal.c
384
static void lvts_update_irq_mask(struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
401
value = readl(LVTS_MONINT(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
403
lvts_for_each_valid_sensor(i, lvts_ctrl) {
drivers/thermal/mediatek/lvts_thermal.c
404
if (lvts_ctrl->sensors[i].high_thresh == lvts_ctrl->high_thresh
drivers/thermal/mediatek/lvts_thermal.c
405
&& lvts_ctrl->sensors[i].low_thresh == lvts_ctrl->low_thresh) {
drivers/thermal/mediatek/lvts_thermal.c
412
if (lvts_ctrl->low_thresh == -INT_MAX) {
drivers/thermal/mediatek/lvts_thermal.c
423
writel(value, LVTS_MONINT(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
426
static bool lvts_should_update_thresh(struct lvts_ctrl *lvts_ctrl, int high)
drivers/thermal/mediatek/lvts_thermal.c
430
if (high > lvts_ctrl->high_thresh)
drivers/thermal/mediatek/lvts_thermal.c
433
lvts_for_each_valid_sensor(i, lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
434
if (lvts_ctrl->sensors[i].high_thresh == lvts_ctrl->high_thresh
drivers/thermal/mediatek/lvts_thermal.c
435
&& lvts_ctrl->sensors[i].low_thresh == lvts_ctrl->low_thresh)
drivers/thermal/mediatek/lvts_thermal.c
444
struct lvts_ctrl *lvts_ctrl = container_of(lvts_sensor, struct lvts_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
446
const struct lvts_data *lvts_data = lvts_ctrl->lvts_data;
drivers/thermal/mediatek/lvts_thermal.c
456
should_update_thresh = lvts_should_update_thresh(lvts_ctrl, high);
drivers/thermal/mediatek/lvts_thermal.c
458
lvts_ctrl->high_thresh = high;
drivers/thermal/mediatek/lvts_thermal.c
459
lvts_ctrl->low_thresh = low;
drivers/thermal/mediatek/lvts_thermal.c
461
lvts_update_irq_mask(lvts_ctrl);
drivers/thermal/mediatek/lvts_thermal.c
495
static irqreturn_t lvts_ctrl_irq_handler(struct lvts_ctrl *lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
569
value = readl(LVTS_MONINTSTS(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
583
thermal_zone_device_update(lvts_ctrl->sensors[i].tz,
drivers/thermal/mediatek/lvts_thermal.c
591
writel(value, LVTS_MONINTSTS(lvts_ctrl->base));
drivers/thermal/mediatek/lvts_thermal.c
618
aux = lvts_ctrl_irq_handler(&lvts_td->lvts_ctrl[i]);
drivers/thermal/mediatek/lvts_thermal.c
633
static int lvts_sensor_init(struct device *dev, struct lvts_ctrl *lvts_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
636
struct lvts_sensor *lvts_sensor = lvts_ctrl->sensors;
drivers/thermal/mediatek/lvts_thermal.c
639
LVTS_MSR0(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
640
LVTS_MSR1(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
641
LVTS_MSR2(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
642
LVTS_MSR3(lvts_ctrl->base)
drivers/thermal/mediatek/lvts_thermal.c
646
LVTS_IMMD0(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
647
LVTS_IMMD1(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
648
LVTS_IMMD2(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
649
LVTS_IMMD3(lvts_ctrl->base)
drivers/thermal/mediatek/lvts_thermal.c
653
LVTS_ATP0(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
654
LVTS_ATP1(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
655
LVTS_ATP2(lvts_ctrl->base),
drivers/thermal/mediatek/lvts_thermal.c
656
LVTS_ATP3(lvts_ctrl->base)
drivers/thermal/mediatek/lvts_thermal.c
689
lvts_sensor[i].base = lvts_ctrl->base;
drivers/thermal/mediatek/lvts_thermal.c
713
lvts_ctrl->valid_sensor_mask = lvts_ctrl_data->valid_sensor_mask;
drivers/thermal/mediatek/lvts_thermal.c
831
static int lvts_calibration_init(struct device *dev, struct lvts_ctrl *lvts_ctrl,
drivers/thermal/mediatek/lvts_thermal.c
836
const struct lvts_data *lvts_data = lvts_ctrl->lvts_data;
drivers/thermal/mediatek/lvts_thermal.c
856
lvts_ctrl->calibration[i] = calib;
drivers/thermal/mediatek/lvts_thermal.c
857
if (lvts_ctrl->lvts_data->msr_offset)
drivers/thermal/mediatek/lvts_thermal.c
858
lvts_ctrl->calibration[i] += lvts_ctrl->lvts_data->msr_offset;
drivers/thermal/mediatek/lvts_thermal.c
859
} else if (lvts_ctrl->lvts_data->def_calibration) {
drivers/thermal/mediatek/lvts_thermal.c
860
lvts_ctrl->calibration[i] = lvts_ctrl->lvts_data->def_calibration;
drivers/thermal/mediatek/lvts_thermal.c
945
size_t size = sizeof(*lvts_td->lvts_ctrl) * lvts_data->num_lvts_ctrl;
drivers/thermal/mediatek/lvts_thermal.c
946
struct lvts_ctrl *lvts_ctrl;
drivers/thermal/mediatek/lvts_thermal.c
960
lvts_ctrl = devm_kzalloc(dev, size, GFP_KERNEL);
drivers/thermal/mediatek/lvts_thermal.c
961
if (!lvts_ctrl)
drivers/thermal/mediatek/lvts_thermal.c
966
lvts_ctrl[i].base = lvts_td->base + lvts_data->lvts_ctrl[i].offset;
drivers/thermal/mediatek/lvts_thermal.c
967
lvts_ctrl[i].lvts_data = lvts_data;
drivers/thermal/mediatek/lvts_thermal.c
969
ret = lvts_sensor_init(dev, &lvts_ctrl[i],
drivers/thermal/mediatek/lvts_thermal.c
970
&lvts_data->lvts_ctrl[i]);
drivers/thermal/mediatek/lvts_thermal.c
974
ret = lvts_calibration_init(dev, &lvts_ctrl[i],
drivers/thermal/mediatek/lvts_thermal.c
975
&lvts_data->lvts_ctrl[i],
drivers/thermal/mediatek/lvts_thermal.c
985
lvts_ctrl[i].mode = lvts_data->lvts_ctrl[i].mode;
drivers/thermal/mediatek/lvts_thermal.c
987
lvts_ctrl[i].low_thresh = INT_MIN;
drivers/thermal/mediatek/lvts_thermal.c
988
lvts_ctrl[i].high_thresh = INT_MIN;
drivers/thermal/mediatek/lvts_thermal.c
996
lvts_td->lvts_ctrl = lvts_ctrl;