Lines Matching defs:sc

73 	struct titmp_softc *sc = (struct titmp_softc *)self;
77 sc->sc_tag = ia->ia_tag;
78 sc->sc_addr = ia->ia_addr;
82 titmp_read_offsets(sc);
85 strlcpy(sc->sc_sensordev.xname, sc->sc_dev.dv_xname,
86 sizeof(sc->sc_sensordev.xname));
87 sc->sc_sensor[TITMP_LT].type = SENSOR_TEMP;
88 strlcpy(sc->sc_sensor[TITMP_LT].desc, "Local",
89 sizeof(sc->sc_sensor[TITMP_LT].desc));
90 sc->sc_sensor[TITMP_RT].type = SENSOR_TEMP;
91 strlcpy(sc->sc_sensor[TITMP_RT].desc, "Remote",
92 sizeof(sc->sc_sensor[TITMP_RT].desc));
94 sensor_attach(&sc->sc_sensordev, &sc->sc_sensor[i]);
95 sensordev_install(&sc->sc_sensordev);
96 sensor_task_register(sc, titmp_refresh_sensors, 5);
100 titmp_read_offsets(struct titmp_softc *sc)
105 iic_acquire_bus(sc->sc_tag, I2C_F_POLL);
108 error = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
113 error = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
118 sc->sc_offset[TITMP_RT] = 1000000 * hi + (lo >> 4) * 1000000 / 16;
121 iic_release_bus(sc->sc_tag, I2C_F_POLL);
125 titmp_read_sensor(struct titmp_softc *sc, uint8_t cmdhi, uint8_t cmdlo,
130 if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
131 sc->sc_addr, &cmdhi, sizeof(cmdhi), &hi, sizeof(hi), 0))
133 if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP,
134 sc->sc_addr, &cmdlo, sizeof(cmdlo), &lo, sizeof(lo), 0))
137 sc->sc_sensor[index].value = 273150000 +
139 sc->sc_sensor[index].value += sc->sc_offset[index];
143 sc->sc_sensor[index].flags |= SENSOR_FINVALID;
149 struct titmp_softc *sc = arg;
151 iic_acquire_bus(sc->sc_tag, 0);
153 titmp_read_sensor(sc, TMP451_LT_HI, TMP451_LT_LO, TITMP_LT);
154 titmp_read_sensor(sc, TMP451_RT_HI, TMP451_RT_LO, TITMP_RT);
156 iic_release_bus(sc->sc_tag, 0);