]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl: intel: Export intel_gpio_add_pin_ranges()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 18 Nov 2025 12:34:01 +0000 (13:34 +0100)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 18 Nov 2025 14:13:59 +0000 (15:13 +0100)
Export intel_gpio_add_pin_ranges() for reuse in other drivers.

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/pinctrl/intel/pinctrl-intel.c
drivers/pinctrl/intel/pinctrl-intel.h

index 1e2f77d200f9f147ed32ad143f1e61dfb5fd516c..cf9db8ac0f42ea8069f512ea3124205396eac394 100644 (file)
@@ -1345,7 +1345,16 @@ static int intel_gpio_irq_init_hw(struct gpio_chip *gc)
        return 0;
 }
 
-static int intel_gpio_add_pin_ranges(struct gpio_chip *gc)
+/**
+ * intel_gpio_add_pin_ranges - add GPIO pin ranges for all groups in all communities
+ * @gc: GPIO chip structure
+ *
+ * This function iterates over all communities and all groups and adds the respective
+ * GPIO pin ranges, so the GPIO library will correctly map a GPIO offset to a pin number.
+ *
+ * Return: 0, or negative error code if range can't be added.
+ */
+int intel_gpio_add_pin_ranges(struct gpio_chip *gc)
 {
        struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
        const struct intel_community *community;
@@ -1362,6 +1371,7 @@ static int intel_gpio_add_pin_ranges(struct gpio_chip *gc)
 
        return 0;
 }
+EXPORT_SYMBOL_NS_GPL(intel_gpio_add_pin_ranges, "PINCTRL_INTEL");
 
 static unsigned int intel_gpio_ngpio(const struct intel_pinctrl *pctrl)
 {
index 654af5977603d555c7de8d48febb3a53bcc71c19..c1520797f895971cc34aaf88c0cc1db759b691dd 100644 (file)
@@ -276,6 +276,8 @@ extern const struct dev_pm_ops intel_pinctrl_pm_ops;
 const struct intel_community *intel_get_community(const struct intel_pinctrl *pctrl,
                                                  unsigned int pin);
 
+int intel_gpio_add_pin_ranges(struct gpio_chip *gc);
+
 int intel_get_groups_count(struct pinctrl_dev *pctldev);
 const char *intel_get_group_name(struct pinctrl_dev *pctldev, unsigned int group);
 int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,