Skip to content

Commit 93a0d34

Browse files
committed
Merge tag 'pinctrl-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: "Here are three pin control fixes. The Intel fixes are the most serious and important things I had queued since it affects a large portion of deployed Chromebooks. - Two major fixes for the Intel Cherryview and Sunrisepoint pin controllers, adjusting numberspaces so that they get aligned with various messed-up numbers encoded into the BIOS. - A fix for the Meson driver GPIO pin range" * tag 'pinctrl-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: sunrisepoint: Align GPIO number space with Windows pinctrl: cherryview: Associate IRQ descriptors to irqdomain pinctrl: meson-axg: fix the range of aobus bank
2 parents 89240c6 + c41eb2c commit 93a0d34

File tree

3 files changed

+55
-8
lines changed

3 files changed

+55
-8
lines changed

drivers/pinctrl/intel/pinctrl-cherryview.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,22 +1622,30 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
16221622

16231623
if (!need_valid_mask) {
16241624
irq_base = devm_irq_alloc_descs(pctrl->dev, -1, 0,
1625-
chip->ngpio, NUMA_NO_NODE);
1625+
community->npins, NUMA_NO_NODE);
16261626
if (irq_base < 0) {
16271627
dev_err(pctrl->dev, "Failed to allocate IRQ numbers\n");
16281628
return irq_base;
16291629
}
1630-
} else {
1631-
irq_base = 0;
16321630
}
16331631

1634-
ret = gpiochip_irqchip_add(chip, &chv_gpio_irqchip, irq_base,
1632+
ret = gpiochip_irqchip_add(chip, &chv_gpio_irqchip, 0,
16351633
handle_bad_irq, IRQ_TYPE_NONE);
16361634
if (ret) {
16371635
dev_err(pctrl->dev, "failed to add IRQ chip\n");
16381636
return ret;
16391637
}
16401638

1639+
if (!need_valid_mask) {
1640+
for (i = 0; i < community->ngpio_ranges; i++) {
1641+
range = &community->gpio_ranges[i];
1642+
1643+
irq_domain_associate_many(chip->irq.domain, irq_base,
1644+
range->base, range->npins);
1645+
irq_base += range->npins;
1646+
}
1647+
}
1648+
16411649
gpiochip_set_chained_irqchip(chip, &chv_gpio_irqchip, irq,
16421650
chv_gpio_irq_handler);
16431651
return 0;

drivers/pinctrl/intel/pinctrl-sunrisepoint.c

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@
3636
.npins = ((e) - (s) + 1), \
3737
}
3838

39+
#define SPTH_GPP(r, s, e, g) \
40+
{ \
41+
.reg_num = (r), \
42+
.base = (s), \
43+
.size = ((e) - (s) + 1), \
44+
.gpio_base = (g), \
45+
}
46+
47+
#define SPTH_COMMUNITY(b, s, e, g) \
48+
{ \
49+
.barno = (b), \
50+
.padown_offset = SPT_PAD_OWN, \
51+
.padcfglock_offset = SPT_PADCFGLOCK, \
52+
.hostown_offset = SPT_HOSTSW_OWN, \
53+
.ie_offset = SPT_GPI_IE, \
54+
.pin_base = (s), \
55+
.npins = ((e) - (s) + 1), \
56+
.gpps = (g), \
57+
.ngpps = ARRAY_SIZE(g), \
58+
}
59+
3960
/* Sunrisepoint-LP */
4061
static const struct pinctrl_pin_desc sptlp_pins[] = {
4162
/* GPP_A */
@@ -531,10 +552,28 @@ static const struct intel_function spth_functions[] = {
531552
FUNCTION("i2c2", spth_i2c2_groups),
532553
};
533554

555+
static const struct intel_padgroup spth_community0_gpps[] = {
556+
SPTH_GPP(0, 0, 23, 0), /* GPP_A */
557+
SPTH_GPP(1, 24, 47, 24), /* GPP_B */
558+
};
559+
560+
static const struct intel_padgroup spth_community1_gpps[] = {
561+
SPTH_GPP(0, 48, 71, 48), /* GPP_C */
562+
SPTH_GPP(1, 72, 95, 72), /* GPP_D */
563+
SPTH_GPP(2, 96, 108, 96), /* GPP_E */
564+
SPTH_GPP(3, 109, 132, 120), /* GPP_F */
565+
SPTH_GPP(4, 133, 156, 144), /* GPP_G */
566+
SPTH_GPP(5, 157, 180, 168), /* GPP_H */
567+
};
568+
569+
static const struct intel_padgroup spth_community3_gpps[] = {
570+
SPTH_GPP(0, 181, 191, 192), /* GPP_I */
571+
};
572+
534573
static const struct intel_community spth_communities[] = {
535-
SPT_COMMUNITY(0, 0, 47),
536-
SPT_COMMUNITY(1, 48, 180),
537-
SPT_COMMUNITY(2, 181, 191),
574+
SPTH_COMMUNITY(0, 0, 47, spth_community0_gpps),
575+
SPTH_COMMUNITY(1, 48, 180, spth_community1_gpps),
576+
SPTH_COMMUNITY(2, 181, 191, spth_community3_gpps),
538577
};
539578

540579
static const struct intel_pinctrl_soc_data spth_soc_data = {

drivers/pinctrl/meson/pinctrl-meson-axg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ static struct meson_bank meson_axg_periphs_banks[] = {
898898

899899
static struct meson_bank meson_axg_aobus_banks[] = {
900900
/* name first last irq pullen pull dir out in */
901-
BANK("AO", GPIOAO_0, GPIOAO_9, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
901+
BANK("AO", GPIOAO_0, GPIOAO_13, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0),
902902
};
903903

904904
static struct meson_pmx_bank meson_axg_periphs_pmx_banks[] = {

0 commit comments

Comments
 (0)