Skip to content

Commit eb76dc9

Browse files
Kaustabh Chakrabortykrzk
authored andcommitted
pinctrl: samsung: add support for exynos7870 pinctrl
Add support for the Exynos7870 SoC pin-controller in the pinctrl driver. It has 8 GPIO banks, and 3-bit PINCFG_TYPE_DRV width. Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Link: https://lore.kernel.org/r/20250301-exynos7870-pinctrl-v3-3-ba1da9d3cd2f@disroot.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent c1ab229 commit eb76dc9

File tree

4 files changed

+161
-0
lines changed

4 files changed

+161
-0
lines changed

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

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ static const struct samsung_pin_bank_type exynos5433_bank_type_alive = {
4040
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
4141
};
4242

43+
/*
44+
* Bank type for alive type. Bit fields:
45+
* CON: 4, DAT: 1, PUD: 2, DRV: 3
46+
*/
47+
static const struct samsung_pin_bank_type exynos7870_bank_type_alive = {
48+
.fld_width = { 4, 1, 2, 3, },
49+
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
50+
};
51+
4352
/*
4453
* Bank type for non-alive type. Bit fields:
4554
* CON: 4, DAT: 1, PUD: 4, DRV: 4, CONPDN: 2, PUDPDN: 4
@@ -618,6 +627,136 @@ const struct samsung_pinctrl_of_match_data exynos7_of_data __initconst = {
618627
.num_ctrl = ARRAY_SIZE(exynos7_pin_ctrl),
619628
};
620629

630+
/* pin banks of exynos7870 pin-controller 0 (ALIVE) */
631+
static const struct samsung_pin_bank_data exynos7870_pin_banks0[] __initconst = {
632+
EXYNOS7870_PIN_BANK_EINTN(6, 0x000, "etc0"),
633+
EXYNOS7870_PIN_BANK_EINTN(3, 0x020, "etc1"),
634+
EXYNOS7870_PIN_BANK_EINTW(8, 0x040, "gpa0", 0x00),
635+
EXYNOS7870_PIN_BANK_EINTW(8, 0x060, "gpa1", 0x04),
636+
EXYNOS7870_PIN_BANK_EINTW(8, 0x080, "gpa2", 0x08),
637+
EXYNOS7870_PIN_BANK_EINTN(2, 0x0c0, "gpq0"),
638+
};
639+
640+
/* pin banks of exynos7870 pin-controller 1 (DISPAUD) */
641+
static const struct samsung_pin_bank_data exynos7870_pin_banks1[] __initconst = {
642+
EXYNOS8895_PIN_BANK_EINTG(4, 0x000, "gpz0", 0x00),
643+
EXYNOS8895_PIN_BANK_EINTG(6, 0x020, "gpz1", 0x04),
644+
EXYNOS8895_PIN_BANK_EINTG(4, 0x040, "gpz2", 0x08),
645+
};
646+
647+
/* pin banks of exynos7870 pin-controller 2 (ESE) */
648+
static const struct samsung_pin_bank_data exynos7870_pin_banks2[] __initconst = {
649+
EXYNOS8895_PIN_BANK_EINTG(5, 0x000, "gpc7", 0x00),
650+
};
651+
652+
/* pin banks of exynos7870 pin-controller 3 (FSYS) */
653+
static const struct samsung_pin_bank_data exynos7870_pin_banks3[] __initconst = {
654+
EXYNOS8895_PIN_BANK_EINTG(3, 0x000, "gpr0", 0x00),
655+
EXYNOS8895_PIN_BANK_EINTG(8, 0x020, "gpr1", 0x04),
656+
EXYNOS8895_PIN_BANK_EINTG(2, 0x040, "gpr2", 0x08),
657+
EXYNOS8895_PIN_BANK_EINTG(4, 0x060, "gpr3", 0x0c),
658+
EXYNOS8895_PIN_BANK_EINTG(6, 0x080, "gpr4", 0x10),
659+
};
660+
661+
/* pin banks of exynos7870 pin-controller 4 (MIF) */
662+
static const struct samsung_pin_bank_data exynos7870_pin_banks4[] __initconst = {
663+
EXYNOS8895_PIN_BANK_EINTG(2, 0x000, "gpm0", 0x00),
664+
};
665+
666+
/* pin banks of exynos7870 pin-controller 5 (NFC) */
667+
static const struct samsung_pin_bank_data exynos7870_pin_banks5[] __initconst = {
668+
EXYNOS8895_PIN_BANK_EINTG(4, 0x000, "gpc2", 0x00),
669+
};
670+
671+
/* pin banks of exynos7870 pin-controller 6 (TOP) */
672+
static const struct samsung_pin_bank_data exynos7870_pin_banks6[] __initconst = {
673+
EXYNOS8895_PIN_BANK_EINTG(4, 0x000, "gpb0", 0x00),
674+
EXYNOS8895_PIN_BANK_EINTG(3, 0x020, "gpc0", 0x04),
675+
EXYNOS8895_PIN_BANK_EINTG(4, 0x040, "gpc1", 0x08),
676+
EXYNOS8895_PIN_BANK_EINTG(4, 0x060, "gpc4", 0x0c),
677+
EXYNOS8895_PIN_BANK_EINTG(2, 0x080, "gpc5", 0x10),
678+
EXYNOS8895_PIN_BANK_EINTG(4, 0x0a0, "gpc6", 0x14),
679+
EXYNOS8895_PIN_BANK_EINTG(2, 0x0c0, "gpc8", 0x18),
680+
EXYNOS8895_PIN_BANK_EINTG(2, 0x0e0, "gpc9", 0x1c),
681+
EXYNOS8895_PIN_BANK_EINTG(7, 0x100, "gpd1", 0x20),
682+
EXYNOS8895_PIN_BANK_EINTG(6, 0x120, "gpd2", 0x24),
683+
EXYNOS8895_PIN_BANK_EINTG(8, 0x140, "gpd3", 0x28),
684+
EXYNOS8895_PIN_BANK_EINTG(7, 0x160, "gpd4", 0x2c),
685+
EXYNOS8895_PIN_BANK_EINTG(3, 0x1a0, "gpe0", 0x34),
686+
EXYNOS8895_PIN_BANK_EINTG(4, 0x1c0, "gpf0", 0x38),
687+
EXYNOS8895_PIN_BANK_EINTG(2, 0x1e0, "gpf1", 0x3c),
688+
EXYNOS8895_PIN_BANK_EINTG(2, 0x200, "gpf2", 0x40),
689+
EXYNOS8895_PIN_BANK_EINTG(4, 0x220, "gpf3", 0x44),
690+
EXYNOS8895_PIN_BANK_EINTG(5, 0x240, "gpf4", 0x48),
691+
};
692+
693+
/* pin banks of exynos7870 pin-controller 7 (TOUCH) */
694+
static const struct samsung_pin_bank_data exynos7870_pin_banks7[] __initconst = {
695+
EXYNOS8895_PIN_BANK_EINTG(3, 0x000, "gpc3", 0x00),
696+
};
697+
698+
static const struct samsung_pin_ctrl exynos7870_pin_ctrl[] __initconst = {
699+
{
700+
/* pin-controller instance 0 Alive data */
701+
.pin_banks = exynos7870_pin_banks0,
702+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks0),
703+
.eint_wkup_init = exynos_eint_wkup_init,
704+
.suspend = exynos_pinctrl_suspend,
705+
.resume = exynos_pinctrl_resume,
706+
}, {
707+
/* pin-controller instance 1 DISPAUD data */
708+
.pin_banks = exynos7870_pin_banks1,
709+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks1),
710+
}, {
711+
/* pin-controller instance 2 ESE data */
712+
.pin_banks = exynos7870_pin_banks2,
713+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks2),
714+
.eint_gpio_init = exynos_eint_gpio_init,
715+
.suspend = exynos_pinctrl_suspend,
716+
.resume = exynos_pinctrl_resume,
717+
}, {
718+
/* pin-controller instance 3 FSYS data */
719+
.pin_banks = exynos7870_pin_banks3,
720+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks3),
721+
.eint_gpio_init = exynos_eint_gpio_init,
722+
.suspend = exynos_pinctrl_suspend,
723+
.resume = exynos_pinctrl_resume,
724+
}, {
725+
/* pin-controller instance 4 MIF data */
726+
.pin_banks = exynos7870_pin_banks4,
727+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks4),
728+
.eint_gpio_init = exynos_eint_gpio_init,
729+
.suspend = exynos_pinctrl_suspend,
730+
.resume = exynos_pinctrl_resume,
731+
}, {
732+
/* pin-controller instance 5 NFC data */
733+
.pin_banks = exynos7870_pin_banks5,
734+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks5),
735+
.eint_gpio_init = exynos_eint_gpio_init,
736+
.suspend = exynos_pinctrl_suspend,
737+
.resume = exynos_pinctrl_resume,
738+
}, {
739+
/* pin-controller instance 6 TOP data */
740+
.pin_banks = exynos7870_pin_banks6,
741+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks6),
742+
.eint_gpio_init = exynos_eint_gpio_init,
743+
.suspend = exynos_pinctrl_suspend,
744+
.resume = exynos_pinctrl_resume,
745+
}, {
746+
/* pin-controller instance 7 TOUCH data */
747+
.pin_banks = exynos7870_pin_banks7,
748+
.nr_banks = ARRAY_SIZE(exynos7870_pin_banks7),
749+
.eint_gpio_init = exynos_eint_gpio_init,
750+
.suspend = exynos_pinctrl_suspend,
751+
.resume = exynos_pinctrl_resume,
752+
},
753+
};
754+
755+
const struct samsung_pinctrl_of_match_data exynos7870_of_data __initconst = {
756+
.ctrl = exynos7870_pin_ctrl,
757+
.num_ctrl = ARRAY_SIZE(exynos7870_pin_ctrl),
758+
};
759+
621760
/* pin banks of exynos7885 pin-controller 0 (ALIVE) */
622761
static const struct samsung_pin_bank_data exynos7885_pin_banks0[] __initconst = {
623762
EXYNOS_PIN_BANK_EINTN(3, 0x000, "etc0"),

drivers/pinctrl/samsung/pinctrl-exynos.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,25 @@
112112
.pctl_res_idx = pctl_idx, \
113113
} \
114114

115+
#define EXYNOS7870_PIN_BANK_EINTN(pins, reg, id) \
116+
{ \
117+
.type = &exynos7870_bank_type_alive, \
118+
.pctl_offset = reg, \
119+
.nr_pins = pins, \
120+
.eint_type = EINT_TYPE_NONE, \
121+
.name = id \
122+
}
123+
124+
#define EXYNOS7870_PIN_BANK_EINTW(pins, reg, id, offs) \
125+
{ \
126+
.type = &exynos7870_bank_type_alive, \
127+
.pctl_offset = reg, \
128+
.nr_pins = pins, \
129+
.eint_type = EINT_TYPE_WKUP, \
130+
.eint_offset = offs, \
131+
.name = id \
132+
}
133+
115134
#define EXYNOS850_PIN_BANK_EINTN(pins, reg, id) \
116135
{ \
117136
.type = &exynos850_bank_type_alive, \

drivers/pinctrl/samsung/pinctrl-samsung.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,8 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
14751475
.data = &exynos5433_of_data },
14761476
{ .compatible = "samsung,exynos7-pinctrl",
14771477
.data = &exynos7_of_data },
1478+
{ .compatible = "samsung,exynos7870-pinctrl",
1479+
.data = &exynos7870_of_data },
14781480
{ .compatible = "samsung,exynos7885-pinctrl",
14791481
.data = &exynos7885_of_data },
14801482
{ .compatible = "samsung,exynos850-pinctrl",

drivers/pinctrl/samsung/pinctrl-samsung.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ extern const struct samsung_pinctrl_of_match_data exynos5410_of_data;
383383
extern const struct samsung_pinctrl_of_match_data exynos5420_of_data;
384384
extern const struct samsung_pinctrl_of_match_data exynos5433_of_data;
385385
extern const struct samsung_pinctrl_of_match_data exynos7_of_data;
386+
extern const struct samsung_pinctrl_of_match_data exynos7870_of_data;
386387
extern const struct samsung_pinctrl_of_match_data exynos7885_of_data;
387388
extern const struct samsung_pinctrl_of_match_data exynos850_of_data;
388389
extern const struct samsung_pinctrl_of_match_data exynos8895_of_data;

0 commit comments

Comments
 (0)