/* * This indirection can go when platform_device_msi_init_and_alloc_irqs() * is switched to a proper irq_chip::irq_write_msi_msg() callback. Keep it * simple for now.
*/ staticvoid platform_msi_write_msi_msg(struct irq_data *d, struct msi_msg *msg)
{
irq_write_msi_msg_t cb = d->chip_data;
/** * platform_device_msi_init_and_alloc_irqs - Initialize platform device MSI * and allocate interrupts for @dev * @dev: The device for which to allocate interrupts * @nvec: The number of interrupts to allocate * @write_msi_msg: Callback to write an interrupt message for @dev * * Returns: * Zero for success, or an error code in case of failure * * This creates a MSI domain on @dev which has @dev->msi.domain as * parent. The parent domain sets up the new domain. The domain has * a fixed size of @nvec. The domain is managed by devres and will * be removed when the device is removed. * * Note: For migration purposes this falls back to the original platform_msi code * up to the point where all platforms have been converted to the MSI * parent model.
*/ int platform_device_msi_init_and_alloc_irqs(struct device *dev, unsignedint nvec,
irq_write_msi_msg_t write_msi_msg)
{ struct irq_domain *domain = dev->msi.domain;
if (!domain || !write_msi_msg) return -EINVAL;
/* * @write_msi_msg is stored in the resulting msi_domain_info::data. * The underlying domain creation mechanism will assign that * callback to the resulting irq chip.
*/ if (!msi_create_device_irq_domain(dev, MSI_DEFAULT_DOMAIN,
&platform_msi_template,
nvec, NULL, write_msi_msg)) return -ENODEV;
/** * platform_device_msi_free_irqs_all - Free all interrupts for @dev * @dev: The device for which to free interrupts
*/ void platform_device_msi_free_irqs_all(struct device *dev)
{
msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN);
msi_remove_device_irq_domain(dev, MSI_DEFAULT_DOMAIN);
}
EXPORT_SYMBOL_GPL(platform_device_msi_free_irqs_all);
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.