Lines Matching +full:temperature +full:- +full:mode
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
79 static int tmp461_read_temperature(device_t dev, int32_t *temperature, bool mode);
135 ofw_bus_search_compatible(dev, tmp461_compat_data)->ocd_data; in tmp461_attach()
136 sc->conf = compat_data->flags; in tmp461_attach()
139 mtx_init(&sc->mtx, "tmp461 temperature", "temperature", MTX_DEF); in tmp461_attach()
142 OID_AUTO, "temperature", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, in tmp461_attach()
150 "IK1", compat_data->desc); in tmp461_attach()
160 "IK1", compat_data->desc); in tmp461_attach()
162 /* set standby mode */ in tmp461_attach()
182 ofw_bus_search_compatible(dev, tmp461_compat_data)->ocd_data; in tmp461_probe()
186 device_set_desc(dev, compat_data->compat); in tmp461_probe()
197 mtx_destroy(&sc->mtx); in tmp461_detach()
227 tmp461_read_temperature(device_t dev, int32_t *temperature, bool remote_measure) in tmp461_read_temperature() argument
235 mtx_lock(&sc->mtx); in tmp461_read_temperature()
265 data -= offset; in tmp461_read_temperature()
266 *temperature = signed_extend32(data, 0, 8) << 4; in tmp461_read_temperature()
269 if (sc->conf & TMP461_REMOTE_TEMP_DOUBLE_REG) { in tmp461_read_temperature()
275 *temperature |= data >> 4; in tmp461_read_temperature()
278 if (sc->conf & TMP461_LOCAL_TEMP_DOUBLE_REG) { in tmp461_read_temperature()
284 *temperature |= data >> 4; in tmp461_read_temperature()
287 *temperature = (((*temperature + TMP461_C_TO_K_FIX) * 10) >> 4); in tmp461_read_temperature()
290 mtx_unlock(&sc->mtx); in tmp461_read_temperature()
297 int32_t temperature; in tmp461_sensor_sysctl() local
300 bool mode; in tmp461_sensor_sysctl() local
303 mode = arg2; in tmp461_sensor_sysctl()
305 error = tmp461_read_temperature(dev, &temperature, mode); in tmp461_sensor_sysctl()
309 return (sysctl_handle_int(oidp, &temperature, 0, req)); in tmp461_sensor_sysctl()