Skip to content

Commit d6ed935

Browse files
moore-broslinusw
authored andcommitted
pinctrl: mediatek: add pinctrl driver for MT7622 SoC
Add support for pinctrl on MT7622 SoC. The IO core found on the SoC has the registers for pinctrl, pinconf and gpio mixed up in the same register range. However, the IO core for the MT7622 SoC is completely distinct from anyone of previous MediaTek SoCs which already had support, such as the hardware internal, register address map and register detailed definition for each pin. Therefore, instead, the driver is being newly implemented by reusing generic methods provided from the core layer with GENERIC_PINCONF, GENERIC_PINCTRL_GROUPS, and GENERIC_PINMUX_FUNCTIONS for the sake of code simplicity and rid of superfluous code. Where the function of pins determined by groups is utilized in this driver which can help developers less confused with what combinations of pins effective on the SoC and even reducing the mistakes during the integration of those relevant boards. As the gpio_chip handling is also only a few lines, the driver also implements the gpio functionality directly through GPIOLIB. Signed-off-by: Sean Wang <[email protected]> Reviewed-by: Biao Huang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent e3fd24a commit d6ed935

File tree

4 files changed

+1608
-2
lines changed

4 files changed

+1608
-2
lines changed

drivers/pinctrl/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ obj-$(CONFIG_PINCTRL_SUNXI) += sunxi/
6565
obj-y += ti/
6666
obj-$(CONFIG_PINCTRL_UNIPHIER) += uniphier/
6767
obj-$(CONFIG_ARCH_VT8500) += vt8500/
68-
obj-$(CONFIG_PINCTRL_MTK) += mediatek/
68+
obj-y += mediatek/
6969
obj-$(CONFIG_PINCTRL_ZX) += zte/

drivers/pinctrl/mediatek/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ config PINCTRL_MT8127
3232
select PINCTRL_MTK
3333

3434
# For ARMv8 SoCs
35+
config PINCTRL_MT7622
36+
bool "MediaTek MT7622 pin control"
37+
depends on OF
38+
depends on ARM64 || COMPILE_TEST
39+
select GENERIC_PINCONF
40+
select GENERIC_PINCTRL_GROUPS
41+
select GENERIC_PINMUX_FUNCTIONS
42+
select GPIOLIB
43+
select OF_GPIO
44+
3545
config PINCTRL_MT8173
3646
bool "Mediatek MT8173 pin control"
3747
depends on OF

drivers/pinctrl/mediatek/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Core
3-
obj-y += pinctrl-mtk-common.o
3+
obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o
44

55
# SoC Drivers
66
obj-$(CONFIG_PINCTRL_MT2701) += pinctrl-mt2701.o
77
obj-$(CONFIG_PINCTRL_MT8135) += pinctrl-mt8135.o
88
obj-$(CONFIG_PINCTRL_MT8127) += pinctrl-mt8127.o
9+
obj-$(CONFIG_PINCTRL_MT7622) += pinctrl-mt7622.o
910
obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o
1011
obj-$(CONFIG_PINCTRL_MT6397) += pinctrl-mt6397.o

0 commit comments

Comments
 (0)