Lines Matching +full:thermal +full:- +full:sensor

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ST Thermal Sensor Driver for syscfg based sensors.
6 * Copyright (C) 2003-2014 STMicroelectronics (R&D) Limited
16 #define STIH415_SYSCFG_FRONT(num) ((num - 100) * 4)
19 #define STIH415_SYSCFG_MPE(num) ((num - 600) * 4)
24 #define STIH416_SYSCFG_FRONT(num) ((num - 1000) * 4)
30 #define STID127_SYSCFG_CPU(num) ((num - 700) * 4)
62 /* Private OPs for System Configuration Register based thermal sensors */
63 static int st_syscfg_power_ctrl(struct st_thermal_sensor *sensor, in st_syscfg_power_ctrl() argument
66 return regmap_field_write(sensor->pwr, power_state); in st_syscfg_power_ctrl()
69 static int st_syscfg_alloc_regfields(struct st_thermal_sensor *sensor) in st_syscfg_alloc_regfields() argument
71 struct device *dev = sensor->dev; in st_syscfg_alloc_regfields()
73 sensor->pwr = devm_regmap_field_alloc(dev, sensor->regmap, in st_syscfg_alloc_regfields()
74 sensor->cdata->reg_fields[TEMP_PWR]); in st_syscfg_alloc_regfields()
76 if (IS_ERR(sensor->pwr)) { in st_syscfg_alloc_regfields()
78 return PTR_ERR(sensor->pwr); in st_syscfg_alloc_regfields()
84 static int st_syscfg_regmap_init(struct st_thermal_sensor *sensor) in st_syscfg_regmap_init() argument
86 sensor->regmap = in st_syscfg_regmap_init()
87 syscon_regmap_lookup_by_compatible(sensor->cdata->sys_compat); in st_syscfg_regmap_init()
88 if (IS_ERR(sensor->regmap)) { in st_syscfg_regmap_init()
89 dev_err(sensor->dev, "failed to find syscfg regmap\n"); in st_syscfg_regmap_init()
90 return PTR_ERR(sensor->regmap); in st_syscfg_regmap_init()
102 /* Compatible device data for stih415 sas thermal sensor */
104 .sys_compat = "st,stih415-front-syscfg",
112 /* Compatible device data for stih415 mpe thermal sensor */
114 .sys_compat = "st,stih415-system-syscfg",
118 .temp_adjust_val = -103,
122 /* Compatible device data for stih416 sas thermal sensor */
124 .sys_compat = "st,stih416-front-syscfg",
132 /* Compatible device data for stid127 thermal sensor */
134 .sys_compat = "st,stid127-cpu-syscfg",
138 .temp_adjust_val = -103,
143 { .compatible = "st,stih415-sas-thermal", .data = &st_415sas_cdata },
144 { .compatible = "st,stih415-mpe-thermal", .data = &st_415mpe_cdata },
145 { .compatible = "st,stih416-sas-thermal", .data = &st_416sas_cdata },
146 { .compatible = "st,stid127-thermal", .data = &st_127_cdata },
173 MODULE_DESCRIPTION("STMicroelectronics STi SoC Thermal Sensor Driver");