Skip to content

Commit d4c34d0

Browse files
damien-lemoalpalmer-dabbelt
authored andcommitted
pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver
Add the pinctrl-k210.c pinctrl driver for the Canaan Kendryte K210 field programmable IO array (FPIOA) to allow configuring the SoC pin functions. The K210 has 48 programmable pins which can take any of 256 possible functions. This patch is inspired from the k210 pinctrl driver for the u-boot project and contains many direct contributions from Sean Anderson. The MAINTAINERS file is updated, adding the entry "CANAAN/KENDRYTE K210 SOC FPIOA DRIVER" with myself listed as maintainer for this driver. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: linux-gpio@vger.kernel.org Signed-off-by: Sean Anderson <seanga2@gmail.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent 5da9cbd commit d4c34d0

File tree

5 files changed

+1007
-0
lines changed

5 files changed

+1007
-0
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3860,6 +3860,13 @@ W: https://github.com/Cascoda/ca8210-linux.git
38603860
F: Documentation/devicetree/bindings/net/ieee802154/ca8210.txt
38613861
F: drivers/net/ieee802154/ca8210.c
38623862

3863+
CANAAN/KENDRYTE K210 SOC FPIOA DRIVER
3864+
M: Damien Le Moal <damien.lemoal@wdc.com>
3865+
L: linux-riscv@lists.infradead.org
3866+
L: linux-gpio@vger.kernel.org (pinctrl driver)
3867+
F: Documentation/devicetree/bindings/pinctrl/canaan,k210-fpioa.yaml
3868+
F: drivers/pinctrl/pinctrl-k210.c
3869+
38633870
CANAAN/KENDRYTE K210 SOC RESET CONTROLLER DRIVER
38643871
M: Damien Le Moal <damien.lemoal@wdc.com>
38653872
L: linux-kernel@vger.kernel.org

arch/riscv/Kconfig.socs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ config SOC_CANAAN
3030
select SERIAL_SIFIVE_CONSOLE if TTY
3131
select SIFIVE_PLIC
3232
select ARCH_HAS_RESET_CONTROLLER
33+
select PINCTRL
3334
help
3435
This enables support for Canaan Kendryte K210 SoC platform hardware.
3536

drivers/pinctrl/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,19 @@ config PINCTRL_MICROCHIP_SGPIO
394394
connect control signals from SFP modules and to act as an
395395
LED controller.
396396

397+
config PINCTRL_K210
398+
bool "Pinctrl driver for the Canaan Kendryte K210 SoC"
399+
depends on RISCV && SOC_CANAAN && OF
400+
select GENERIC_PINMUX_FUNCTIONS
401+
select GENERIC_PINCONF
402+
select GPIOLIB
403+
select OF_GPIO
404+
select REGMAP_MMIO
405+
default SOC_CANAAN
406+
help
407+
Add support for the Canaan Kendryte K210 RISC-V SOC Field
408+
Programmable IO Array (FPIOA) controller.
409+
397410
source "drivers/pinctrl/actions/Kconfig"
398411
source "drivers/pinctrl/aspeed/Kconfig"
399412
source "drivers/pinctrl/bcm/Kconfig"

drivers/pinctrl/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o
4848
obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o
4949
obj-$(CONFIG_PINCTRL_MICROCHIP_SGPIO) += pinctrl-microchip-sgpio.o
5050
obj-$(CONFIG_PINCTRL_EQUILIBRIUM) += pinctrl-equilibrium.o
51+
obj-$(CONFIG_PINCTRL_K210) += pinctrl-k210.o
5152

5253
obj-y += actions/
5354
obj-$(CONFIG_ARCH_ASPEED) += aspeed/

0 commit comments

Comments
 (0)