Skip to content

Commit 46cf2c6

Browse files
committed
Merge tag 'pinctrl-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: - Fix some register offsets on Intel Alderlake - Fix the order the UFS and SDC pins on Qualcomm SM6350 - Fix a build error in Mediatek Moore. - Fix a pin function table in the Sunplus SP7021. - Fix some Kconfig and static keywords on the Samsung Tesla FSD SoC. - Fix up the EOI function for edge triggered IRQs and keep the block clock enabled for level IRQs in the STM32 driver. - Fix some bits and order in the Rockchip RK3308 driver. - Handle the errorpath in the Pistachio driver probe() properly. * tag 'pinctrl-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: pistachio: fix use of irq_of_parse_and_map() pinctrl: stm32: Keep pinctrl block clock enabled when LEVEL IRQ requested pinctrl: rockchip: sort the rk3308_mux_recalced_data entries pinctrl: rockchip: fix RK3308 pinmux bits pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI pinctrl: Fix an error in pin-function table of SP7021 pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config pinctrl: mediatek: moore: Fix build error pinctrl: qcom: sm6350: fix order of UFS & SDC pins pinctrl: alderlake: Fix register offsets for ADL-N variant pinctrl: samsung: staticize fsd_pin_ctrl
2 parents cf424ef + 0c9843a commit 46cf2c6

10 files changed

Lines changed: 128 additions & 69 deletions

File tree

arch/arm/mach-exynos/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ menuconfig ARCH_EXYNOS
1717
select EXYNOS_PMU
1818
select EXYNOS_SROM
1919
select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
20-
select GPIOLIB
2120
select HAVE_ARM_ARCH_TIMER if ARCH_EXYNOS5
2221
select HAVE_ARM_SCU if SMP
2322
select PINCTRL

drivers/pinctrl/intel/pinctrl-alderlake.c

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@
1414

1515
#include "pinctrl-intel.h"
1616

17-
#define ADL_PAD_OWN 0x0a0
18-
#define ADL_PADCFGLOCK 0x110
19-
#define ADL_HOSTSW_OWN 0x150
20-
#define ADL_GPI_IS 0x200
21-
#define ADL_GPI_IE 0x220
17+
#define ADL_N_PAD_OWN 0x020
18+
#define ADL_N_PADCFGLOCK 0x080
19+
#define ADL_N_HOSTSW_OWN 0x0b0
20+
#define ADL_N_GPI_IS 0x100
21+
#define ADL_N_GPI_IE 0x120
22+
23+
#define ADL_S_PAD_OWN 0x0a0
24+
#define ADL_S_PADCFGLOCK 0x110
25+
#define ADL_S_HOSTSW_OWN 0x150
26+
#define ADL_S_GPI_IS 0x200
27+
#define ADL_S_GPI_IE 0x220
2228

2329
#define ADL_GPP(r, s, e, g) \
2430
{ \
@@ -28,14 +34,28 @@
2834
.gpio_base = (g), \
2935
}
3036

31-
#define ADL_COMMUNITY(b, s, e, g) \
37+
#define ADL_N_COMMUNITY(b, s, e, g) \
38+
{ \
39+
.barno = (b), \
40+
.padown_offset = ADL_N_PAD_OWN, \
41+
.padcfglock_offset = ADL_N_PADCFGLOCK, \
42+
.hostown_offset = ADL_N_HOSTSW_OWN, \
43+
.is_offset = ADL_N_GPI_IS, \
44+
.ie_offset = ADL_N_GPI_IE, \
45+
.pin_base = (s), \
46+
.npins = ((e) - (s) + 1), \
47+
.gpps = (g), \
48+
.ngpps = ARRAY_SIZE(g), \
49+
}
50+
51+
#define ADL_S_COMMUNITY(b, s, e, g) \
3252
{ \
3353
.barno = (b), \
34-
.padown_offset = ADL_PAD_OWN, \
35-
.padcfglock_offset = ADL_PADCFGLOCK, \
36-
.hostown_offset = ADL_HOSTSW_OWN, \
37-
.is_offset = ADL_GPI_IS, \
38-
.ie_offset = ADL_GPI_IE, \
54+
.padown_offset = ADL_S_PAD_OWN, \
55+
.padcfglock_offset = ADL_S_PADCFGLOCK, \
56+
.hostown_offset = ADL_S_HOSTSW_OWN, \
57+
.is_offset = ADL_S_GPI_IS, \
58+
.ie_offset = ADL_S_GPI_IE, \
3959
.pin_base = (s), \
4060
.npins = ((e) - (s) + 1), \
4161
.gpps = (g), \
@@ -342,10 +362,10 @@ static const struct intel_padgroup adln_community5_gpps[] = {
342362
};
343363

344364
static const struct intel_community adln_communities[] = {
345-
ADL_COMMUNITY(0, 0, 66, adln_community0_gpps),
346-
ADL_COMMUNITY(1, 67, 168, adln_community1_gpps),
347-
ADL_COMMUNITY(2, 169, 248, adln_community4_gpps),
348-
ADL_COMMUNITY(3, 249, 256, adln_community5_gpps),
365+
ADL_N_COMMUNITY(0, 0, 66, adln_community0_gpps),
366+
ADL_N_COMMUNITY(1, 67, 168, adln_community1_gpps),
367+
ADL_N_COMMUNITY(2, 169, 248, adln_community4_gpps),
368+
ADL_N_COMMUNITY(3, 249, 256, adln_community5_gpps),
349369
};
350370

351371
static const struct intel_pinctrl_soc_data adln_soc_data = {
@@ -713,11 +733,11 @@ static const struct intel_padgroup adls_community5_gpps[] = {
713733
};
714734

715735
static const struct intel_community adls_communities[] = {
716-
ADL_COMMUNITY(0, 0, 94, adls_community0_gpps),
717-
ADL_COMMUNITY(1, 95, 150, adls_community1_gpps),
718-
ADL_COMMUNITY(2, 151, 199, adls_community3_gpps),
719-
ADL_COMMUNITY(3, 200, 269, adls_community4_gpps),
720-
ADL_COMMUNITY(4, 270, 303, adls_community5_gpps),
736+
ADL_S_COMMUNITY(0, 0, 94, adls_community0_gpps),
737+
ADL_S_COMMUNITY(1, 95, 150, adls_community1_gpps),
738+
ADL_S_COMMUNITY(2, 151, 199, adls_community3_gpps),
739+
ADL_S_COMMUNITY(3, 200, 269, adls_community4_gpps),
740+
ADL_S_COMMUNITY(4, 270, 303, adls_community5_gpps),
721741
};
722742

723743
static const struct intel_pinctrl_soc_data adls_soc_data = {

drivers/pinctrl/mediatek/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ config PINCTRL_MTK_MOORE
3030
select GENERIC_PINMUX_FUNCTIONS
3131
select GPIOLIB
3232
select OF_GPIO
33+
select EINT_MTK
3334
select PINCTRL_MTK_V2
3435

3536
config PINCTRL_MTK_PARIS

drivers/pinctrl/pinctrl-pistachio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
13741374
}
13751375

13761376
irq = irq_of_parse_and_map(child, 0);
1377-
if (irq < 0) {
1378-
dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq);
1377+
if (!irq) {
1378+
dev_err(pctl->dev, "No IRQ for bank %u\n", i);
13791379
of_node_put(child);
1380-
ret = irq;
1380+
ret = -EINVAL;
13811381
goto err;
13821382
}
13831383

drivers/pinctrl/pinctrl-rockchip.c

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -457,95 +457,110 @@ static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {
457457

458458
static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = {
459459
{
460+
/* gpio1b6_sel */
460461
.num = 1,
461462
.pin = 14,
462463
.reg = 0x28,
463464
.bit = 12,
464465
.mask = 0xf
465466
}, {
467+
/* gpio1b7_sel */
466468
.num = 1,
467469
.pin = 15,
468470
.reg = 0x2c,
469471
.bit = 0,
470472
.mask = 0x3
471473
}, {
474+
/* gpio1c2_sel */
472475
.num = 1,
473476
.pin = 18,
474477
.reg = 0x30,
475478
.bit = 4,
476479
.mask = 0xf
477480
}, {
481+
/* gpio1c3_sel */
478482
.num = 1,
479483
.pin = 19,
480484
.reg = 0x30,
481485
.bit = 8,
482486
.mask = 0xf
483487
}, {
488+
/* gpio1c4_sel */
484489
.num = 1,
485490
.pin = 20,
486491
.reg = 0x30,
487492
.bit = 12,
488493
.mask = 0xf
489494
}, {
495+
/* gpio1c5_sel */
490496
.num = 1,
491497
.pin = 21,
492498
.reg = 0x34,
493499
.bit = 0,
494500
.mask = 0xf
495501
}, {
502+
/* gpio1c6_sel */
496503
.num = 1,
497504
.pin = 22,
498505
.reg = 0x34,
499506
.bit = 4,
500507
.mask = 0xf
501508
}, {
509+
/* gpio1c7_sel */
502510
.num = 1,
503511
.pin = 23,
504512
.reg = 0x34,
505513
.bit = 8,
506514
.mask = 0xf
507515
}, {
508-
.num = 3,
509-
.pin = 12,
510-
.reg = 0x68,
511-
.bit = 8,
512-
.mask = 0xf
513-
}, {
514-
.num = 3,
515-
.pin = 13,
516-
.reg = 0x68,
517-
.bit = 12,
518-
.mask = 0xf
519-
}, {
516+
/* gpio2a2_sel */
520517
.num = 2,
521518
.pin = 2,
522-
.reg = 0x608,
523-
.bit = 0,
524-
.mask = 0x7
519+
.reg = 0x40,
520+
.bit = 4,
521+
.mask = 0x3
525522
}, {
523+
/* gpio2a3_sel */
526524
.num = 2,
527525
.pin = 3,
528-
.reg = 0x608,
529-
.bit = 4,
530-
.mask = 0x7
526+
.reg = 0x40,
527+
.bit = 6,
528+
.mask = 0x3
531529
}, {
530+
/* gpio2c0_sel */
532531
.num = 2,
533532
.pin = 16,
534-
.reg = 0x610,
535-
.bit = 8,
536-
.mask = 0x7
533+
.reg = 0x50,
534+
.bit = 0,
535+
.mask = 0x3
537536
}, {
537+
/* gpio3b2_sel */
538538
.num = 3,
539539
.pin = 10,
540-
.reg = 0x610,
541-
.bit = 0,
542-
.mask = 0x7
540+
.reg = 0x68,
541+
.bit = 4,
542+
.mask = 0x3
543543
}, {
544+
/* gpio3b3_sel */
544545
.num = 3,
545546
.pin = 11,
546-
.reg = 0x610,
547-
.bit = 4,
548-
.mask = 0x7
547+
.reg = 0x68,
548+
.bit = 6,
549+
.mask = 0x3
550+
}, {
551+
/* gpio3b4_sel */
552+
.num = 3,
553+
.pin = 12,
554+
.reg = 0x68,
555+
.bit = 8,
556+
.mask = 0xf
557+
}, {
558+
/* gpio3b5_sel */
559+
.num = 3,
560+
.pin = 13,
561+
.reg = 0x68,
562+
.bit = 12,
563+
.mask = 0xf
549564
},
550565
};
551566

drivers/pinctrl/qcom/pinctrl-sm6350.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ static const struct pinctrl_pin_desc sm6350_pins[] = {
264264
PINCTRL_PIN(153, "GPIO_153"),
265265
PINCTRL_PIN(154, "GPIO_154"),
266266
PINCTRL_PIN(155, "GPIO_155"),
267-
PINCTRL_PIN(156, "SDC1_RCLK"),
268-
PINCTRL_PIN(157, "SDC1_CLK"),
269-
PINCTRL_PIN(158, "SDC1_CMD"),
270-
PINCTRL_PIN(159, "SDC1_DATA"),
271-
PINCTRL_PIN(160, "SDC2_CLK"),
272-
PINCTRL_PIN(161, "SDC2_CMD"),
273-
PINCTRL_PIN(162, "SDC2_DATA"),
274-
PINCTRL_PIN(163, "UFS_RESET"),
267+
PINCTRL_PIN(156, "UFS_RESET"),
268+
PINCTRL_PIN(157, "SDC1_RCLK"),
269+
PINCTRL_PIN(158, "SDC1_CLK"),
270+
PINCTRL_PIN(159, "SDC1_CMD"),
271+
PINCTRL_PIN(160, "SDC1_DATA"),
272+
PINCTRL_PIN(161, "SDC2_CLK"),
273+
PINCTRL_PIN(162, "SDC2_CMD"),
274+
PINCTRL_PIN(163, "SDC2_DATA"),
275275
};
276276

277277
#define DECLARE_MSM_GPIO_PINS(pin) \

drivers/pinctrl/samsung/Kconfig

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
#
55
config PINCTRL_SAMSUNG
66
bool
7-
depends on OF_GPIO
7+
select GPIOLIB
88
select PINMUX
99
select PINCONF
1010

1111
config PINCTRL_EXYNOS
1212
bool "Pinctrl common driver part for Samsung Exynos SoCs"
13-
depends on OF_GPIO
14-
depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
13+
depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)
1514
select PINCTRL_SAMSUNG
1615
select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
1716
select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
@@ -26,12 +25,10 @@ config PINCTRL_EXYNOS_ARM64
2625

2726
config PINCTRL_S3C24XX
2827
bool "Samsung S3C24XX SoC pinctrl driver"
29-
depends on OF_GPIO
30-
depends on ARCH_S3C24XX || COMPILE_TEST
28+
depends on ARCH_S3C24XX || (COMPILE_TEST && OF)
3129
select PINCTRL_SAMSUNG
3230

3331
config PINCTRL_S3C64XX
3432
bool "Samsung S3C64XX SoC pinctrl driver"
35-
depends on OF_GPIO
36-
depends on ARCH_S3C64XX || COMPILE_TEST
33+
depends on ARCH_S3C64XX || (COMPILE_TEST && OF)
3734
select PINCTRL_SAMSUNG

drivers/pinctrl/samsung/pinctrl-exynos-arm64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static const struct samsung_pin_bank_data fsd_pin_banks2[] __initconst = {
770770
EXYNOS850_PIN_BANK_EINTN(3, 0x00, "gpq0"),
771771
};
772772

773-
const struct samsung_pin_ctrl fsd_pin_ctrl[] __initconst = {
773+
static const struct samsung_pin_ctrl fsd_pin_ctrl[] __initconst = {
774774
{
775775
/* pin-controller instance 0 FSYS0 data */
776776
.pin_banks = fsd_pin_banks0,

drivers/pinctrl/stm32/pinctrl-stm32.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,21 @@ static void stm32_gpio_free(struct gpio_chip *chip, unsigned offset)
225225
pinctrl_gpio_free(chip->base + offset);
226226
}
227227

228+
static int stm32_gpio_get_noclk(struct gpio_chip *chip, unsigned int offset)
229+
{
230+
struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
231+
232+
return !!(readl_relaxed(bank->base + STM32_GPIO_IDR) & BIT(offset));
233+
}
234+
228235
static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)
229236
{
230237
struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
231238
int ret;
232239

233240
clk_enable(bank->clk);
234241

235-
ret = !!(readl_relaxed(bank->base + STM32_GPIO_IDR) & BIT(offset));
242+
ret = stm32_gpio_get_noclk(chip, offset);
236243

237244
clk_disable(bank->clk);
238245

@@ -311,8 +318,12 @@ static void stm32_gpio_irq_trigger(struct irq_data *d)
311318
struct stm32_gpio_bank *bank = d->domain->host_data;
312319
int level;
313320

321+
/* Do not access the GPIO if this is not LEVEL triggered IRQ. */
322+
if (!(bank->irq_type[d->hwirq] & IRQ_TYPE_LEVEL_MASK))
323+
return;
324+
314325
/* If level interrupt type then retrig */
315-
level = stm32_gpio_get(&bank->gpio_chip, d->hwirq);
326+
level = stm32_gpio_get_noclk(&bank->gpio_chip, d->hwirq);
316327
if ((level == 0 && bank->irq_type[d->hwirq] == IRQ_TYPE_LEVEL_LOW) ||
317328
(level == 1 && bank->irq_type[d->hwirq] == IRQ_TYPE_LEVEL_HIGH))
318329
irq_chip_retrigger_hierarchy(d);
@@ -354,6 +365,7 @@ static int stm32_gpio_irq_request_resources(struct irq_data *irq_data)
354365
{
355366
struct stm32_gpio_bank *bank = irq_data->domain->host_data;
356367
struct stm32_pinctrl *pctl = dev_get_drvdata(bank->gpio_chip.parent);
368+
unsigned long flags;
357369
int ret;
358370

359371
ret = stm32_gpio_direction_input(&bank->gpio_chip, irq_data->hwirq);
@@ -367,13 +379,20 @@ static int stm32_gpio_irq_request_resources(struct irq_data *irq_data)
367379
return ret;
368380
}
369381

382+
flags = irqd_get_trigger_type(irq_data);
383+
if (flags & IRQ_TYPE_LEVEL_MASK)
384+
clk_enable(bank->clk);
385+
370386
return 0;
371387
}
372388

373389
static void stm32_gpio_irq_release_resources(struct irq_data *irq_data)
374390
{
375391
struct stm32_gpio_bank *bank = irq_data->domain->host_data;
376392

393+
if (bank->irq_type[irq_data->hwirq] & IRQ_TYPE_LEVEL_MASK)
394+
clk_disable(bank->clk);
395+
377396
gpiochip_unlock_as_irq(&bank->gpio_chip, irq_data->hwirq);
378397
}
379398

0 commit comments

Comments
 (0)