Merge tag 'irq-core-2022-08-01' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / include / linux / gpio / driver.h
index 54c3c65..6aeea10 100644 (file)
@@ -12,6 +12,8 @@
 #include <linux/property.h>
 #include <linux/types.h>
 
+#include <asm/msi.h>
+
 struct gpio_desc;
 struct of_phandle_args;
 struct device_node;
@@ -23,6 +25,13 @@ enum gpio_lookup_flags;
 
 struct gpio_chip;
 
+union gpio_irq_fwspec {
+       struct irq_fwspec       fwspec;
+#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
+       msi_alloc_info_t        msiinfo;
+#endif
+};
+
 #define GPIO_LINE_DIRECTION_IN 1
 #define GPIO_LINE_DIRECTION_OUT        0
 
@@ -103,9 +112,10 @@ struct gpio_irq_chip {
         * variant named &gpiochip_populate_parent_fwspec_fourcell is also
         * available.
         */
-       void *(*populate_parent_alloc_arg)(struct gpio_chip *gc,
-                                      unsigned int parent_hwirq,
-                                      unsigned int parent_type);
+       int (*populate_parent_alloc_arg)(struct gpio_chip *gc,
+                                        union gpio_irq_fwspec *fwspec,
+                                        unsigned int parent_hwirq,
+                                        unsigned int parent_type);
 
        /**
         * @child_offset_to_irq:
@@ -649,28 +659,14 @@ struct bgpio_pdata {
 
 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
 
-void *gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
+int gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
+                                           union gpio_irq_fwspec *gfwspec,
+                                           unsigned int parent_hwirq,
+                                           unsigned int parent_type);
+int gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
+                                            union gpio_irq_fwspec *gfwspec,
                                             unsigned int parent_hwirq,
                                             unsigned int parent_type);
-void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
-                                             unsigned int parent_hwirq,
-                                             unsigned int parent_type);
-
-#else
-
-static inline void *gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
-                                                   unsigned int parent_hwirq,
-                                                   unsigned int parent_type)
-{
-       return NULL;
-}
-
-static inline void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
-                                                    unsigned int parent_hwirq,
-                                                    unsigned int parent_type)
-{
-       return NULL;
-}
 
 #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */