Skip to content

Commit eed2e79

Browse files
ivoszbgkrzk
authored andcommitted
pinctrl: samsung: Add exynos8895 SoC pinctrl configuration
Add support for the pin-controller found on the Exynos8895 SoC used in Samsung Galaxy S8 and S8 Plus phones. It has a newly applied pinctrl register layer for FSYS0 with a different bank type offset that consists of the following bit fields: CON: 4, DAT: 1, PUD: 2, DRV: 3, CONPDN: 2, PUDPDN: 2 Signed-off-by: Ivaylo Ivanov <[email protected]> Reviewed-by: Sam Protsenko <[email protected]> Acked-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent e2d58d1 commit eed2e79

File tree

4 files changed

+150
-0
lines changed

4 files changed

+150
-0
lines changed

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

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ static const struct samsung_pin_bank_type exynos850_bank_type_alive = {
5858
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
5959
};
6060

61+
/*
62+
* Bank type for non-alive type. Bit fields:
63+
* CON: 4, DAT: 1, PUD: 2, DRV: 3, CONPDN: 2, PUDPDN: 2
64+
*/
65+
static const struct samsung_pin_bank_type exynos8895_bank_type_off = {
66+
.fld_width = { 4, 1, 2, 3, 2, 2, },
67+
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
68+
};
69+
6170
/* Pad retention control code for accessing PMU regmap */
6271
static atomic_t exynos_shared_retention_refcnt;
6372

@@ -866,6 +875,134 @@ const struct samsung_pinctrl_of_match_data exynosautov920_of_data __initconst =
866875
.num_ctrl = ARRAY_SIZE(exynosautov920_pin_ctrl),
867876
};
868877

878+
/* pin banks of exynos8895 pin-controller 0 (ALIVE) */
879+
static const struct samsung_pin_bank_data exynos8895_pin_banks0[] __initconst = {
880+
EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa0", 0x00),
881+
EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa1", 0x04),
882+
EXYNOS_PIN_BANK_EINTW(8, 0x060, "gpa2", 0x08),
883+
EXYNOS_PIN_BANK_EINTW(8, 0x080, "gpa3", 0x0c),
884+
EXYNOS_PIN_BANK_EINTW(7, 0x0a0, "gpa4", 0x24),
885+
};
886+
887+
/* pin banks of exynos8895 pin-controller 1 (ABOX) */
888+
static const struct samsung_pin_bank_data exynos8895_pin_banks1[] __initconst = {
889+
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gph0", 0x00),
890+
EXYNOS_PIN_BANK_EINTG(7, 0x020, "gph1", 0x04),
891+
EXYNOS_PIN_BANK_EINTG(4, 0x040, "gph3", 0x08),
892+
};
893+
894+
/* pin banks of exynos8895 pin-controller 2 (VTS) */
895+
static const struct samsung_pin_bank_data exynos8895_pin_banks2[] __initconst = {
896+
EXYNOS_PIN_BANK_EINTG(3, 0x000, "gph2", 0x00),
897+
};
898+
899+
/* pin banks of exynos8895 pin-controller 3 (FSYS0) */
900+
static const struct samsung_pin_bank_data exynos8895_pin_banks3[] __initconst = {
901+
EXYNOS8895_PIN_BANK_EINTG(3, 0x000, "gpi0", 0x00),
902+
EXYNOS8895_PIN_BANK_EINTG(8, 0x020, "gpi1", 0x04),
903+
};
904+
905+
/* pin banks of exynos8895 pin-controller 4 (FSYS1) */
906+
static const struct samsung_pin_bank_data exynos8895_pin_banks4[] __initconst = {
907+
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj1", 0x00),
908+
EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpj0", 0x04),
909+
};
910+
911+
/* pin banks of exynos8895 pin-controller 5 (BUSC) */
912+
static const struct samsung_pin_bank_data exynos8895_pin_banks5[] __initconst = {
913+
EXYNOS_PIN_BANK_EINTG(2, 0x000, "gpb2", 0x00),
914+
};
915+
916+
/* pin banks of exynos8895 pin-controller 6 (PERIC0) */
917+
static const struct samsung_pin_bank_data exynos8895_pin_banks6[] __initconst = {
918+
EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpd0", 0x00),
919+
EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpd1", 0x04),
920+
EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpd2", 0x08),
921+
EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpd3", 0x0C),
922+
EXYNOS_PIN_BANK_EINTG(4, 0x080, "gpb1", 0x10),
923+
EXYNOS_PIN_BANK_EINTG(8, 0x0a0, "gpe7", 0x14),
924+
EXYNOS_PIN_BANK_EINTG(8, 0x0c0, "gpf1", 0x18),
925+
};
926+
927+
/* pin banks of exynos8895 pin-controller 7 (PERIC1) */
928+
static const struct samsung_pin_bank_data exynos8895_pin_banks7[] __initconst = {
929+
EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpb0", 0x00),
930+
EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpc0", 0x04),
931+
EXYNOS_PIN_BANK_EINTG(5, 0x040, "gpc1", 0x08),
932+
EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpc2", 0x0C),
933+
EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpc3", 0x10),
934+
EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpk0", 0x14),
935+
EXYNOS_PIN_BANK_EINTG(8, 0x0c0, "gpe5", 0x18),
936+
EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe6", 0x1C),
937+
EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe2", 0x20),
938+
EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpe3", 0x24),
939+
EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpe4", 0x28),
940+
EXYNOS_PIN_BANK_EINTG(4, 0x160, "gpf0", 0x2C),
941+
EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpe1", 0x30),
942+
EXYNOS_PIN_BANK_EINTG(2, 0x1a0, "gpg0", 0x34),
943+
};
944+
945+
static const struct samsung_pin_ctrl exynos8895_pin_ctrl[] __initconst = {
946+
{
947+
/* pin-controller instance 0 ALIVE data */
948+
.pin_banks = exynos8895_pin_banks0,
949+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks0),
950+
.eint_gpio_init = exynos_eint_gpio_init,
951+
.eint_wkup_init = exynos_eint_wkup_init,
952+
.suspend = exynos_pinctrl_suspend,
953+
.resume = exynos_pinctrl_resume,
954+
}, {
955+
/* pin-controller instance 1 ABOX data */
956+
.pin_banks = exynos8895_pin_banks1,
957+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks1),
958+
}, {
959+
/* pin-controller instance 2 VTS data */
960+
.pin_banks = exynos8895_pin_banks2,
961+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks2),
962+
.eint_gpio_init = exynos_eint_gpio_init,
963+
}, {
964+
/* pin-controller instance 3 FSYS0 data */
965+
.pin_banks = exynos8895_pin_banks3,
966+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks3),
967+
.eint_gpio_init = exynos_eint_gpio_init,
968+
.suspend = exynos_pinctrl_suspend,
969+
.resume = exynos_pinctrl_resume,
970+
}, {
971+
/* pin-controller instance 4 FSYS1 data */
972+
.pin_banks = exynos8895_pin_banks4,
973+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks4),
974+
.eint_gpio_init = exynos_eint_gpio_init,
975+
.suspend = exynos_pinctrl_suspend,
976+
.resume = exynos_pinctrl_resume,
977+
}, {
978+
/* pin-controller instance 5 BUSC data */
979+
.pin_banks = exynos8895_pin_banks5,
980+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks5),
981+
.eint_gpio_init = exynos_eint_gpio_init,
982+
.suspend = exynos_pinctrl_suspend,
983+
.resume = exynos_pinctrl_resume,
984+
}, {
985+
/* pin-controller instance 6 PERIC0 data */
986+
.pin_banks = exynos8895_pin_banks6,
987+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks6),
988+
.eint_gpio_init = exynos_eint_gpio_init,
989+
.suspend = exynos_pinctrl_suspend,
990+
.resume = exynos_pinctrl_resume,
991+
}, {
992+
/* pin-controller instance 7 PERIC1 data */
993+
.pin_banks = exynos8895_pin_banks7,
994+
.nr_banks = ARRAY_SIZE(exynos8895_pin_banks7),
995+
.eint_gpio_init = exynos_eint_gpio_init,
996+
.suspend = exynos_pinctrl_suspend,
997+
.resume = exynos_pinctrl_resume,
998+
},
999+
};
1000+
1001+
const struct samsung_pinctrl_of_match_data exynos8895_of_data __initconst = {
1002+
.ctrl = exynos8895_pin_ctrl,
1003+
.num_ctrl = ARRAY_SIZE(exynos8895_pin_ctrl),
1004+
};
1005+
8691006
/*
8701007
* Pinctrl driver data for Tesla FSD SoC. FSD SoC includes three
8711008
* gpio/pin-mux/pinconfig controllers.

drivers/pinctrl/samsung/pinctrl-exynos.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@
141141
.name = id \
142142
}
143143

144+
#define EXYNOS8895_PIN_BANK_EINTG(pins, reg, id, offs) \
145+
{ \
146+
.type = &exynos8895_bank_type_off, \
147+
.pctl_offset = reg, \
148+
.nr_pins = pins, \
149+
.eint_type = EINT_TYPE_GPIO, \
150+
.eint_offset = offs, \
151+
.name = id \
152+
}
153+
144154
#define EXYNOSV920_PIN_BANK_EINTG(pins, reg, id, con_offs, mask_offs, pend_offs) \
145155
{ \
146156
.type = &exynos850_bank_type_off, \

drivers/pinctrl/samsung/pinctrl-samsung.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,8 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
14771477
.data = &exynos7885_of_data },
14781478
{ .compatible = "samsung,exynos850-pinctrl",
14791479
.data = &exynos850_of_data },
1480+
{ .compatible = "samsung,exynos8895-pinctrl",
1481+
.data = &exynos8895_of_data },
14801482
{ .compatible = "samsung,exynosautov9-pinctrl",
14811483
.data = &exynosautov9_of_data },
14821484
{ .compatible = "samsung,exynosautov920-pinctrl",

drivers/pinctrl/samsung/pinctrl-samsung.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ extern const struct samsung_pinctrl_of_match_data exynos5433_of_data;
384384
extern const struct samsung_pinctrl_of_match_data exynos7_of_data;
385385
extern const struct samsung_pinctrl_of_match_data exynos7885_of_data;
386386
extern const struct samsung_pinctrl_of_match_data exynos850_of_data;
387+
extern const struct samsung_pinctrl_of_match_data exynos8895_of_data;
387388
extern const struct samsung_pinctrl_of_match_data exynosautov9_of_data;
388389
extern const struct samsung_pinctrl_of_match_data exynosautov920_of_data;
389390
extern const struct samsung_pinctrl_of_match_data fsd_of_data;

0 commit comments

Comments
 (0)