rc = smu_queue_cmd(&cmd); if (rc) return rc;
wait_for_completion(&comp);
/* Handle fallback (see comment above) */ if (cmd.status != 0 && smu_supports_new_fans_ops) {
printk(KERN_WARNING "windfarm: SMU failed new fan command " "falling back to old method\n");
smu_supports_new_fans_ops = 0; goto retry;
}
/* We use the name & location here the same way we do for SMU sensors, *seethecommentinwindfarm_smu_sensors.c.Thelocationsareabit *lessconsistentherebetweentheiMacandthedesktopmodels,but *thatisgoodenoughforourneedsfornowatleast. * *OneproblemthoughisthatAppleseemtobeinconsistentwithcase *andthekerneldoesn'thavestrcasecmp=P
*/
fct->ctrl.name = NULL;
/* Names used on desktop models */ if (!strcmp(l, "Rear Fan 0") || !strcmp(l, "Rear Fan") ||
!strcmp(l, "Rear fan 0") || !strcmp(l, "Rear fan") ||
!strcmp(l, "CPU A EXHAUST"))
fct->ctrl.name = "cpu-rear-fan-0"; elseif (!strcmp(l, "Rear Fan 1") || !strcmp(l, "Rear fan 1") ||
!strcmp(l, "CPU B EXHAUST"))
fct->ctrl.name = "cpu-rear-fan-1"; elseif (!strcmp(l, "Front Fan 0") || !strcmp(l, "Front Fan") ||
!strcmp(l, "Front fan 0") || !strcmp(l, "Front fan") ||
!strcmp(l, "CPU A INTAKE"))
fct->ctrl.name = "cpu-front-fan-0"; elseif (!strcmp(l, "Front Fan 1") || !strcmp(l, "Front fan 1") ||
!strcmp(l, "CPU B INTAKE"))
fct->ctrl.name = "cpu-front-fan-1"; elseif (!strcmp(l, "CPU A PUMP"))
fct->ctrl.name = "cpu-pump-0"; elseif (!strcmp(l, "CPU B PUMP"))
fct->ctrl.name = "cpu-pump-1"; elseif (!strcmp(l, "Slots Fan") || !strcmp(l, "Slots fan") ||
!strcmp(l, "EXPANSION SLOTS INTAKE"))
fct->ctrl.name = "slots-fan"; elseif (!strcmp(l, "Drive Bay") || !strcmp(l, "Drive bay") ||
!strcmp(l, "DRIVE BAY A INTAKE"))
fct->ctrl.name = "drive-bay-fan"; elseif (!strcmp(l, "BACKSIDE"))
fct->ctrl.name = "backside-fan";
/* Unrecognized fan, bail out */ if (fct->ctrl.name == NULL) goto fail;
/* Get min & max values*/
v = of_get_property(node, "min-value", NULL); if (v == NULL) goto fail;
fct->min = *v;
v = of_get_property(node, "max-value", NULL); if (v == NULL) goto fail;
fct->max = *v;
/* Get "reg" value */
reg = of_get_property(node, "reg", NULL); if (reg == NULL) goto fail;
fct->reg = *reg;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.