Lines Matching +full:temperature +full:- +full:sensor
1 // SPDX-License-Identifier: GPL-2.0-only
8 #include <linux/clk-provider.h>
15 #include <linux/nvmem-consumer.h>
20 #include <dt-bindings/thermal/mediatek,lvts-thermal.h>
83 #define LVTS_COEFF_A_MT8195 -250460
85 #define LVTS_COEFF_A_MT7988 -204650
121 if (!((lvts_ctrl)->valid_sensor_mask & BIT(i))) \
224 lvts_td->dom_dentry = debugfs_create_dir(dev_name(dev), NULL); in lvts_debugfs_init()
225 if (IS_ERR(lvts_td->dom_dentry)) in lvts_debugfs_init()
228 for (i = 0; i < lvts_td->num_lvts_ctrl; i++) { in lvts_debugfs_init()
230 lvts_ctrl = &lvts_td->lvts_ctrl[i]; in lvts_debugfs_init()
233 dentry = debugfs_create_dir(name, lvts_td->dom_dentry); in lvts_debugfs_init()
241 regset->base = lvts_ctrl->base; in lvts_debugfs_init()
242 regset->regs = lvts_regs; in lvts_debugfs_init()
243 regset->nregs = ARRAY_SIZE(lvts_regs); in lvts_debugfs_init()
253 debugfs_remove_recursive(lvts_td->dom_dentry); in lvts_debugfs_exit()
270 int temperature; in lvts_raw_to_temp() local
272 temperature = ((s64)(raw_temp & 0xFFFF) * temp_factor) >> 14; in lvts_raw_to_temp()
273 temperature += golden_temp_offset; in lvts_raw_to_temp()
275 return temperature; in lvts_raw_to_temp()
278 static u32 lvts_temp_to_raw(int temperature, int temp_factor) in lvts_temp_to_raw() argument
280 u32 raw_temp = ((s64)(golden_temp_offset - temperature)) << 14; in lvts_temp_to_raw()
282 raw_temp = div_s64(raw_temp, -temp_factor); in lvts_temp_to_raw()
291 sensors[lvts_sensor->id]); in lvts_get_temp()
292 const struct lvts_data *lvts_data = lvts_ctrl->lvts_data; in lvts_get_temp()
293 void __iomem *msr = lvts_sensor->msr; in lvts_get_temp()
300 * LVTS_MSR[0-3] / LVTS_IMMD[0-3] in lvts_get_temp()
304 * 32-17: Unused in lvts_get_temp()
305 * 16 : Valid temperature in lvts_get_temp()
306 * 15-0 : Raw temperature in lvts_get_temp()
312 * As the thermal zone temperature will read before the in lvts_get_temp()
313 * hardware sensor is fully initialized, we have to check the in lvts_get_temp()
314 * validity of the temperature returned when reading the in lvts_get_temp()
316 * valid bit temperature only when it is totally initialized. in lvts_get_temp()
319 * functionning temperature and directly jump to a system in lvts_get_temp()
323 return -EAGAIN; in lvts_get_temp()
325 *temp = lvts_raw_to_temp(value & 0xFFFF, lvts_data->temp_factor); in lvts_get_temp()
341 value = readl(LVTS_MONINT(lvts_ctrl->base)); in lvts_update_irq_mask()
344 if (lvts_ctrl->sensors[i].high_thresh == lvts_ctrl->high_thresh in lvts_update_irq_mask()
345 && lvts_ctrl->sensors[i].low_thresh == lvts_ctrl->low_thresh) in lvts_update_irq_mask()
351 writel(value, LVTS_MONINT(lvts_ctrl->base)); in lvts_update_irq_mask()
358 if (high > lvts_ctrl->high_thresh) in lvts_should_update_thresh()
362 if (lvts_ctrl->sensors[i].high_thresh == lvts_ctrl->high_thresh in lvts_should_update_thresh()
363 && lvts_ctrl->sensors[i].low_thresh == lvts_ctrl->low_thresh) in lvts_should_update_thresh()
373 sensors[lvts_sensor->id]); in lvts_set_trips()
374 const struct lvts_data *lvts_data = lvts_ctrl->lvts_data; in lvts_set_trips()
375 void __iomem *base = lvts_sensor->base; in lvts_set_trips()
376 u32 raw_low = lvts_temp_to_raw(low != -INT_MAX ? low : LVTS_MINIMUM_THRESHOLD, in lvts_set_trips()
377 lvts_data->temp_factor); in lvts_set_trips()
378 u32 raw_high = lvts_temp_to_raw(high, lvts_data->temp_factor); in lvts_set_trips()
381 lvts_sensor->low_thresh = low; in lvts_set_trips()
382 lvts_sensor->high_thresh = high; in lvts_set_trips()
386 lvts_ctrl->high_thresh = high; in lvts_set_trips()
387 lvts_ctrl->low_thresh = low; in lvts_set_trips()
395 * Low offset temperature threshold in lvts_set_trips()
401 * 14-0 : Raw temperature for threshold in lvts_set_trips()
403 pr_debug("%s: Setting low limit temperature interrupt: %d\n", in lvts_set_trips()
408 * High offset temperature threshold in lvts_set_trips()
414 * 14-0 : Raw temperature for threshold in lvts_set_trips()
416 pr_debug("%s: Setting high limit temperature interrupt: %d\n", in lvts_set_trips()
445 * 28 : Interrupt using filter on sensor 3 in lvts_ctrl_irq_handler()
447 * 27 : Interrupt using immediate on sensor 3 in lvts_ctrl_irq_handler()
448 * 26 : Interrupt normal to hot on sensor 3 in lvts_ctrl_irq_handler()
449 * 25 : Interrupt high offset on sensor 3 in lvts_ctrl_irq_handler()
450 * 24 : Interrupt low offset on sensor 3 in lvts_ctrl_irq_handler()
452 * 23 : Interrupt hot threshold on sensor 3 in lvts_ctrl_irq_handler()
453 * 22 : Interrupt cold threshold on sensor 3 in lvts_ctrl_irq_handler()
454 * 21 : Interrupt using filter on sensor 2 in lvts_ctrl_irq_handler()
455 * 20 : Interrupt using filter on sensor 1 in lvts_ctrl_irq_handler()
457 * 19 : Interrupt using filter on sensor 0 in lvts_ctrl_irq_handler()
458 * 18 : Interrupt using immediate on sensor 2 in lvts_ctrl_irq_handler()
459 * 17 : Interrupt using immediate on sensor 1 in lvts_ctrl_irq_handler()
460 * 16 : Interrupt using immediate on sensor 0 in lvts_ctrl_irq_handler()
463 * 14 : Interrupt normal to hot on sensor 2 in lvts_ctrl_irq_handler()
464 * 13 : Interrupt high offset interrupt on sensor 2 in lvts_ctrl_irq_handler()
465 * 12 : Interrupt low offset interrupt on sensor 2 in lvts_ctrl_irq_handler()
467 * 11 : Interrupt hot threshold on sensor 2 in lvts_ctrl_irq_handler()
468 * 10 : Interrupt cold threshold on sensor 2 in lvts_ctrl_irq_handler()
469 * 9 : Interrupt normal to hot on sensor 1 in lvts_ctrl_irq_handler()
470 * 8 : Interrupt high offset interrupt on sensor 1 in lvts_ctrl_irq_handler()
472 * 7 : Interrupt low offset interrupt on sensor 1 in lvts_ctrl_irq_handler()
473 * 6 : Interrupt hot threshold on sensor 1 in lvts_ctrl_irq_handler()
474 * 5 : Interrupt cold threshold on sensor 1 in lvts_ctrl_irq_handler()
475 * 4 : Interrupt normal to hot on sensor 0 in lvts_ctrl_irq_handler()
477 * 3 : Interrupt high offset interrupt on sensor 0 in lvts_ctrl_irq_handler()
478 * 2 : Interrupt low offset interrupt on sensor 0 in lvts_ctrl_irq_handler()
479 * 1 : Interrupt hot threshold on sensor 0 in lvts_ctrl_irq_handler()
480 * 0 : Interrupt cold threshold on sensor 0 in lvts_ctrl_irq_handler()
482 * We are interested in the sensor(s) responsible of the in lvts_ctrl_irq_handler()
484 * thermal zone associated with the sensor. The framework will in lvts_ctrl_irq_handler()
486 * are only interested in which sensor raised the interrupt. in lvts_ctrl_irq_handler()
488 * sensor 3 interrupt: 0001 1111 1100 0000 0000 0000 0000 0000 in lvts_ctrl_irq_handler()
490 * sensor 2 interrupt: 0000 0000 0010 0100 0111 1100 0000 0000 in lvts_ctrl_irq_handler()
492 * sensor 1 interrupt: 0000 0000 0001 0010 0000 0011 1110 0000 in lvts_ctrl_irq_handler()
494 * sensor 0 interrupt: 0000 0000 0000 1001 0000 0000 0001 1111 in lvts_ctrl_irq_handler()
497 value = readl(LVTS_MONINTSTS(lvts_ctrl->base)); in lvts_ctrl_irq_handler()
503 * corresponding to the sensor id eg. index=0, mask for in lvts_ctrl_irq_handler()
511 thermal_zone_device_update(lvts_ctrl->sensors[i].tz, in lvts_ctrl_irq_handler()
519 writel(value, LVTS_MONINTSTS(lvts_ctrl->base)); in lvts_ctrl_irq_handler()
525 * Temperature interrupt handler. Even if the driver supports more
526 * interrupt modes, we use the interrupt when the temperature crosses
535 * hot temperature limit. At each interrupt, we check in every
544 for (i = 0; i < lvts_td->num_lvts_ctrl; i++) { in lvts_irq_handler()
546 aux = lvts_ctrl_irq_handler(&lvts_td->lvts_ctrl[i]); in lvts_irq_handler()
564 struct lvts_sensor *lvts_sensor = lvts_ctrl->sensors; in lvts_sensor_init()
567 LVTS_MSR0(lvts_ctrl->base), in lvts_sensor_init()
568 LVTS_MSR1(lvts_ctrl->base), in lvts_sensor_init()
569 LVTS_MSR2(lvts_ctrl->base), in lvts_sensor_init()
570 LVTS_MSR3(lvts_ctrl->base) in lvts_sensor_init()
574 LVTS_IMMD0(lvts_ctrl->base), in lvts_sensor_init()
575 LVTS_IMMD1(lvts_ctrl->base), in lvts_sensor_init()
576 LVTS_IMMD2(lvts_ctrl->base), in lvts_sensor_init()
577 LVTS_IMMD3(lvts_ctrl->base) in lvts_sensor_init()
584 int dt_id = lvts_ctrl_data->lvts_sensor[i].dt_id; in lvts_sensor_init()
588 * sensor. Let's set arbitrally the id from the index. in lvts_sensor_init()
599 * node id from the data in the sensor structure in lvts_sensor_init()
610 lvts_sensor[i].base = lvts_ctrl->base; in lvts_sensor_init()
613 * Each sensor has its own register address to read from. in lvts_sensor_init()
615 lvts_sensor[i].msr = lvts_ctrl_data->mode == LVTS_MSR_IMMEDIATE_MODE ? in lvts_sensor_init()
622 lvts_ctrl->valid_sensor_mask = lvts_ctrl_data->valid_sensor_mask; in lvts_sensor_init()
628 * The efuse blob values follows the sensor enumeration per thermal
634 * <-----mcu-tc#0-----> <-----sensor#0-----> <-----sensor#1----->
637 * <-----sensor#2-----> <-----sensor#3----->
640 …* <-----sensor#4-----> <-----sensor#5-----> <-----sensor#6-----> <-----sensor…
645 * <-----sensor#0-----> <-----sensor#1----->
648 * <-----sensor#2-----> <-----sensor#3----->
651 * <-----sensor#4-----> <-----sensor#5----->
654 * <-----sensor#6-----> <-----sensor#7-----> <-----sensor#8----->
660 * <-----mcu-tc#0-----> <-----sensor#0-----> <-----sensor#1----->
663 * <-----mcu-tc#1-----> <-----sensor#2-----> <-----sensor#3----->
666 …* <-----mcu-tc#2-----> <-----sensor#4-----> <-----sensor#5-----> <-----sensor#6-----> <-----sensor…
671 * <-----ap--tc#0-----> <-----sensor#0-----> <-----sensor#1----->
674 * <-----ap--tc#1-----> <-----sensor#2-----> <-----sensor#3----->
677 * <-----ap--tc#2-----> <-----sensor#4-----> <-----sensor#5-----> <-----sensor#6----->
680 * <-----ap--tc#3-----> <-----sensor#7-----> <-----sensor#8----->
685 * for each sensor.
696 gt = (((u32 *)efuse_calibration)[0] >> lvts_ctrl->lvts_data->gt_calib_bit_offset) & 0xff; in lvts_calibration_init()
699 const struct lvts_sensor_data *sensor = in lvts_calibration_init() local
700 &lvts_ctrl_data->lvts_sensor[i]; in lvts_calibration_init()
702 if (sensor->cal_offsets[0] >= calib_len || in lvts_calibration_init()
703 sensor->cal_offsets[1] >= calib_len || in lvts_calibration_init()
704 sensor->cal_offsets[2] >= calib_len) in lvts_calibration_init()
705 return -EINVAL; in lvts_calibration_init()
708 lvts_ctrl->calibration[i] = in lvts_calibration_init()
709 (efuse_calibration[sensor->cal_offsets[0]] << 0) + in lvts_calibration_init()
710 (efuse_calibration[sensor->cal_offsets[1]] << 8) + in lvts_calibration_init()
711 (efuse_calibration[sensor->cal_offsets[2]] << 16); in lvts_calibration_init()
712 } else if (lvts_ctrl->lvts_data->def_calibration) { in lvts_calibration_init()
713 lvts_ctrl->calibration[i] = lvts_ctrl->lvts_data->def_calibration; in lvts_calibration_init()
716 return -ENODATA; in lvts_calibration_init()
737 of_property_for_each_string(np, "nvmem-cell-names", prop, cell_name) { in lvts_calibration_read()
756 lvts_td->calib = devm_krealloc(dev, lvts_td->calib, in lvts_calibration_read()
757 lvts_td->calib_len + len, GFP_KERNEL); in lvts_calibration_read()
758 if (!lvts_td->calib) { in lvts_calibration_read()
760 return -ENOMEM; in lvts_calibration_read()
763 memcpy(lvts_td->calib + lvts_td->calib_len, efuse, len); in lvts_calibration_read()
765 lvts_td->calib_len += len; in lvts_calibration_read()
779 * The golden temp information is contained in the first 32-bit in lvts_golden_temp_init()
782 gt = (((u32 *)calib)[0] >> lvts_data->gt_calib_bit_offset) & 0xff; in lvts_golden_temp_init()
788 golden_temp_offset = golden_temp * 500 + lvts_data->temp_offset; in lvts_golden_temp_init()
798 size_t size = sizeof(*lvts_td->lvts_ctrl) * lvts_data->num_lvts_ctrl; in lvts_ctrl_init()
809 ret = lvts_golden_temp_init(dev, lvts_td->calib, lvts_data); in lvts_ctrl_init()
815 return -ENOMEM; in lvts_ctrl_init()
817 for (i = 0; i < lvts_data->num_lvts_ctrl; i++) { in lvts_ctrl_init()
819 lvts_ctrl[i].base = lvts_td->base + lvts_data->lvts_ctrl[i].offset; in lvts_ctrl_init()
823 &lvts_data->lvts_ctrl[i]); in lvts_ctrl_init()
828 &lvts_data->lvts_ctrl[i], in lvts_ctrl_init()
829 lvts_td->calib, in lvts_ctrl_init()
830 lvts_td->calib_len); in lvts_ctrl_init()
835 * The mode the ctrl will use to read the temperature in lvts_ctrl_init()
838 lvts_ctrl[i].mode = lvts_data->lvts_ctrl[i].mode; in lvts_ctrl_init()
841 * The temperature to raw temperature must be done in lvts_ctrl_init()
846 lvts_data->temp_factor); in lvts_ctrl_init()
855 devm_kfree(dev, lvts_td->calib); in lvts_ctrl_init()
857 lvts_td->lvts_ctrl = lvts_ctrl; in lvts_ctrl_init()
858 lvts_td->num_lvts_ctrl = lvts_data->num_lvts_ctrl; in lvts_ctrl_init()
877 writel(cmds[i], LVTS_CONFIG(lvts_ctrl->base)); in lvts_write_config()
885 * LVTS_PROTCTL : Thermal Protection Sensor Selection in lvts_irq_init()
889 * 19-18 : Sensor to base the protection on in lvts_irq_init()
890 * 17-16 : Strategy: in lvts_irq_init()
893 * 10 : Selected sensor with bits 19-18 in lvts_irq_init()
896 writel(BIT(16), LVTS_PROTCTL(lvts_ctrl->base)); in lvts_irq_init()
899 * LVTS_PROTTA : Stage 1 temperature threshold in lvts_irq_init()
900 * LVTS_PROTTB : Stage 2 temperature threshold in lvts_irq_init()
901 * LVTS_PROTTC : Stage 3 temperature threshold in lvts_irq_init()
905 * 14-0: Raw temperature threshold in lvts_irq_init()
907 * writel(0x0, LVTS_PROTTA(lvts_ctrl->base)); in lvts_irq_init()
908 * writel(0x0, LVTS_PROTTB(lvts_ctrl->base)); in lvts_irq_init()
910 writel(lvts_ctrl->hw_tshut_raw_temp, LVTS_PROTTC(lvts_ctrl->base)); in lvts_irq_init()
918 writel(LVTS_MONINT_CONF, LVTS_MONINT(lvts_ctrl->base)); in lvts_irq_init()
946 writel(enable, LVTS_CLKEN(lvts_ctrl->base)); in lvts_ctrl_set_enable()
962 * 0-5 : thermal controller id in lvts_ctrl_connect()
965 id = readl(LVTS_ID(lvts_ctrl->base)); in lvts_ctrl_connect()
967 return -EIO; in lvts_ctrl_connect()
993 LVTS_EDATA00(lvts_ctrl->base), in lvts_ctrl_calibrate()
994 LVTS_EDATA01(lvts_ctrl->base), in lvts_ctrl_calibrate()
995 LVTS_EDATA02(lvts_ctrl->base), in lvts_ctrl_calibrate()
996 LVTS_EDATA03(lvts_ctrl->base) in lvts_ctrl_calibrate()
1000 * LVTS_EDATA0X : Efuse calibration reference value for sensor X in lvts_ctrl_calibrate()
1004 * 20-0 : Efuse value for normalization data in lvts_ctrl_calibrate()
1007 writel(lvts_ctrl->calibration[i], lvts_edata[i]); in lvts_ctrl_calibrate()
1021 * 31-24: ADC Sense 3 in lvts_ctrl_configure()
1022 * 23-16: ADC Sense 2 in lvts_ctrl_configure()
1023 * 15-8 : ADC Sense 1 in lvts_ctrl_configure()
1024 * 7-0 : ADC Sense 0 in lvts_ctrl_configure()
1027 writel(value, LVTS_TSSEL(lvts_ctrl->base)); in lvts_ctrl_configure()
1036 * LVTS_MSRCTL0 : Sensor filtering strategy in lvts_ctrl_configure()
1049 * 0-2 : Sensor0 filter in lvts_ctrl_configure()
1050 * 3-5 : Sensor1 filter in lvts_ctrl_configure()
1051 * 6-8 : Sensor2 filter in lvts_ctrl_configure()
1052 * 9-11 : Sensor3 filter in lvts_ctrl_configure()
1056 writel(value, LVTS_MSRCTL0(lvts_ctrl->base)); in lvts_ctrl_configure()
1070 * - Filter interval delay is a delay between two samples of in lvts_ctrl_configure()
1071 * the same sensor. in lvts_ctrl_configure()
1073 * - Sensor interval delay is a delay between two samples of in lvts_ctrl_configure()
1076 * - Group interval delay is a delay between different rounds. in lvts_ctrl_configure()
1079 * If Period unit = C, filter delay = 1, sensor delay = 2, group delay = 1, in lvts_ctrl_configure()
1084 * Sensor interval delay = 2 * Period unit = 236.298us in lvts_ctrl_configure()
1088 * <--> Filter interval delay in lvts_ctrl_configure()
1089 * <--> Sensor interval delay in lvts_ctrl_configure()
1090 * <--> Group interval delay in lvts_ctrl_configure()
1092 * 29 - 20 : Group interval in lvts_ctrl_configure()
1093 * 16 - 13 : Send a single interrupt when crossing the hot threshold (1) in lvts_ctrl_configure()
1095 * 9 - 0 : Period unit in lvts_ctrl_configure()
1099 writel(value, LVTS_MONCTL1(lvts_ctrl->base)); in lvts_ctrl_configure()
1102 * LVTS_MONCTL2 : Filtering and sensor interval in lvts_ctrl_configure()
1106 * 25-16 : Interval unit in PERIOD_UNIT between sample on in lvts_ctrl_configure()
1107 * the same sensor, filter interval in lvts_ctrl_configure()
1108 * 9-0 : Interval unit in PERIOD_UNIT between each sensor in lvts_ctrl_configure()
1112 writel(value, LVTS_MONCTL2(lvts_ctrl->base)); in lvts_ctrl_configure()
1119 struct lvts_sensor *lvts_sensors = lvts_ctrl->sensors; in lvts_ctrl_start()
1124 * Bitmaps to enable each sensor on immediate and filtered modes, as in lvts_ctrl_start()
1130 u32 *sensor_bitmap = lvts_ctrl->mode == LVTS_MSR_IMMEDIATE_MODE ? in lvts_ctrl_start()
1145 if (PTR_ERR(tz) == -ENODEV) in lvts_ctrl_start()
1155 * interrupt handler, we store it in the sensor in lvts_ctrl_start()
1164 * This sensor was correctly associated with a thermal in lvts_ctrl_start()
1165 * zone, let's set the corresponding bit in the sensor in lvts_ctrl_start()
1166 * map, so we can enable the temperature monitoring in in lvts_ctrl_start()
1174 * which sensor point to enable. If any thermal zone in lvts_ctrl_start()
1176 * enabled here in the sensor map. in lvts_ctrl_start()
1178 if (lvts_ctrl->mode == LVTS_MSR_IMMEDIATE_MODE) { in lvts_ctrl_start()
1192 writel(sensor_map, LVTS_MSRCTL1(lvts_ctrl->base)); in lvts_ctrl_start()
1197 * 0-3: Enable sensing point 0-3 in lvts_ctrl_start()
1199 writel(sensor_map | BIT(9), LVTS_MONCTL0(lvts_ctrl->base)); in lvts_ctrl_start()
1215 ret = lvts_domain_reset(dev, lvts_td->reset); in lvts_domain_init()
1221 for (i = 0; i < lvts_td->num_lvts_ctrl; i++) { in lvts_domain_init()
1223 lvts_ctrl = &lvts_td->lvts_ctrl[i]; in lvts_domain_init()
1228 * - Enable the clock in lvts_domain_init()
1229 * - Connect to the LVTS in lvts_domain_init()
1230 * - Initialize the LVTS in lvts_domain_init()
1231 * - Prepare the calibration data in lvts_domain_init()
1232 * - Select monitored sensors in lvts_domain_init()
1235 * - Start measurement in lvts_domain_init()
1281 struct device *dev = &pdev->dev; in lvts_probe()
1287 return -ENOMEM; in lvts_probe()
1291 return -ENODEV; in lvts_probe()
1293 lvts_td->clk = devm_clk_get_enabled(dev, NULL); in lvts_probe()
1294 if (IS_ERR(lvts_td->clk)) in lvts_probe()
1295 return dev_err_probe(dev, PTR_ERR(lvts_td->clk), "Failed to retrieve clock\n"); in lvts_probe()
1299 return dev_err_probe(dev, (-ENXIO), "No IO resource\n"); in lvts_probe()
1301 lvts_td->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); in lvts_probe()
1302 if (IS_ERR(lvts_td->base)) in lvts_probe()
1303 return dev_err_probe(dev, PTR_ERR(lvts_td->base), "Failed to map io resource\n"); in lvts_probe()
1305 lvts_td->reset = devm_reset_control_get_by_index(dev, 0); in lvts_probe()
1306 if (IS_ERR(lvts_td->reset)) in lvts_probe()
1307 return dev_err_probe(dev, PTR_ERR(lvts_td->reset), "Failed to get reset control\n"); in lvts_probe()
1313 golden_temp_offset = lvts_data->temp_offset; in lvts_probe()
1340 for (i = 0; i < lvts_td->num_lvts_ctrl; i++) in lvts_remove()
1341 lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false); in lvts_remove()
1384 for (i = 0; i < lvts_td->num_lvts_ctrl; i++) in lvts_suspend()
1385 lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false); in lvts_suspend()
1387 clk_disable_unprepare(lvts_td->clk); in lvts_suspend()
1399 ret = clk_prepare_enable(lvts_td->clk); in lvts_resume()
1403 for (i = 0; i < lvts_td->num_lvts_ctrl; i++) in lvts_resume()
1404 lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], true); in lvts_resume()
1410 * The MT8186 calibration data is stored as packed 3-byte little-endian
1411 * values using a weird layout that makes sense only when viewed as a 32-bit
1412 * hexadecimal word dump. Let's suppose SxBy where x = sensor number and
1415 * [S0B2-S0B1-S0B0-S1B2] [S1B1-S1B0-S2B2-S2B1] [S2B0-S3B2-S3B1-S3B0]
1773 { .compatible = "mediatek,mt7988-lvts-ap", .data = &mt7988_lvts_ap_data },
1774 { .compatible = "mediatek,mt8186-lvts", .data = &mt8186_lvts_data },
1775 { .compatible = "mediatek,mt8188-lvts-mcu", .data = &mt8188_lvts_mcu_data },
1776 { .compatible = "mediatek,mt8188-lvts-ap", .data = &mt8188_lvts_ap_data },
1777 { .compatible = "mediatek,mt8192-lvts-mcu", .data = &mt8192_lvts_mcu_data },
1778 { .compatible = "mediatek,mt8192-lvts-ap", .data = &mt8192_lvts_ap_data },
1779 { .compatible = "mediatek,mt8195-lvts-mcu", .data = &mt8195_lvts_mcu_data },
1780 { .compatible = "mediatek,mt8195-lvts-ap", .data = &mt8195_lvts_ap_data },
1793 .name = "mtk-lvts-thermal",