Lines Matching defs:sens
66 static int smusat_sensor_read(struct smu_sensor *sens);
111 struct smu_sensor *sens;
134 sens = sc->sc_sensors;
145 sens->dev = dev;
146 sens->reg = 0;
147 OF_getprop(child, "reg", &sens->reg, sizeof(sens->reg));
148 if (sens->reg < 0x30)
150 sens->reg -= 0x30;
152 OF_getprop(child, "zone", &sens->therm.zone, sizeof(int));
153 OF_getprop(child, "location", sens->therm.name,
154 sizeof(sens->therm.name));
159 sens->type = SMU_CURRENT_SENSOR;
162 sens->type = SMU_TEMP_SENSOR;
165 sens->type = SMU_VOLTAGE_SENSOR;
168 sens->type = SMU_POWER_SENSOR;
174 for (i = 0; i < strlen(sens->therm.name); i++) {
175 sysctl_name[i] = tolower(sens->therm.name[i]);
181 sprintf(sysctl_desc,"%s (%s)", sens->therm.name, units);
185 (sens->type == SMU_TEMP_SENSOR) ? "IK" : "I", sysctl_desc);
187 if (sens->type == SMU_TEMP_SENSOR) {
189 sens->therm.target_temp = 500 + 2731; /* 50 C */
190 sens->therm.max_temp = 900 + 2731; /* 90 C */
191 sens->therm.read =
193 pmac_thermal_sensor_register(&sens->therm);
196 sens++;
226 smusat_sensor_read(struct smu_sensor *sens)
232 dev = sens->dev;
241 value = (sc->sc_cache[sens->reg*2] << 8) +
242 sc->sc_cache[sens->reg*2 + 1];
248 switch (sens->type) {
280 struct smu_sensor *sens;
285 sens = &sc->sc_sensors[arg2];
287 value = smusat_sensor_read(sens);