On 8/2/21 1:22 AM, Icenowy Zheng wrote: > Allwinner R320 SoC has a pin controller in the CPUS power domain. > > Add support for it. > > Signed-off-by: Icenowy Zheng <icenowy@xxxxxxxxxx> > --- > drivers/pinctrl/sunxi/Kconfig | 5 + > drivers/pinctrl/sunxi/Makefile | 1 + > drivers/pinctrl/sunxi/pinctrl-sun50i-r329-r.c | 292 ++++++++++++++++++ > 3 files changed, 298 insertions(+) > create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun50i-r329-r.c > > diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig > index c662e8b1b351..abd60ff8daec 100644 > --- a/drivers/pinctrl/sunxi/Kconfig > +++ b/drivers/pinctrl/sunxi/Kconfig > @@ -134,4 +134,9 @@ config PINCTRL_SUN50I_R329 > default ARM64 && ARCH_SUNXI > select PINCTRL_SUNXI > > +config PINCTRL_SUN50I_R329_R > + bool "Support for the Allwinner R329 R-PIO" > + default ARM64 && ARCH_SUNXI > + select PINCTRL_SUNXI > + > endif > diff --git a/drivers/pinctrl/sunxi/Makefile b/drivers/pinctrl/sunxi/Makefile > index e33f7c5f1ff9..245840a7959e 100644 > --- a/drivers/pinctrl/sunxi/Makefile > +++ b/drivers/pinctrl/sunxi/Makefile > @@ -26,5 +26,6 @@ obj-$(CONFIG_PINCTRL_SUN50I_H6_R) += pinctrl-sun50i-h6-r.o > obj-$(CONFIG_PINCTRL_SUN50I_H616) += pinctrl-sun50i-h616.o > obj-$(CONFIG_PINCTRL_SUN50I_H616_R) += pinctrl-sun50i-h616-r.o > obj-$(CONFIG_PINCTRL_SUN50I_R329) += pinctrl-sun50i-r329.o > +obj-$(CONFIG_PINCTRL_SUN50I_R329_R) += pinctrl-sun50i-r329-r.o > obj-$(CONFIG_PINCTRL_SUN9I_A80) += pinctrl-sun9i-a80.o > obj-$(CONFIG_PINCTRL_SUN9I_A80_R) += pinctrl-sun9i-a80-r.o > diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-r329-r.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-r329-r.c > new file mode 100644 > index 000000000000..dc4792c685ba > --- /dev/null > +++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-r329-r.c > @@ -0,0 +1,292 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Allwinner H616 R_PIO pin controller driver This needs to be updated. > + * > + * Copyright (C) 2020 Arm Ltd. > + * Based on former work, which is: > + * Copyright (C) 2017 Icenowy Zheng <icenowy@xxxxxxx> > + */ > + > +#include <linux/init.h> > +#include <linux/platform_device.h> > +#include <linux/of.h> > +#include <linux/of_device.h> > +#include <linux/pinctrl/pinctrl.h> > +#include <linux/reset.h> > + > +#include "pinctrl-sunxi.h" > + > +static const struct sunxi_desc_pin sun50i_r329_r_pins[] = { > + SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0), > + SUNXI_FUNCTION(0x0, "gpio_in"), > + SUNXI_FUNCTION(0x1, "gpio_out"), > + SUNXI_FUNCTION(0x2, "s_i2s"), /* LRCK */ "s_i2s0" for these would match existing drivers (and the manual). Everything else matches the manual. Regards, Samuel