adev = acpi_fetch_acpi_dev(res->handle); if (!adev) return NULL;
if (!res->count) return NULL;
count = res->count;
dev_dbg(&adev->dev, "Creating %d SDW Link devices\n", count);
ret = amd_enable_sdw_pads(res->mmio_base, res->link_mask, res->parent); if (ret) return NULL;
/* * we need to alloc/free memory manually and can't use devm: * this routine may be called from a workqueue, and not from * the parent .probe. * If devm_ was used, the memory might never be freed on errors.
*/
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) return NULL;
int sdw_amd_get_slave_info(struct sdw_amd_ctx *ctx)
{ struct amd_sdw_manager *amd_manager; struct sdw_bus *bus; struct sdw_slave *slave; struct list_head *node; int index; int i = 0; int num_slaves = 0;
for (index = 0; index < ctx->count; index++) { if (!(ctx->link_mask & BIT(index))) continue;
amd_manager = dev_get_drvdata(&ctx->pdev[index]->dev); if (!amd_manager) return -ENODEV;
bus = &amd_manager->bus; /* Calculate number of slaves */
list_for_each(node, &bus->slaves)
num_slaves++;
}
ctx->peripherals = kmalloc(struct_size(ctx->peripherals, array, num_slaves),
GFP_KERNEL); if (!ctx->peripherals) return -ENOMEM;
ctx->peripherals->num_peripherals = num_slaves; for (index = 0; index < ctx->count; index++) { if (!(ctx->link_mask & BIT(index))) continue;
amd_manager = dev_get_drvdata(&ctx->pdev[index]->dev); if (amd_manager) {
bus = &amd_manager->bus;
list_for_each_entry(slave, &bus->slaves, node) {
ctx->peripherals->array[i] = slave;
i++;
}
}
} return 0;
}
EXPORT_SYMBOL_NS(sdw_amd_get_slave_info, "SOUNDWIRE_AMD_INIT");
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.