Skip to content

Commit 2f61c00

Browse files
committed
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>
1 parent 885b92b commit 2f61c00

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,16 @@ static int intel_gpio_irq_init_hw(struct gpio_chip *gc)
13451345
return 0;
13461346
}
13471347

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)
13491358
{
13501359
struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
13511360
const struct intel_community *community;
@@ -1362,6 +1371,7 @@ static int intel_gpio_add_pin_ranges(struct gpio_chip *gc)
13621371

13631372
return 0;
13641373
}
1374+
EXPORT_SYMBOL_NS_GPL(intel_gpio_add_pin_ranges, "PINCTRL_INTEL");
13651375

13661376
static unsigned int intel_gpio_ngpio(const struct intel_pinctrl *pctrl)
13671377
{

drivers/pinctrl/intel/pinctrl-intel.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ extern const struct dev_pm_ops intel_pinctrl_pm_ops;
276276
const struct intel_community *intel_get_community(const struct intel_pinctrl *pctrl,
277277
unsigned int pin);
278278

279+
int intel_gpio_add_pin_ranges(struct gpio_chip *gc);
280+
279281
int intel_get_groups_count(struct pinctrl_dev *pctldev);
280282
const char *intel_get_group_name(struct pinctrl_dev *pctldev, unsigned int group);
281283
int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group,

0 commit comments

Comments
 (0)