Merge tag 'zonefs-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal...
[sfrench/cifs-2.6.git] / include / linux / msi.h
index ddace8c34dcf958edae65de2858bf924adb9d19e..26d07e23052e05d26ca3ca9deaca219e173577d5 100644 (file)
@@ -412,6 +412,7 @@ bool arch_restore_msi_irqs(struct pci_dev *dev);
 struct irq_domain;
 struct irq_domain_ops;
 struct irq_chip;
+struct irq_fwspec;
 struct device_node;
 struct fwnode_handle;
 struct msi_domain_info;
@@ -431,6 +432,8 @@ struct msi_domain_info;
  *                     function.
  * @msi_post_free:     Optional function which is invoked after freeing
  *                     all interrupts.
+ * @msi_translate:     Optional translate callback to support the odd wire to
+ *                     MSI bridges, e.g. MBIGEN
  *
  * @get_hwirq, @msi_init and @msi_free are callbacks used by the underlying
  * irqdomain.
@@ -468,6 +471,8 @@ struct msi_domain_ops {
                                            struct device *dev);
        void            (*msi_post_free)(struct irq_domain *domain,
                                         struct device *dev);
+       int             (*msi_translate)(struct irq_domain *domain, struct irq_fwspec *fwspec,
+                                        irq_hw_number_t *hwirq, unsigned int *type);
 };
 
 /**
@@ -547,6 +552,10 @@ enum {
        MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 5),
        /* Free MSI descriptors */
        MSI_FLAG_FREE_MSI_DESCS         = (1 << 6),
+       /* Use dev->fwnode for MSI device domain creation */
+       MSI_FLAG_USE_DEV_FWNODE         = (1 << 7),
+       /* Set parent->dev into domain->pm_dev on device domain creation */
+       MSI_FLAG_PARENT_PM_DEV          = (1 << 8),
 
        /* Mask for the generic functionality */
        MSI_GENERIC_FLAGS_MASK          = GENMASK(15, 0),
@@ -572,6 +581,11 @@ enum {
  * struct msi_parent_ops - MSI parent domain callbacks and configuration info
  *
  * @supported_flags:   Required: The supported MSI flags of the parent domain
+ * @required_flags:    Optional: The required MSI flags of the parent MSI domain
+ * @bus_select_token:  Optional: The bus token of the real parent domain for
+ *                     irq_domain::select()
+ * @bus_select_mask:   Optional: A mask of supported BUS_DOMAINs for
+ *                     irq_domain::select()
  * @prefix:            Optional: Prefix for the domain and chip name
  * @init_dev_msi_info: Required: Callback for MSI parent domains to setup parent
  *                     domain specific domain flags, domain ops and interrupt chip
@@ -579,6 +593,9 @@ enum {
  */
 struct msi_parent_ops {
        u32             supported_flags;
+       u32             required_flags;
+       u32             bus_select_token;
+       u32             bus_select_mask;
        const char      *prefix;
        bool            (*init_dev_msi_info)(struct device *dev, struct irq_domain *domain,
                                             struct irq_domain *msi_parent_domain,
@@ -627,9 +644,6 @@ struct msi_domain_info *msi_get_domain_info(struct irq_domain *domain);
 struct irq_domain *platform_msi_create_irq_domain(struct fwnode_handle *fwnode,
                                                  struct msi_domain_info *info,
                                                  struct irq_domain *parent);
-int platform_msi_domain_alloc_irqs(struct device *dev, unsigned int nvec,
-                                  irq_write_msi_msg_t write_msi_msg);
-void platform_msi_domain_free_irqs(struct device *dev);
 
 /* When an MSI domain is used as an intermediate domain */
 int msi_domain_prepare_irqs(struct irq_domain *domain, struct device *dev,
@@ -656,6 +670,10 @@ int platform_msi_device_domain_alloc(struct irq_domain *domain, unsigned int vir
 void platform_msi_device_domain_free(struct irq_domain *domain, unsigned int virq,
                                     unsigned int nvec);
 void *platform_msi_get_host_data(struct irq_domain *domain);
+/* Per device platform MSI */
+int platform_device_msi_init_and_alloc_irqs(struct device *dev, unsigned int nvec,
+                                           irq_write_msi_msg_t write_msi_msg);
+void platform_device_msi_free_irqs_all(struct device *dev);
 
 bool msi_device_has_isolated_msi(struct device *dev);
 #else /* CONFIG_GENERIC_MSI_IRQ */