Skip to content

Commit 8db5efb

Browse files
committed
Merge tag 'pinctrl-v5.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: "Late pin control fixes, would have been in the main pull request normally but hey I got lucky and we got another week to polish up v5.12 so here we go. One driver fix and one making the core debugfs work: - Fix the number of pins in the community of the Intel Lewisburg SoC - Show pin numbers for controllers with base = 0 in the new debugfs feature" * tag 'pinctrl-v5.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: core: Show pin numbers for the controllers with base = 0 pinctrl: lewisburg: Update number of pins in community
2 parents e77a830 + 482715f commit 8db5efb

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

drivers/pinctrl/core.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,8 +1604,8 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
16041604
unsigned i, pin;
16051605
#ifdef CONFIG_GPIOLIB
16061606
struct pinctrl_gpio_range *range;
1607-
unsigned int gpio_num;
16081607
struct gpio_chip *chip;
1608+
int gpio_num;
16091609
#endif
16101610

16111611
seq_printf(s, "registered pins: %d\n", pctldev->desc->npins);
@@ -1625,18 +1625,20 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
16251625
seq_printf(s, "pin %d (%s) ", pin, desc->name);
16261626

16271627
#ifdef CONFIG_GPIOLIB
1628-
gpio_num = 0;
1628+
gpio_num = -1;
16291629
list_for_each_entry(range, &pctldev->gpio_ranges, node) {
16301630
if ((pin >= range->pin_base) &&
16311631
(pin < (range->pin_base + range->npins))) {
16321632
gpio_num = range->base + (pin - range->pin_base);
16331633
break;
16341634
}
16351635
}
1636-
chip = gpio_to_chip(gpio_num);
1637-
if (chip && chip->gpiodev && chip->gpiodev->base)
1638-
seq_printf(s, "%u:%s ", gpio_num -
1639-
chip->gpiodev->base, chip->label);
1636+
if (gpio_num >= 0)
1637+
chip = gpio_to_chip(gpio_num);
1638+
else
1639+
chip = NULL;
1640+
if (chip)
1641+
seq_printf(s, "%u:%s ", gpio_num - chip->gpiodev->base, chip->label);
16401642
else
16411643
seq_puts(s, "0:? ");
16421644
#endif

drivers/pinctrl/intel/pinctrl-lewisburg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ static const struct pinctrl_pin_desc lbg_pins[] = {
299299
static const struct intel_community lbg_communities[] = {
300300
LBG_COMMUNITY(0, 0, 71),
301301
LBG_COMMUNITY(1, 72, 132),
302-
LBG_COMMUNITY(3, 133, 144),
303-
LBG_COMMUNITY(4, 145, 180),
304-
LBG_COMMUNITY(5, 181, 246),
302+
LBG_COMMUNITY(3, 133, 143),
303+
LBG_COMMUNITY(4, 144, 178),
304+
LBG_COMMUNITY(5, 179, 246),
305305
};
306306

307307
static const struct intel_pinctrl_soc_data lbg_soc_data = {

0 commit comments

Comments
 (0)