Lines Matching full:fan
73 struct pmac_fan fan; member
119 static int adt746x_fan_set_pwm(struct adt746x_fan *fan, int pwm);
120 static int adt746x_fan_get_pwm(struct adt746x_fan *fan);
216 if (strcmp(name, "fan") != 0 || in adt746x_probe()
291 * Sensor and fan management
294 adt746x_fan_set_pwm(struct adt746x_fan *fan, int pwm) in adt746x_fan_set_pwm() argument
300 sc = device_get_softc(fan->dev); in adt746x_fan_set_pwm()
303 pwm = max(fan->fan.min_rpm, pwm); in adt746x_fan_set_pwm()
304 pwm = min(fan->fan.max_rpm, pwm); in adt746x_fan_set_pwm()
306 reg = fan->pwm_reg; in adt746x_fan_set_pwm()
307 mode = fan->conf_reg; in adt746x_fan_set_pwm()
314 fan->setpoint = buf; in adt746x_fan_set_pwm()
328 adt746x_fan_get_pwm(struct adt746x_fan *fan) in adt746x_fan_get_pwm() argument
334 sc = device_get_softc(fan->dev); in adt746x_fan_get_pwm()
336 reg = fan->pwm_reg; in adt746x_fan_get_pwm()
357 /* Fill the fan location property. */ in adt746x_fill_fan_prop()
366 /* Fill in all the properties for each fan. */ in adt746x_fill_fan_prop()
368 strlcpy(sc->sc_fans[i].fan.name, location + len, 32); in adt746x_fill_fan_prop()
383 sc->sc_fans[i].fan.min_rpm = 5; /* Percent */ in adt746x_fill_fan_prop()
384 sc->sc_fans[i].fan.max_rpm = 100; in adt746x_fill_fan_prop()
385 sc->sc_fans[i].fan.read = NULL; in adt746x_fill_fan_prop()
386 sc->sc_fans[i].fan.set = in adt746x_fill_fan_prop()
388 sc->sc_fans[i].fan.default_rpm = sc->sc_fans[i].fan.max_rpm; in adt746x_fill_fan_prop()
449 struct adt746x_fan *fan; in adt746x_fanrpm_sysctl() local
454 fan = &sc->sc_fans[arg2]; in adt746x_fanrpm_sysctl()
455 pwm = adt746x_fan_get_pwm(fan); in adt746x_fanrpm_sysctl()
461 return (adt746x_fan_set_pwm(fan, pwm)); in adt746x_fanrpm_sysctl()
490 CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ADT Fan Information"); in adt746x_attach_fans()
497 pmac_thermal_fan_register(&sc->sc_fans[i].fan); in adt746x_attach_fans()
501 for (j = 0; j < strlen(sc->sc_fans[i].fan.name); j++) { in adt746x_attach_fans()
502 sysctl_name[j] = tolower(sc->sc_fans[i].fan.name[j]); in adt746x_attach_fans()
513 "Fan Information"); in adt746x_attach_fans()
515 /* I use i to pass the fan id. */ in adt746x_attach_fans()
518 i, adt746x_fanrpm_sysctl, "I", "Fan PWM in %"); in adt746x_attach_fans()
521 /* Dump fan location & type. */ in adt746x_attach_fans()
524 device_printf(dev, "Fan location: %s", in adt746x_attach_fans()
525 sc->sc_fans[i].fan.name); in adt746x_attach_fans()
559 /* A value of 0xffff means the fan is stopped. */ in adt746x_sensor_read()