Lines Matching defs:sens
64 static int smusat_sensor_read(struct smu_sensor *sens);
109 struct smu_sensor *sens;
132 sens = sc->sc_sensors;
143 sens->dev = dev;
144 sens->reg = 0;
145 OF_getprop(child, "reg", &sens->reg, sizeof(sens->reg));
146 if (sens->reg < 0x30)
148 sens->reg -= 0x30;
150 OF_getprop(child, "zone", &sens->therm.zone, sizeof(int));
151 OF_getprop(child, "location", sens->therm.name,
152 sizeof(sens->therm.name));
157 sens->type = SMU_CURRENT_SENSOR;
160 sens->type = SMU_TEMP_SENSOR;
163 sens->type = SMU_VOLTAGE_SENSOR;
166 sens->type = SMU_POWER_SENSOR;
172 for (i = 0; i < strlen(sens->therm.name); i++) {
173 sysctl_name[i] = tolower(sens->therm.name[i]);
179 sprintf(sysctl_desc,"%s (%s)", sens->therm.name, units);
183 (sens->type == SMU_TEMP_SENSOR) ? "IK" : "I", sysctl_desc);
185 if (sens->type == SMU_TEMP_SENSOR) {
187 sens->therm.target_temp = 500 + 2732; /* 50 C */
188 sens->therm.max_temp = 900 + 2732; /* 90 C */
189 sens->therm.read =
191 pmac_thermal_sensor_register(&sens->therm);
194 sens++;
224 smusat_sensor_read(struct smu_sensor *sens)
230 dev = sens->dev;
239 value = (sc->sc_cache[sens->reg*2] << 8) +
240 sc->sc_cache[sens->reg*2 + 1];
246 switch (sens->type) {
278 struct smu_sensor *sens;
283 sens = &sc->sc_sensors[arg2];
285 value = smusat_sensor_read(sens);