Lines Matching +full:temp +full:- +full:sensor

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
52 /* Drivebay sensor: LM75/DS1775. */
110 return (-1); in ds1775_read_2()
128 if (strcmp(name, "temp-monitor") != 0 || in ds1775_probe()
134 sc->sc_dev = dev; in ds1775_probe()
135 sc->sc_addr = iicbus_get_addr(dev); in ds1775_probe()
137 device_set_desc(dev, "Temp-Monitor DS1775"); in ds1775_probe()
149 sc->enum_hook.ich_func = ds1775_start; in ds1775_attach()
150 sc->enum_hook.ich_arg = dev; in ds1775_attach()
155 * the master. The openpic on mac-io is controlling the htpic. in ds1775_attach()
156 * This one gets attached after the mac-io probing and then the in ds1775_attach()
160 if (config_intrhook_establish(&sc->enum_hook) != 0) in ds1775_attach()
185 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", in ds1775_start()
186 CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "DS1775 Sensor Information"); in ds1775_start()
188 if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, in ds1775_start()
190 sc->sc_sensor.zone = 0; in ds1775_start()
192 plen = OF_getprop(child, "hwsensor-location", sc->sc_sensor.name, in ds1775_start()
193 sizeof(sc->sc_sensor.name)); in ds1775_start()
195 if (plen == -1) { in ds1775_start()
196 strcpy(sysctl_name, "sensor"); in ds1775_start()
198 for (i = 0; i < strlen(sc->sc_sensor.name); i++) { in ds1775_start()
199 sysctl_name[i] = tolower(sc->sc_sensor.name[i]); in ds1775_start()
207 if (sc->sc_sensor.zone == 0) { in ds1775_start()
208 sc->sc_sensor.target_temp = 500 + ZERO_C_TO_K; in ds1775_start()
209 sc->sc_sensor.max_temp = 600 + ZERO_C_TO_K; in ds1775_start()
212 sc->sc_sensor.target_temp = 300 + ZERO_C_TO_K; in ds1775_start()
213 sc->sc_sensor.max_temp = 600 + ZERO_C_TO_K; in ds1775_start()
216 sc->sc_sensor.read = in ds1775_start()
218 pmac_thermal_sensor_register(&sc->sc_sensor); in ds1775_start()
220 sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); in ds1775_start()
223 "Sensor Information"); in ds1775_start()
224 SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", in ds1775_start()
228 config_intrhook_disestablish(&sc->enum_hook); in ds1775_start()
238 err = ds1775_read_2(sc->sc_dev, sc->sc_addr, DS1775_TEMP, buf); in ds1775_sensor_read()
240 return (-1); in ds1775_sensor_read()
256 int temp; in ds1775_sensor_sysctl() local
261 temp = ds1775_sensor_read(sc); in ds1775_sensor_sysctl()
262 if (temp < 0) in ds1775_sensor_sysctl()
265 error = sysctl_handle_int(oidp, &temp, 0, req); in ds1775_sensor_sysctl()