1

pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver

Add common pinctrl and GPIO driver for Nuvoton MA35 series SoC, and
add support for ma35d1 pinctrl.

Signed-off-by: Jacky Huang <ychuang3@nuvoton.com>
Link: https://lore.kernel.org/r/20240521012447.42211-4-ychuang570808@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Jacky Huang 2024-05-21 01:24:47 +00:00 committed by Linus Walleij
parent 63f1f9da45
commit f805e35631
5 changed files with 3059 additions and 0 deletions

View File

@ -45,3 +45,22 @@ config PINCTRL_NPCM8XX
Say Y or M here to enable pin controller and GPIO support for
the Nuvoton NPCM8XX SoC. This is strongly recommended when
building a kernel that will run on this chip.
config PINCTRL_MA35
bool
depends on (ARCH_MA35 || COMPILE_TEST) && OF
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
select GENERIC_PINCONF
select GPIOLIB
select GPIO_GENERIC
select GPIOLIB_IRQCHIP
select MFD_SYSCON
config PINCTRL_MA35D1
bool "Pinctrl and GPIO driver for Nuvoton MA35D1"
depends on (ARCH_MA35 || COMPILE_TEST) && OF
select PINCTRL_MA35
help
Say Y here to enable pin controller and GPIO support
for Nuvoton MA35D1 SoC.

View File

@ -4,3 +4,5 @@
obj-$(CONFIG_PINCTRL_WPCM450) += pinctrl-wpcm450.o
obj-$(CONFIG_PINCTRL_NPCM7XX) += pinctrl-npcm7xx.o
obj-$(CONFIG_PINCTRL_NPCM8XX) += pinctrl-npcm8xx.o
obj-$(CONFIG_PINCTRL_MA35) += pinctrl-ma35.o
obj-$(CONFIG_PINCTRL_MA35D1) += pinctrl-ma35d1.o

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2024 Nuvoton Technology Corp.
*
* Author: Shan-Chun Hung <schung@nuvoton.com>
* * Jacky Huang <ychuang3@nuvoton.com>
*/
#ifndef __PINCTRL_MA35_H
#define __PINCTRL_MA35_H
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
struct ma35_mux_desc {
const char *name;
u32 muxval;
};
struct ma35_pin_data {
u32 offset;
u32 shift;
struct ma35_mux_desc *muxes;
};
struct ma35_pinctrl_soc_info {
const struct pinctrl_pin_desc *pins;
unsigned int npins;
int (*get_pin_num)(int offset, int shift);
};
#define MA35_PIN(num, n, o, s, ...) { \
.number = num, \
.name = #n, \
.drv_data = &(struct ma35_pin_data) { \
.offset = o, \
.shift = s, \
.muxes = (struct ma35_mux_desc[]) { \
__VA_ARGS__, { } }, \
}, \
}
#define MA35_MUX(_val, _name) { \
.name = _name, \
.muxval = _val, \
}
int ma35_pinctrl_probe(struct platform_device *pdev, const struct ma35_pinctrl_soc_info *info);
int ma35_pinctrl_suspend(struct device *dev);
int ma35_pinctrl_resume(struct device *dev);
#endif /* __PINCTRL_MA35_H */

File diff suppressed because it is too large Load Diff