Lines Matching +full:thermal +full:- +full:sensors
18 * Intel Platform Controller Hub (PCH) Thermal Sensor Driver
28 * thermal sensor which gives us the ability to read the temperature sensor that
36 * - Intel 8 Series PCH
37 * - Intel 9 Series and Broadwell Mobile Low Power PCH
38 * - Intel C610 Series and X99 PCH
39 * - Intel C620 Series PCH
40 * - Intel 100 Series PCH
41 * - Intel 200 Series and Z730 PCH
42 * - Intel Sunrise Point-LP (Kaby Lake-U) PCH
43 * - Intel Cannon Lake (Whiskey Lake-U) PCH
44 * - Intel 300 Series and C240 Chipset
45 * - Intel 400 Series and On-Package PCH
50 * - Intel 5 Series and Xeon 3400 PCH
51 * - Intel 6 Series PCH
52 * - Intel 7 Series PCH
53 * - Intel C600 Series and X79 PCH
67 #include <sys/sensors.h>
85 * 8-bits. The resolution and offset are described above.
91 * Thermal Sensor Enable and Lock (TSEL) register. This register is a byte wide
92 * and has two bits that we care about. The ETS bit, enable thermal sensor,
94 * locked which is the PLDB, Policy Lock-Down Bit, bit. Which restricts
102 * Threshold registers for the thermal sensors. These indicate the catastrophic,
131 if (!DDI_FM_ACC_ERR_CAP(pch->pcht_fm_caps)) { in pchtemp_read_check()
135 ddi_fm_acc_err_get(pch->pcht_handle, &de, DDI_FME_VERSION); in pchtemp_read_check()
136 ddi_fm_acc_err_clear(pch->pcht_handle, DDI_FME_VERSION); in pchtemp_read_check()
147 mutex_enter(&pch->pcht_mutex); in pchtemp_read()
149 temp = ddi_get16(pch->pcht_handle, in pchtemp_read()
150 (uint16_t *)((uintptr_t)pch->pcht_base + PCHTEMP_REG_TEMP)); in pchtemp_read()
151 tsel = ddi_get8(pch->pcht_handle, in pchtemp_read()
152 (uint8_t *)((uintptr_t)pch->pcht_base + PCHTEMP_REG_TSEL)); in pchtemp_read()
153 ctt = ddi_get16(pch->pcht_handle, in pchtemp_read()
154 (uint16_t *)((uintptr_t)pch->pcht_base + PCHTEMP_REG_CTT)); in pchtemp_read()
155 tahv = ddi_get16(pch->pcht_handle, in pchtemp_read()
156 (uint16_t *)((uintptr_t)pch->pcht_base + PCHTEMP_REG_TAHV)); in pchtemp_read()
157 talv = ddi_get16(pch->pcht_handle, in pchtemp_read()
158 (uint16_t *)((uintptr_t)pch->pcht_base + PCHTEMP_REG_TALV)); in pchtemp_read()
161 mutex_exit(&pch->pcht_mutex); in pchtemp_read()
162 dev_err(pch->pcht_dip, CE_WARN, "failed to read temperature " in pchtemp_read()
167 pch->pcht_temp_raw = temp; in pchtemp_read()
168 pch->pcht_tsel_raw = tsel; in pchtemp_read()
169 pch->pcht_ctt_raw = ctt; in pchtemp_read()
170 pch->pcht_tahv_raw = tahv; in pchtemp_read()
171 pch->pcht_talv_raw = talv; in pchtemp_read()
174 mutex_exit(&pch->pcht_mutex); in pchtemp_read()
178 pch->pcht_temp = (temp & PCHTEMP_REG_TEMP_TSR) - PCHTEMP_TEMP_OFFSET; in pchtemp_read()
179 scalar->sis_unit = SENSOR_UNIT_CELSIUS; in pchtemp_read()
180 scalar->sis_gran = PCHTEMP_TEMP_RESOLUTION; in pchtemp_read()
181 scalar->sis_value = pch->pcht_temp; in pchtemp_read()
182 mutex_exit(&pch->pcht_mutex); in pchtemp_read()
197 ASSERT3P(pch->pcht_dip, !=, NULL); in pchtemp_cleanup()
198 inst = ddi_get_instance(pch->pcht_dip); in pchtemp_cleanup()
200 (void) ksensor_remove(pch->pcht_dip, KSENSOR_ALL_IDS); in pchtemp_cleanup()
202 if (pch->pcht_handle != NULL) { in pchtemp_cleanup()
203 ddi_regs_map_free(&pch->pcht_handle); in pchtemp_cleanup()
206 if (pch->pcht_fm_caps != DDI_FM_NOT_CAPABLE) { in pchtemp_cleanup()
207 ddi_fm_fini(pch->pcht_dip); in pchtemp_cleanup()
210 mutex_destroy(&pch->pcht_mutex); in pchtemp_cleanup()
246 pch->pcht_dip = dip; in pchtemp_attach()
248 pch->pcht_fm_caps = DDI_FM_ACCCHK_CAPABLE; in pchtemp_attach()
249 ddi_fm_init(dip, &pch->pcht_fm_caps, &iblk); in pchtemp_attach()
251 mutex_init(&pch->pcht_mutex, NULL, MUTEX_DRIVER, NULL); in pchtemp_attach()
264 if (DDI_FM_ACC_ERR_CAP(pch->pcht_fm_caps)) { in pchtemp_attach()
270 if ((ret = ddi_regs_map_setup(dip, PCHTEMP_RNUMBER, &pch->pcht_base, in pchtemp_attach()
271 0, memsize, &da, &pch->pcht_handle)) != DDI_SUCCESS) { in pchtemp_attach()
283 if ((ret = ksensor_create(pch->pcht_dip, &pchtemp_temp_ops, pch, name, in pchtemp_attach()
284 DDI_NT_SENSOR_TEMP_PCH, &pch->pcht_ksensor)) != 0) { in pchtemp_attach()
337 .drv_linkinfo = "Intel PCH Thermal Sensor",