power_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_POWER, &ph); if (IS_ERR(power_ops)) return PTR_ERR(power_ops);
num_domains = power_ops->num_domains_get(ph); if (num_domains < 0) {
dev_err(dev, "number of domains not found\n"); return num_domains;
}
scmi_pd = devm_kcalloc(dev, num_domains, sizeof(*scmi_pd), GFP_KERNEL); if (!scmi_pd) return -ENOMEM;
scmi_pd_data = devm_kzalloc(dev, sizeof(*scmi_pd_data), GFP_KERNEL); if (!scmi_pd_data) return -ENOMEM;
domains = devm_kcalloc(dev, num_domains, sizeof(*domains), GFP_KERNEL); if (!domains) return -ENOMEM;
for (i = 0; i < num_domains; i++, scmi_pd++) {
u32 state;
if (power_ops->state_get(ph, i, &state)) {
dev_warn(dev, "failed to get state for domain %d\n", i); continue;
}
/* * Register the explicit power on request to the firmware so * that it is tracked as used by OSPM agent and not * accidentally turned off with OSPM's knowledge
*/ if (state == SCMI_POWER_STATE_GENERIC_ON)
power_ops->state_set(ph, i, state);
scmi_pd_data = dev_get_drvdata(dev); for (i = 0; i < scmi_pd_data->num_domains; i++) { if (!scmi_pd_data->domains[i]) continue;
pm_genpd_remove(scmi_pd_data->domains[i]);
}
}
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.