Skip to content

Commit 3683509

Browse files
committed
pinctrl: lynxpoint: Add GPIO <-> pin mapping ranges via callback
When IRQ chip is instantiated via GPIO library flow, the few functions, in particular the ACPI event registration mechanism, on some of ACPI based platforms expect that the pin ranges are initialized to that point. Add GPIO <-> pin mapping ranges via callback in the GPIO library flow. Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Mika Westerberg <[email protected]>
1 parent 03d9eca commit 3683509

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/pinctrl/intel/pinctrl-lynxpoint.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,19 @@ static int lp_gpio_irq_init_hw(struct gpio_chip *chip)
828828
return 0;
829829
}
830830

831+
static int lp_gpio_add_pin_ranges(struct gpio_chip *chip)
832+
{
833+
struct intel_pinctrl *lg = gpiochip_get_data(chip);
834+
struct device *dev = lg->dev;
835+
int ret;
836+
837+
ret = gpiochip_add_pin_range(chip, dev_name(dev), 0, 0, lg->soc->npins);
838+
if (ret)
839+
dev_err(dev, "failed to add GPIO pin range\n");
840+
841+
return ret;
842+
}
843+
831844
static int lp_gpio_probe(struct platform_device *pdev)
832845
{
833846
const struct intel_pinctrl_soc_data *soc;
@@ -899,6 +912,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
899912
gc->base = -1;
900913
gc->ngpio = LP_NUM_GPIO;
901914
gc->can_sleep = false;
915+
gc->add_pin_ranges = lp_gpio_add_pin_ranges;
902916
gc->parent = dev;
903917

904918
/* set up interrupts */

0 commit comments

Comments
 (0)