Skip to content

Commit d4ac729

Browse files
ksk4725krzk
authored andcommitted
pinctrl: samsung: Add ARTPEC-8 SoC specific configuration
Add Axis ARTPEC-8 SoC specific configuration data to enable pinctrl. Signed-off-by: SeonGu Kang <ksk4725@coasia.com> Signed-off-by: Priyadarsini G <priya.ganesh@samsung.com> Signed-off-by: Ravi Patel <ravi.patel@samsung.com> Link: https://lore.kernel.org/r/20250901051926.59970-3-ravi.patel@samsung.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 03724b3 commit d4ac729

4 files changed

Lines changed: 63 additions & 0 deletions

File tree

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ static const struct samsung_pin_bank_type exynos8895_bank_type_off = {
7676
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, },
7777
};
7878

79+
/*
80+
* Bank type for non-alive type. Bit fields:
81+
* CON: 4, DAT: 1, PUD: 4, DRV: 4
82+
*/
83+
static const struct samsung_pin_bank_type artpec_bank_type_off = {
84+
.fld_width = { 4, 1, 4, 4, },
85+
.reg_offset = { 0x00, 0x04, 0x08, 0x0c, },
86+
};
87+
7988
/* Pad retention control code for accessing PMU regmap */
8089
static atomic_t exynos_shared_retention_refcnt;
8190

@@ -1816,3 +1825,44 @@ const struct samsung_pinctrl_of_match_data gs101_of_data __initconst = {
18161825
.ctrl = gs101_pin_ctrl,
18171826
.num_ctrl = ARRAY_SIZE(gs101_pin_ctrl),
18181827
};
1828+
1829+
/* pin banks of artpec8 pin-controller (FSYS0) */
1830+
static const struct samsung_pin_bank_data artpec8_pin_banks0[] __initconst = {
1831+
ARTPEC_PIN_BANK_EINTG(5, 0x000, "gpf0", 0x00),
1832+
ARTPEC_PIN_BANK_EINTG(4, 0x020, "gpf1", 0x04),
1833+
ARTPEC_PIN_BANK_EINTG(8, 0x040, "gpf2", 0x08),
1834+
ARTPEC_PIN_BANK_EINTG(4, 0x060, "gpf3", 0x0c),
1835+
ARTPEC_PIN_BANK_EINTG(7, 0x080, "gpf4", 0x10),
1836+
ARTPEC_PIN_BANK_EINTG(8, 0x0a0, "gpe0", 0x14),
1837+
ARTPEC_PIN_BANK_EINTG(8, 0x0c0, "gpe1", 0x18),
1838+
ARTPEC_PIN_BANK_EINTG(6, 0x0e0, "gpe2", 0x1c),
1839+
ARTPEC_PIN_BANK_EINTG(8, 0x100, "gps0", 0x20),
1840+
ARTPEC_PIN_BANK_EINTG(8, 0x120, "gps1", 0x24),
1841+
};
1842+
1843+
/* pin banks of artpec8 pin-controller (PERIC) */
1844+
static const struct samsung_pin_bank_data artpec8_pin_banks1[] __initconst = {
1845+
ARTPEC_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
1846+
ARTPEC_PIN_BANK_EINTG(8, 0x020, "gpa1", 0x04),
1847+
ARTPEC_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
1848+
ARTPEC_PIN_BANK_EINTG(2, 0x060, "gpk0", 0x0c),
1849+
};
1850+
1851+
static const struct samsung_pin_ctrl artpec8_pin_ctrl[] __initconst = {
1852+
{
1853+
/* pin-controller instance 0 FSYS data */
1854+
.pin_banks = artpec8_pin_banks0,
1855+
.nr_banks = ARRAY_SIZE(artpec8_pin_banks0),
1856+
.eint_gpio_init = exynos_eint_gpio_init,
1857+
}, {
1858+
/* pin-controller instance 1 PERIC data */
1859+
.pin_banks = artpec8_pin_banks1,
1860+
.nr_banks = ARRAY_SIZE(artpec8_pin_banks1),
1861+
.eint_gpio_init = exynos_eint_gpio_init,
1862+
},
1863+
};
1864+
1865+
const struct samsung_pinctrl_of_match_data artpec8_of_data __initconst = {
1866+
.ctrl = artpec8_pin_ctrl,
1867+
.num_ctrl = ARRAY_SIZE(artpec8_pin_ctrl),
1868+
};

drivers/pinctrl/samsung/pinctrl-exynos.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,16 @@
236236
.name = id \
237237
}
238238

239+
#define ARTPEC_PIN_BANK_EINTG(pins, reg, id, offs) \
240+
{ \
241+
.type = &artpec_bank_type_off, \
242+
.pctl_offset = reg, \
243+
.nr_pins = pins, \
244+
.eint_type = EINT_TYPE_GPIO, \
245+
.eint_offset = offs, \
246+
.name = id \
247+
}
248+
239249
/**
240250
* struct exynos_weint_data: irq specific data for all the wakeup interrupts
241251
* 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
@@ -1482,6 +1482,8 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
14821482
.data = &s5pv210_of_data },
14831483
#endif
14841484
#ifdef CONFIG_PINCTRL_EXYNOS_ARM64
1485+
{ .compatible = "axis,artpec8-pinctrl",
1486+
.data = &artpec8_of_data },
14851487
{ .compatible = "google,gs101-pinctrl",
14861488
.data = &gs101_of_data },
14871489
{ .compatible = "samsung,exynos2200-pinctrl",

drivers/pinctrl/samsung/pinctrl-samsung.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ struct samsung_pmx_func {
381381
};
382382

383383
/* list of all exported SoC specific data */
384+
extern const struct samsung_pinctrl_of_match_data artpec8_of_data;
384385
extern const struct samsung_pinctrl_of_match_data exynos2200_of_data;
385386
extern const struct samsung_pinctrl_of_match_data exynos3250_of_data;
386387
extern const struct samsung_pinctrl_of_match_data exynos4210_of_data;

0 commit comments

Comments
 (0)