Skip to content

Commit cdd3d94

Browse files
Sam Protsenkokrzk
authored andcommitted
pinctrl: samsung: Add Exynos850 SoC specific data
Add Samsung Exynos850 SoC specific data to enable pinctrl support for all platforms based on Exynos850. Signed-off-by: Sam Protsenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] [krzysztof: lower-case the hex-numbers] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 71b833b commit cdd3d94

File tree

4 files changed

+148
-0
lines changed

4 files changed

+148
-0
lines changed

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

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,24 @@ 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 non-alive type. Bit fields:
45+
* CON: 4, DAT: 1, PUD: 4, DRV: 4, CONPDN: 2, PUDPDN: 4
46+
*/
47+
static const struct samsung_pin_bank_type exynos850_bank_type_off = {
48+
.fld_width = { 4, 1, 4, 4, 2, 4, },
49+
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
50+
};
51+
52+
/*
53+
* Bank type for alive type. Bit fields:
54+
* CON: 4, DAT: 1, PUD: 4, DRV: 4
55+
*/
56+
static const struct samsung_pin_bank_type exynos850_bank_type_alive = {
57+
.fld_width = { 4, 1, 4, 4, },
58+
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
59+
};
60+
4361
/* Pad retention control code for accessing PMU regmap */
4462
static atomic_t exynos_shared_retention_refcnt;
4563

@@ -422,3 +440,101 @@ const struct samsung_pinctrl_of_match_data exynos7_of_data __initconst = {
422440
.ctrl = exynos7_pin_ctrl,
423441
.num_ctrl = ARRAY_SIZE(exynos7_pin_ctrl),
424442
};
443+
444+
/* pin banks of exynos850 pin-controller 0 (ALIVE) */
445+
static const struct samsung_pin_bank_data exynos850_pin_banks0[] __initconst = {
446+
/* Must start with EINTG banks, ordered by EINT group number. */
447+
EXYNOS850_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00),
448+
EXYNOS850_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04),
449+
EXYNOS850_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08),
450+
EXYNOS850_PIN_BANK_EINTW(8, 0x060, "gpa3", 0x0c),
451+
EXYNOS850_PIN_BANK_EINTW(4, 0x080, "gpa4", 0x10),
452+
EXYNOS850_PIN_BANK_EINTN(3, 0x0a0, "gpq0"),
453+
};
454+
455+
/* pin banks of exynos850 pin-controller 1 (CMGP) */
456+
static const struct samsung_pin_bank_data exynos850_pin_banks1[] __initconst = {
457+
/* Must start with EINTG banks, ordered by EINT group number. */
458+
EXYNOS850_PIN_BANK_EINTW(1, 0x000, "gpm0", 0x00),
459+
EXYNOS850_PIN_BANK_EINTW(1, 0x020, "gpm1", 0x04),
460+
EXYNOS850_PIN_BANK_EINTW(1, 0x040, "gpm2", 0x08),
461+
EXYNOS850_PIN_BANK_EINTW(1, 0x060, "gpm3", 0x0c),
462+
EXYNOS850_PIN_BANK_EINTW(1, 0x080, "gpm4", 0x10),
463+
EXYNOS850_PIN_BANK_EINTW(1, 0x0a0, "gpm5", 0x14),
464+
EXYNOS850_PIN_BANK_EINTW(1, 0x0c0, "gpm6", 0x18),
465+
EXYNOS850_PIN_BANK_EINTW(1, 0x0e0, "gpm7", 0x1c),
466+
};
467+
468+
/* pin banks of exynos850 pin-controller 2 (AUD) */
469+
static const struct samsung_pin_bank_data exynos850_pin_banks2[] __initconst = {
470+
/* Must start with EINTG banks, ordered by EINT group number. */
471+
EXYNOS850_PIN_BANK_EINTG(5, 0x000, "gpb0", 0x00),
472+
EXYNOS850_PIN_BANK_EINTG(5, 0x020, "gpb1", 0x04),
473+
};
474+
475+
/* pin banks of exynos850 pin-controller 3 (HSI) */
476+
static const struct samsung_pin_bank_data exynos850_pin_banks3[] __initconst = {
477+
/* Must start with EINTG banks, ordered by EINT group number. */
478+
EXYNOS850_PIN_BANK_EINTG(6, 0x000, "gpf2", 0x00),
479+
};
480+
481+
/* pin banks of exynos850 pin-controller 4 (CORE) */
482+
static const struct samsung_pin_bank_data exynos850_pin_banks4[] __initconst = {
483+
/* Must start with EINTG banks, ordered by EINT group number. */
484+
EXYNOS850_PIN_BANK_EINTG(4, 0x000, "gpf0", 0x00),
485+
EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpf1", 0x04),
486+
};
487+
488+
/* pin banks of exynos850 pin-controller 5 (PERI) */
489+
static const struct samsung_pin_bank_data exynos850_pin_banks5[] __initconst = {
490+
/* Must start with EINTG banks, ordered by EINT group number. */
491+
EXYNOS850_PIN_BANK_EINTG(2, 0x000, "gpg0", 0x00),
492+
EXYNOS850_PIN_BANK_EINTG(6, 0x020, "gpp0", 0x04),
493+
EXYNOS850_PIN_BANK_EINTG(4, 0x040, "gpp1", 0x08),
494+
EXYNOS850_PIN_BANK_EINTG(4, 0x060, "gpp2", 0x0c),
495+
EXYNOS850_PIN_BANK_EINTG(8, 0x080, "gpg1", 0x10),
496+
EXYNOS850_PIN_BANK_EINTG(8, 0x0a0, "gpg2", 0x14),
497+
EXYNOS850_PIN_BANK_EINTG(1, 0x0c0, "gpg3", 0x18),
498+
EXYNOS850_PIN_BANK_EINTG(3, 0x0e0, "gpc0", 0x1c),
499+
EXYNOS850_PIN_BANK_EINTG(6, 0x100, "gpc1", 0x20),
500+
};
501+
502+
static const struct samsung_pin_ctrl exynos850_pin_ctrl[] __initconst = {
503+
{
504+
/* pin-controller instance 0 ALIVE data */
505+
.pin_banks = exynos850_pin_banks0,
506+
.nr_banks = ARRAY_SIZE(exynos850_pin_banks0),
507+
.eint_gpio_init = exynos_eint_gpio_init,
508+
.eint_wkup_init = exynos_eint_wkup_init,
509+
}, {
510+
/* pin-controller instance 1 CMGP data */
511+
.pin_banks = exynos850_pin_banks1,
512+
.nr_banks = ARRAY_SIZE(exynos850_pin_banks1),
513+
.eint_gpio_init = exynos_eint_gpio_init,
514+
.eint_wkup_init = exynos_eint_wkup_init,
515+
}, {
516+
/* pin-controller instance 2 AUD data */
517+
.pin_banks = exynos850_pin_banks2,
518+
.nr_banks = ARRAY_SIZE(exynos850_pin_banks2),
519+
}, {
520+
/* pin-controller instance 3 HSI data */
521+
.pin_banks = exynos850_pin_banks3,
522+
.nr_banks = ARRAY_SIZE(exynos850_pin_banks3),
523+
.eint_gpio_init = exynos_eint_gpio_init,
524+
}, {
525+
/* pin-controller instance 4 CORE data */
526+
.pin_banks = exynos850_pin_banks4,
527+
.nr_banks = ARRAY_SIZE(exynos850_pin_banks4),
528+
.eint_gpio_init = exynos_eint_gpio_init,
529+
}, {
530+
/* pin-controller instance 5 PERI data */
531+
.pin_banks = exynos850_pin_banks5,
532+
.nr_banks = ARRAY_SIZE(exynos850_pin_banks5),
533+
.eint_gpio_init = exynos_eint_gpio_init,
534+
},
535+
};
536+
537+
const struct samsung_pinctrl_of_match_data exynos850_of_data __initconst = {
538+
.ctrl = exynos850_pin_ctrl,
539+
.num_ctrl = ARRAY_SIZE(exynos850_pin_ctrl),
540+
};

drivers/pinctrl/samsung/pinctrl-exynos.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,35 @@
108108
.pctl_res_idx = pctl_idx, \
109109
} \
110110

111+
#define EXYNOS850_PIN_BANK_EINTN(pins, reg, id) \
112+
{ \
113+
.type = &exynos850_bank_type_alive, \
114+
.pctl_offset = reg, \
115+
.nr_pins = pins, \
116+
.eint_type = EINT_TYPE_NONE, \
117+
.name = id \
118+
}
119+
120+
#define EXYNOS850_PIN_BANK_EINTG(pins, reg, id, offs) \
121+
{ \
122+
.type = &exynos850_bank_type_off, \
123+
.pctl_offset = reg, \
124+
.nr_pins = pins, \
125+
.eint_type = EINT_TYPE_GPIO, \
126+
.eint_offset = offs, \
127+
.name = id \
128+
}
129+
130+
#define EXYNOS850_PIN_BANK_EINTW(pins, reg, id, offs) \
131+
{ \
132+
.type = &exynos850_bank_type_alive, \
133+
.pctl_offset = reg, \
134+
.nr_pins = pins, \
135+
.eint_type = EINT_TYPE_WKUP, \
136+
.eint_offset = offs, \
137+
.name = id \
138+
}
139+
111140
/**
112141
* struct exynos_weint_data: irq specific data for all the wakeup interrupts
113142
* generated by the external wakeup interrupt controller.

drivers/pinctrl/samsung/pinctrl-samsung.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,8 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
12641264
.data = &exynos5433_of_data },
12651265
{ .compatible = "samsung,exynos7-pinctrl",
12661266
.data = &exynos7_of_data },
1267+
{ .compatible = "samsung,exynos850-pinctrl",
1268+
.data = &exynos850_of_data },
12671269
#endif
12681270
#ifdef CONFIG_PINCTRL_S3C64XX
12691271
{ .compatible = "samsung,s3c64xx-pinctrl",

drivers/pinctrl/samsung/pinctrl-samsung.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ extern const struct samsung_pinctrl_of_match_data exynos5410_of_data;
339339
extern const struct samsung_pinctrl_of_match_data exynos5420_of_data;
340340
extern const struct samsung_pinctrl_of_match_data exynos5433_of_data;
341341
extern const struct samsung_pinctrl_of_match_data exynos7_of_data;
342+
extern const struct samsung_pinctrl_of_match_data exynos850_of_data;
342343
extern const struct samsung_pinctrl_of_match_data s3c64xx_of_data;
343344
extern const struct samsung_pinctrl_of_match_data s3c2412_of_data;
344345
extern const struct samsung_pinctrl_of_match_data s3c2416_of_data;

0 commit comments

Comments
 (0)