Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: intel: Export intel_gpio_add_pin_ranges()

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>

+13 -1
+11 -1
drivers/pinctrl/intel/pinctrl-intel.c
··· 1345 1345 return 0; 1346 1346 } 1347 1347 1348 - static int intel_gpio_add_pin_ranges(struct gpio_chip *gc) 1348 + /** 1349 + * intel_gpio_add_pin_ranges - add GPIO pin ranges for all groups in all communities 1350 + * @gc: GPIO chip structure 1351 + * 1352 + * This function iterates over all communities and all groups and adds the respective 1353 + * GPIO pin ranges, so the GPIO library will correctly map a GPIO offset to a pin number. 1354 + * 1355 + * Return: 0, or negative error code if range can't be added. 1356 + */ 1357 + int intel_gpio_add_pin_ranges(struct gpio_chip *gc) 1349 1358 { 1350 1359 struct intel_pinctrl *pctrl = gpiochip_get_data(gc); 1351 1360 const struct intel_community *community; ··· 1371 1362 1372 1363 return 0; 1373 1364 } 1365 + EXPORT_SYMBOL_NS_GPL(intel_gpio_add_pin_ranges, "PINCTRL_INTEL"); 1374 1366 1375 1367 static unsigned int intel_gpio_ngpio(const struct intel_pinctrl *pctrl) 1376 1368 {
+2
drivers/pinctrl/intel/pinctrl-intel.h
··· 276 276 const struct intel_community *intel_get_community(const struct intel_pinctrl *pctrl, 277 277 unsigned int pin); 278 278 279 + int intel_gpio_add_pin_ranges(struct gpio_chip *gc); 280 + 279 281 int intel_get_groups_count(struct pinctrl_dev *pctldev); 280 282 const char *intel_get_group_name(struct pinctrl_dev *pctldev, unsigned int group); 281 283 int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,