162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * PIC32 pinctrl driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Joshua Henderson, <joshua.henderson@microchip.com>
662306a36Sopenharmony_ci * Copyright (C) 2015 Microchip Technology Inc.  All rights reserved.
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci#include <linux/clk.h>
962306a36Sopenharmony_ci#include <linux/gpio/driver.h>
1062306a36Sopenharmony_ci#include <linux/interrupt.h>
1162306a36Sopenharmony_ci#include <linux/io.h>
1262306a36Sopenharmony_ci#include <linux/irq.h>
1362306a36Sopenharmony_ci#include <linux/of.h>
1462306a36Sopenharmony_ci#include <linux/pinctrl/pinconf.h>
1562306a36Sopenharmony_ci#include <linux/pinctrl/pinconf-generic.h>
1662306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
1762306a36Sopenharmony_ci#include <linux/pinctrl/pinmux.h>
1862306a36Sopenharmony_ci#include <linux/platform_device.h>
1962306a36Sopenharmony_ci#include <linux/seq_file.h>
2062306a36Sopenharmony_ci#include <linux/slab.h>
2162306a36Sopenharmony_ci#include <linux/spinlock.h>
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#include <asm/mach-pic32/pic32.h>
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#include "pinctrl-utils.h"
2662306a36Sopenharmony_ci#include "pinctrl-pic32.h"
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define PINS_PER_BANK		16
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#define PIC32_CNCON_EDGE	11
3162306a36Sopenharmony_ci#define PIC32_CNCON_ON		15
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#define PIN_CONFIG_MICROCHIP_DIGITAL	(PIN_CONFIG_END + 1)
3462306a36Sopenharmony_ci#define PIN_CONFIG_MICROCHIP_ANALOG	(PIN_CONFIG_END + 2)
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_cistatic const struct pinconf_generic_params pic32_mpp_bindings[] = {
3762306a36Sopenharmony_ci	{"microchip,digital",	PIN_CONFIG_MICROCHIP_DIGITAL,	0},
3862306a36Sopenharmony_ci	{"microchip,analog",	PIN_CONFIG_MICROCHIP_ANALOG,	0},
3962306a36Sopenharmony_ci};
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define GPIO_BANK_START(bank)		((bank) * PINS_PER_BANK)
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_cistruct pic32_function {
4462306a36Sopenharmony_ci	const char *name;
4562306a36Sopenharmony_ci	const char * const *groups;
4662306a36Sopenharmony_ci	unsigned int ngroups;
4762306a36Sopenharmony_ci};
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_cistruct pic32_pin_group {
5062306a36Sopenharmony_ci	const char *name;
5162306a36Sopenharmony_ci	unsigned int pin;
5262306a36Sopenharmony_ci	struct pic32_desc_function *functions;
5362306a36Sopenharmony_ci};
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_cistruct pic32_desc_function {
5662306a36Sopenharmony_ci	const char *name;
5762306a36Sopenharmony_ci	u32 muxreg;
5862306a36Sopenharmony_ci	u32 muxval;
5962306a36Sopenharmony_ci};
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_cistruct pic32_gpio_bank {
6262306a36Sopenharmony_ci	void __iomem *reg_base;
6362306a36Sopenharmony_ci	int instance;
6462306a36Sopenharmony_ci	struct gpio_chip gpio_chip;
6562306a36Sopenharmony_ci	struct clk *clk;
6662306a36Sopenharmony_ci};
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_cistruct pic32_pinctrl {
6962306a36Sopenharmony_ci	void __iomem *reg_base;
7062306a36Sopenharmony_ci	struct device *dev;
7162306a36Sopenharmony_ci	struct pinctrl_dev *pctldev;
7262306a36Sopenharmony_ci	const struct pinctrl_pin_desc *pins;
7362306a36Sopenharmony_ci	unsigned int npins;
7462306a36Sopenharmony_ci	const struct pic32_function *functions;
7562306a36Sopenharmony_ci	unsigned int nfunctions;
7662306a36Sopenharmony_ci	const struct pic32_pin_group *groups;
7762306a36Sopenharmony_ci	unsigned int ngroups;
7862306a36Sopenharmony_ci	struct pic32_gpio_bank *gpio_banks;
7962306a36Sopenharmony_ci	unsigned int nbanks;
8062306a36Sopenharmony_ci	struct clk *clk;
8162306a36Sopenharmony_ci};
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_cistatic const struct pinctrl_pin_desc pic32_pins[] = {
8462306a36Sopenharmony_ci	PINCTRL_PIN(0, "A0"),
8562306a36Sopenharmony_ci	PINCTRL_PIN(1, "A1"),
8662306a36Sopenharmony_ci	PINCTRL_PIN(2, "A2"),
8762306a36Sopenharmony_ci	PINCTRL_PIN(3, "A3"),
8862306a36Sopenharmony_ci	PINCTRL_PIN(4, "A4"),
8962306a36Sopenharmony_ci	PINCTRL_PIN(5, "A5"),
9062306a36Sopenharmony_ci	PINCTRL_PIN(6, "A6"),
9162306a36Sopenharmony_ci	PINCTRL_PIN(7, "A7"),
9262306a36Sopenharmony_ci	PINCTRL_PIN(8, "A8"),
9362306a36Sopenharmony_ci	PINCTRL_PIN(9, "A9"),
9462306a36Sopenharmony_ci	PINCTRL_PIN(10, "A10"),
9562306a36Sopenharmony_ci	PINCTRL_PIN(11, "A11"),
9662306a36Sopenharmony_ci	PINCTRL_PIN(12, "A12"),
9762306a36Sopenharmony_ci	PINCTRL_PIN(13, "A13"),
9862306a36Sopenharmony_ci	PINCTRL_PIN(14, "A14"),
9962306a36Sopenharmony_ci	PINCTRL_PIN(15, "A15"),
10062306a36Sopenharmony_ci	PINCTRL_PIN(16, "B0"),
10162306a36Sopenharmony_ci	PINCTRL_PIN(17, "B1"),
10262306a36Sopenharmony_ci	PINCTRL_PIN(18, "B2"),
10362306a36Sopenharmony_ci	PINCTRL_PIN(19, "B3"),
10462306a36Sopenharmony_ci	PINCTRL_PIN(20, "B4"),
10562306a36Sopenharmony_ci	PINCTRL_PIN(21, "B5"),
10662306a36Sopenharmony_ci	PINCTRL_PIN(22, "B6"),
10762306a36Sopenharmony_ci	PINCTRL_PIN(23, "B7"),
10862306a36Sopenharmony_ci	PINCTRL_PIN(24, "B8"),
10962306a36Sopenharmony_ci	PINCTRL_PIN(25, "B9"),
11062306a36Sopenharmony_ci	PINCTRL_PIN(26, "B10"),
11162306a36Sopenharmony_ci	PINCTRL_PIN(27, "B11"),
11262306a36Sopenharmony_ci	PINCTRL_PIN(28, "B12"),
11362306a36Sopenharmony_ci	PINCTRL_PIN(29, "B13"),
11462306a36Sopenharmony_ci	PINCTRL_PIN(30, "B14"),
11562306a36Sopenharmony_ci	PINCTRL_PIN(31, "B15"),
11662306a36Sopenharmony_ci	PINCTRL_PIN(33, "C1"),
11762306a36Sopenharmony_ci	PINCTRL_PIN(34, "C2"),
11862306a36Sopenharmony_ci	PINCTRL_PIN(35, "C3"),
11962306a36Sopenharmony_ci	PINCTRL_PIN(36, "C4"),
12062306a36Sopenharmony_ci	PINCTRL_PIN(44, "C12"),
12162306a36Sopenharmony_ci	PINCTRL_PIN(45, "C13"),
12262306a36Sopenharmony_ci	PINCTRL_PIN(46, "C14"),
12362306a36Sopenharmony_ci	PINCTRL_PIN(47, "C15"),
12462306a36Sopenharmony_ci	PINCTRL_PIN(48, "D0"),
12562306a36Sopenharmony_ci	PINCTRL_PIN(49, "D1"),
12662306a36Sopenharmony_ci	PINCTRL_PIN(50, "D2"),
12762306a36Sopenharmony_ci	PINCTRL_PIN(51, "D3"),
12862306a36Sopenharmony_ci	PINCTRL_PIN(52, "D4"),
12962306a36Sopenharmony_ci	PINCTRL_PIN(53, "D5"),
13062306a36Sopenharmony_ci	PINCTRL_PIN(54, "D6"),
13162306a36Sopenharmony_ci	PINCTRL_PIN(55, "D7"),
13262306a36Sopenharmony_ci	PINCTRL_PIN(57, "D9"),
13362306a36Sopenharmony_ci	PINCTRL_PIN(58, "D10"),
13462306a36Sopenharmony_ci	PINCTRL_PIN(59, "D11"),
13562306a36Sopenharmony_ci	PINCTRL_PIN(60, "D12"),
13662306a36Sopenharmony_ci	PINCTRL_PIN(61, "D13"),
13762306a36Sopenharmony_ci	PINCTRL_PIN(62, "D14"),
13862306a36Sopenharmony_ci	PINCTRL_PIN(63, "D15"),
13962306a36Sopenharmony_ci	PINCTRL_PIN(64, "E0"),
14062306a36Sopenharmony_ci	PINCTRL_PIN(65, "E1"),
14162306a36Sopenharmony_ci	PINCTRL_PIN(66, "E2"),
14262306a36Sopenharmony_ci	PINCTRL_PIN(67, "E3"),
14362306a36Sopenharmony_ci	PINCTRL_PIN(68, "E4"),
14462306a36Sopenharmony_ci	PINCTRL_PIN(69, "E5"),
14562306a36Sopenharmony_ci	PINCTRL_PIN(70, "E6"),
14662306a36Sopenharmony_ci	PINCTRL_PIN(71, "E7"),
14762306a36Sopenharmony_ci	PINCTRL_PIN(72, "E8"),
14862306a36Sopenharmony_ci	PINCTRL_PIN(73, "E9"),
14962306a36Sopenharmony_ci	PINCTRL_PIN(80, "F0"),
15062306a36Sopenharmony_ci	PINCTRL_PIN(81, "F1"),
15162306a36Sopenharmony_ci	PINCTRL_PIN(82, "F2"),
15262306a36Sopenharmony_ci	PINCTRL_PIN(83, "F3"),
15362306a36Sopenharmony_ci	PINCTRL_PIN(84, "F4"),
15462306a36Sopenharmony_ci	PINCTRL_PIN(85, "F5"),
15562306a36Sopenharmony_ci	PINCTRL_PIN(88, "F8"),
15662306a36Sopenharmony_ci	PINCTRL_PIN(92, "F12"),
15762306a36Sopenharmony_ci	PINCTRL_PIN(93, "F13"),
15862306a36Sopenharmony_ci	PINCTRL_PIN(96, "G0"),
15962306a36Sopenharmony_ci	PINCTRL_PIN(97, "G1"),
16062306a36Sopenharmony_ci	PINCTRL_PIN(102, "G6"),
16162306a36Sopenharmony_ci	PINCTRL_PIN(103, "G7"),
16262306a36Sopenharmony_ci	PINCTRL_PIN(104, "G8"),
16362306a36Sopenharmony_ci	PINCTRL_PIN(105, "G9"),
16462306a36Sopenharmony_ci	PINCTRL_PIN(108, "G12"),
16562306a36Sopenharmony_ci	PINCTRL_PIN(109, "G13"),
16662306a36Sopenharmony_ci	PINCTRL_PIN(110, "G14"),
16762306a36Sopenharmony_ci	PINCTRL_PIN(111, "G15"),
16862306a36Sopenharmony_ci	PINCTRL_PIN(112, "H0"),
16962306a36Sopenharmony_ci	PINCTRL_PIN(113, "H1"),
17062306a36Sopenharmony_ci	PINCTRL_PIN(114, "H2"),
17162306a36Sopenharmony_ci	PINCTRL_PIN(115, "H3"),
17262306a36Sopenharmony_ci	PINCTRL_PIN(116, "H4"),
17362306a36Sopenharmony_ci	PINCTRL_PIN(117, "H5"),
17462306a36Sopenharmony_ci	PINCTRL_PIN(118, "H6"),
17562306a36Sopenharmony_ci	PINCTRL_PIN(119, "H7"),
17662306a36Sopenharmony_ci	PINCTRL_PIN(120, "H8"),
17762306a36Sopenharmony_ci	PINCTRL_PIN(121, "H9"),
17862306a36Sopenharmony_ci	PINCTRL_PIN(122, "H10"),
17962306a36Sopenharmony_ci	PINCTRL_PIN(123, "H11"),
18062306a36Sopenharmony_ci	PINCTRL_PIN(124, "H12"),
18162306a36Sopenharmony_ci	PINCTRL_PIN(125, "H13"),
18262306a36Sopenharmony_ci	PINCTRL_PIN(126, "H14"),
18362306a36Sopenharmony_ci	PINCTRL_PIN(127, "H15"),
18462306a36Sopenharmony_ci	PINCTRL_PIN(128, "J0"),
18562306a36Sopenharmony_ci	PINCTRL_PIN(129, "J1"),
18662306a36Sopenharmony_ci	PINCTRL_PIN(130, "J2"),
18762306a36Sopenharmony_ci	PINCTRL_PIN(131, "J3"),
18862306a36Sopenharmony_ci	PINCTRL_PIN(132, "J4"),
18962306a36Sopenharmony_ci	PINCTRL_PIN(133, "J5"),
19062306a36Sopenharmony_ci	PINCTRL_PIN(134, "J6"),
19162306a36Sopenharmony_ci	PINCTRL_PIN(135, "J7"),
19262306a36Sopenharmony_ci	PINCTRL_PIN(136, "J8"),
19362306a36Sopenharmony_ci	PINCTRL_PIN(137, "J9"),
19462306a36Sopenharmony_ci	PINCTRL_PIN(138, "J10"),
19562306a36Sopenharmony_ci	PINCTRL_PIN(139, "J11"),
19662306a36Sopenharmony_ci	PINCTRL_PIN(140, "J12"),
19762306a36Sopenharmony_ci	PINCTRL_PIN(141, "J13"),
19862306a36Sopenharmony_ci	PINCTRL_PIN(142, "J14"),
19962306a36Sopenharmony_ci	PINCTRL_PIN(143, "J15"),
20062306a36Sopenharmony_ci	PINCTRL_PIN(144, "K0"),
20162306a36Sopenharmony_ci	PINCTRL_PIN(145, "K1"),
20262306a36Sopenharmony_ci	PINCTRL_PIN(146, "K2"),
20362306a36Sopenharmony_ci	PINCTRL_PIN(147, "K3"),
20462306a36Sopenharmony_ci	PINCTRL_PIN(148, "K4"),
20562306a36Sopenharmony_ci	PINCTRL_PIN(149, "K5"),
20662306a36Sopenharmony_ci	PINCTRL_PIN(150, "K6"),
20762306a36Sopenharmony_ci	PINCTRL_PIN(151, "K7"),
20862306a36Sopenharmony_ci};
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_cistatic const char * const pic32_input0_group[] = {
21162306a36Sopenharmony_ci	"D2", "G8", "F4", "F1", "B9", "B10", "C14", "B5",
21262306a36Sopenharmony_ci	"C1", "D14", "G1", "A14", "D6",
21362306a36Sopenharmony_ci};
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_cistatic const char * const pic32_input1_group[] = {
21662306a36Sopenharmony_ci	"D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
21762306a36Sopenharmony_ci	"B3", "C4", "G0", "A15", "D7",
21862306a36Sopenharmony_ci};
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_cistatic const char * const pic32_input2_group[] = {
22162306a36Sopenharmony_ci	"D9", "G6", "B8", "B15", "D4", "B0", "E3", "B7",
22262306a36Sopenharmony_ci	"F12", "D12", "F8", "C3", "E9",
22362306a36Sopenharmony_ci};
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_cistatic const char * const pic32_input3_group[] = {
22662306a36Sopenharmony_ci	"G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
22762306a36Sopenharmony_ci	"F2", "C2", "E8",
22862306a36Sopenharmony_ci};
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_cistatic const char * const pic32_output0_group[] = {
23162306a36Sopenharmony_ci	"D2", "G8", "F4", "D10", "F1", "B9", "B10", "C14",
23262306a36Sopenharmony_ci	"B5", "C1", "D14", "G1", "A14", "D6",
23362306a36Sopenharmony_ci};
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_cistatic const char * const pic32_output0_1_group[] = {
23662306a36Sopenharmony_ci	"D2", "G8", "F4", "D10", "F1", "B9", "B10", "C14",
23762306a36Sopenharmony_ci	"B5", "C1", "D14", "G1", "A14", "D6",
23862306a36Sopenharmony_ci	"D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
23962306a36Sopenharmony_ci	"B3", "C4", "D15", "G0", "A15", "D7",
24062306a36Sopenharmony_ci};
24162306a36Sopenharmony_ci
24262306a36Sopenharmony_cistatic const char *const pic32_output1_group[] = {
24362306a36Sopenharmony_ci	"D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
24462306a36Sopenharmony_ci	"B3", "C4", "D15", "G0", "A15", "D7",
24562306a36Sopenharmony_ci};
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_cistatic const char *const pic32_output1_3_group[] = {
24862306a36Sopenharmony_ci	"D3", "G7", "F5", "D11", "F0", "B1", "E5", "C13",
24962306a36Sopenharmony_ci	"B3", "C4", "D15", "G0", "A15", "D7",
25062306a36Sopenharmony_ci	"G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
25162306a36Sopenharmony_ci	"C2", "E8", "F2",
25262306a36Sopenharmony_ci};
25362306a36Sopenharmony_ci
25462306a36Sopenharmony_cistatic const char * const pic32_output2_group[] = {
25562306a36Sopenharmony_ci	"D9", "G6", "B8", "B15", "D4", "B0", "E3", "B7",
25662306a36Sopenharmony_ci	"F12", "D12", "F8", "C3", "E9",
25762306a36Sopenharmony_ci};
25862306a36Sopenharmony_ci
25962306a36Sopenharmony_cistatic const char * const pic32_output2_3_group[] = {
26062306a36Sopenharmony_ci	"D9", "G6", "B8", "B15", "D4", "B0", "E3", "B7",
26162306a36Sopenharmony_ci	"F12", "D12", "F8", "C3", "E9",
26262306a36Sopenharmony_ci	"G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
26362306a36Sopenharmony_ci	"C2", "E8", "F2",
26462306a36Sopenharmony_ci};
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_cistatic const char * const pic32_output3_group[] = {
26762306a36Sopenharmony_ci	"G9", "B14", "D0", "B6", "D5", "B2", "F3", "F13",
26862306a36Sopenharmony_ci	"C2", "E8", "F2",
26962306a36Sopenharmony_ci};
27062306a36Sopenharmony_ci
27162306a36Sopenharmony_ci#define FUNCTION(_name, _gr)					\
27262306a36Sopenharmony_ci	{							\
27362306a36Sopenharmony_ci		.name = #_name,					\
27462306a36Sopenharmony_ci		.groups = pic32_##_gr##_group,			\
27562306a36Sopenharmony_ci		.ngroups = ARRAY_SIZE(pic32_##_gr##_group),	\
27662306a36Sopenharmony_ci	}
27762306a36Sopenharmony_ci
27862306a36Sopenharmony_cistatic const struct pic32_function pic32_functions[] = {
27962306a36Sopenharmony_ci	FUNCTION(INT3, input0),
28062306a36Sopenharmony_ci	FUNCTION(T2CK, input0),
28162306a36Sopenharmony_ci	FUNCTION(T6CK, input0),
28262306a36Sopenharmony_ci	FUNCTION(IC3, input0),
28362306a36Sopenharmony_ci	FUNCTION(IC7, input0),
28462306a36Sopenharmony_ci	FUNCTION(U1RX, input0),
28562306a36Sopenharmony_ci	FUNCTION(U2CTS, input0),
28662306a36Sopenharmony_ci	FUNCTION(U5RX, input0),
28762306a36Sopenharmony_ci	FUNCTION(U6CTS, input0),
28862306a36Sopenharmony_ci	FUNCTION(SDI1, input0),
28962306a36Sopenharmony_ci	FUNCTION(SDI3, input0),
29062306a36Sopenharmony_ci	FUNCTION(SDI5, input0),
29162306a36Sopenharmony_ci	FUNCTION(SS6IN, input0),
29262306a36Sopenharmony_ci	FUNCTION(REFCLKI1, input0),
29362306a36Sopenharmony_ci	FUNCTION(INT4, input1),
29462306a36Sopenharmony_ci	FUNCTION(T5CK, input1),
29562306a36Sopenharmony_ci	FUNCTION(T7CK, input1),
29662306a36Sopenharmony_ci	FUNCTION(IC4, input1),
29762306a36Sopenharmony_ci	FUNCTION(IC8, input1),
29862306a36Sopenharmony_ci	FUNCTION(U3RX, input1),
29962306a36Sopenharmony_ci	FUNCTION(U4CTS, input1),
30062306a36Sopenharmony_ci	FUNCTION(SDI2, input1),
30162306a36Sopenharmony_ci	FUNCTION(SDI4, input1),
30262306a36Sopenharmony_ci	FUNCTION(C1RX, input1),
30362306a36Sopenharmony_ci	FUNCTION(REFCLKI4, input1),
30462306a36Sopenharmony_ci	FUNCTION(INT2, input2),
30562306a36Sopenharmony_ci	FUNCTION(T3CK, input2),
30662306a36Sopenharmony_ci	FUNCTION(T8CK, input2),
30762306a36Sopenharmony_ci	FUNCTION(IC2, input2),
30862306a36Sopenharmony_ci	FUNCTION(IC5, input2),
30962306a36Sopenharmony_ci	FUNCTION(IC9, input2),
31062306a36Sopenharmony_ci	FUNCTION(U1CTS, input2),
31162306a36Sopenharmony_ci	FUNCTION(U2RX, input2),
31262306a36Sopenharmony_ci	FUNCTION(U5CTS, input2),
31362306a36Sopenharmony_ci	FUNCTION(SS1IN, input2),
31462306a36Sopenharmony_ci	FUNCTION(SS3IN, input2),
31562306a36Sopenharmony_ci	FUNCTION(SS4IN, input2),
31662306a36Sopenharmony_ci	FUNCTION(SS5IN, input2),
31762306a36Sopenharmony_ci	FUNCTION(C2RX, input2),
31862306a36Sopenharmony_ci	FUNCTION(INT1, input3),
31962306a36Sopenharmony_ci	FUNCTION(T4CK, input3),
32062306a36Sopenharmony_ci	FUNCTION(T9CK, input3),
32162306a36Sopenharmony_ci	FUNCTION(IC1, input3),
32262306a36Sopenharmony_ci	FUNCTION(IC6, input3),
32362306a36Sopenharmony_ci	FUNCTION(U3CTS, input3),
32462306a36Sopenharmony_ci	FUNCTION(U4RX, input3),
32562306a36Sopenharmony_ci	FUNCTION(U6RX, input3),
32662306a36Sopenharmony_ci	FUNCTION(SS2IN, input3),
32762306a36Sopenharmony_ci	FUNCTION(SDI6, input3),
32862306a36Sopenharmony_ci	FUNCTION(OCFA, input3),
32962306a36Sopenharmony_ci	FUNCTION(REFCLKI3, input3),
33062306a36Sopenharmony_ci	FUNCTION(U3TX, output0),
33162306a36Sopenharmony_ci	FUNCTION(U4RTS, output0),
33262306a36Sopenharmony_ci	FUNCTION(SDO1, output0_1),
33362306a36Sopenharmony_ci	FUNCTION(SDO2, output0_1),
33462306a36Sopenharmony_ci	FUNCTION(SDO3, output0_1),
33562306a36Sopenharmony_ci	FUNCTION(SDO5, output0_1),
33662306a36Sopenharmony_ci	FUNCTION(SS6OUT, output0),
33762306a36Sopenharmony_ci	FUNCTION(OC3, output0),
33862306a36Sopenharmony_ci	FUNCTION(OC6, output0),
33962306a36Sopenharmony_ci	FUNCTION(REFCLKO4, output0),
34062306a36Sopenharmony_ci	FUNCTION(C2OUT, output0),
34162306a36Sopenharmony_ci	FUNCTION(C1TX, output0),
34262306a36Sopenharmony_ci	FUNCTION(U1TX, output1),
34362306a36Sopenharmony_ci	FUNCTION(U2RTS, output1),
34462306a36Sopenharmony_ci	FUNCTION(U5TX, output1),
34562306a36Sopenharmony_ci	FUNCTION(U6RTS, output1),
34662306a36Sopenharmony_ci	FUNCTION(SDO4, output1_3),
34762306a36Sopenharmony_ci	FUNCTION(OC4, output1),
34862306a36Sopenharmony_ci	FUNCTION(OC7, output1),
34962306a36Sopenharmony_ci	FUNCTION(REFCLKO1, output1),
35062306a36Sopenharmony_ci	FUNCTION(U3RTS, output2),
35162306a36Sopenharmony_ci	FUNCTION(U4TX, output2),
35262306a36Sopenharmony_ci	FUNCTION(U6TX, output2_3),
35362306a36Sopenharmony_ci	FUNCTION(SS1OUT, output2),
35462306a36Sopenharmony_ci	FUNCTION(SS3OUT, output2),
35562306a36Sopenharmony_ci	FUNCTION(SS4OUT, output2),
35662306a36Sopenharmony_ci	FUNCTION(SS5OUT, output2),
35762306a36Sopenharmony_ci	FUNCTION(SDO6, output2_3),
35862306a36Sopenharmony_ci	FUNCTION(OC5, output2),
35962306a36Sopenharmony_ci	FUNCTION(OC8, output2),
36062306a36Sopenharmony_ci	FUNCTION(C1OUT, output2),
36162306a36Sopenharmony_ci	FUNCTION(REFCLKO3, output2),
36262306a36Sopenharmony_ci	FUNCTION(U1RTS, output3),
36362306a36Sopenharmony_ci	FUNCTION(U2TX, output3),
36462306a36Sopenharmony_ci	FUNCTION(U5RTS, output3),
36562306a36Sopenharmony_ci	FUNCTION(SS2OUT, output3),
36662306a36Sopenharmony_ci	FUNCTION(OC2, output3),
36762306a36Sopenharmony_ci	FUNCTION(OC1, output3),
36862306a36Sopenharmony_ci	FUNCTION(OC9, output3),
36962306a36Sopenharmony_ci	FUNCTION(C2TX, output3),
37062306a36Sopenharmony_ci};
37162306a36Sopenharmony_ci
37262306a36Sopenharmony_ci#define PIC32_PINCTRL_GROUP(_pin, _name, ...)				\
37362306a36Sopenharmony_ci	{								\
37462306a36Sopenharmony_ci		.name = #_name,						\
37562306a36Sopenharmony_ci		.pin = _pin,						\
37662306a36Sopenharmony_ci		.functions = (struct pic32_desc_function[]){		\
37762306a36Sopenharmony_ci			__VA_ARGS__, { } },				\
37862306a36Sopenharmony_ci	}
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_ci#define PIC32_PINCTRL_FUNCTION(_name, _muxreg, _muxval)	\
38162306a36Sopenharmony_ci	{						\
38262306a36Sopenharmony_ci		.name = #_name,				\
38362306a36Sopenharmony_ci		.muxreg = _muxreg,			\
38462306a36Sopenharmony_ci		.muxval = _muxval,			\
38562306a36Sopenharmony_ci	}
38662306a36Sopenharmony_ci
38762306a36Sopenharmony_cistatic const struct pic32_pin_group pic32_groups[] = {
38862306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(14, A14,
38962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 13),
39062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 13),
39162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 13),
39262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 13),
39362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 13),
39462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 13),
39562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 13),
39662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 13),
39762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 13),
39862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 13),
39962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 13),
40062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 13),
40162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 13),
40262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 13),
40362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPA14R, 1),
40462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPA14R, 2),
40562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPA14R, 5),
40662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPA14R, 6),
40762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPA14R, 7),
40862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPA14R, 9),
40962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPA14R, 10),
41062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPA14R, 11),
41162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPA14R, 12),
41262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPA14R, 13),
41362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPA14R, 14),
41462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPA14R, 15)),
41562306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(15, A15,
41662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 13),
41762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 13),
41862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 13),
41962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 13),
42062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 13),
42162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 13),
42262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 13),
42362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 13),
42462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 13),
42562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 13),
42662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 13),
42762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPA15R, 1),
42862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPA15R, 2),
42962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPA15R, 3),
43062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPA15R, 4),
43162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPA15R, 5),
43262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPA15R, 6),
43362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPA15R, 7),
43462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPA15R, 8),
43562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPA15R, 9),
43662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPA15R, 11),
43762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPA15R, 12),
43862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPA15R, 15)),
43962306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(16, B0,
44062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 5),
44162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 5),
44262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 5),
44362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 5),
44462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 5),
44562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 5),
44662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 5),
44762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 5),
44862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 5),
44962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 5),
45062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 5),
45162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 5),
45262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 5),
45362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 5),
45462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPB0R, 1),
45562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPB0R, 2),
45662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPB0R, 4),
45762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPB0R, 5),
45862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPB0R, 7),
45962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPB0R, 8),
46062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPB0R, 9),
46162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPB0R, 10),
46262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPB0R, 11),
46362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPB0R, 12),
46462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPB0R, 14),
46562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB0R, 15)),
46662306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(17, B1,
46762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 5),
46862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 5),
46962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 5),
47062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 5),
47162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 5),
47262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 5),
47362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 5),
47462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 5),
47562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 5),
47662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 5),
47762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 5),
47862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPB1R, 1),
47962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPB1R, 2),
48062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPB1R, 3),
48162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPB1R, 4),
48262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPB1R, 5),
48362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPB1R, 6),
48462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPB1R, 7),
48562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPB1R, 8),
48662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPB1R, 9),
48762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPB1R, 11),
48862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPB1R, 12),
48962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPB1R, 15)),
49062306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(18, B2,
49162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 7),
49262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 7),
49362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 7),
49462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 7),
49562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 7),
49662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 7),
49762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 7),
49862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 7),
49962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 7),
50062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 7),
50162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 7),
50262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 7),
50362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPB2R, 1),
50462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPB2R, 2),
50562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPB2R, 3),
50662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPB2R, 4),
50762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPB2R, 6),
50862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPB2R, 8),
50962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPB2R, 10),
51062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPB2R, 11),
51162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPB2R, 12),
51262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPB2R, 13),
51362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPB2R, 15)),
51462306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(19, B3,
51562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 8),
51662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 8),
51762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 8),
51862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 8),
51962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 8),
52062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 8),
52162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 8),
52262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 8),
52362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 8),
52462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 8),
52562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 8),
52662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPB3R, 1),
52762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPB3R, 2),
52862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPB3R, 3),
52962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPB3R, 4),
53062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPB3R, 5),
53162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPB3R, 6),
53262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPB3R, 7),
53362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPB3R, 8),
53462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPB3R, 9),
53562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPB3R, 11),
53662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPB3R, 12),
53762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPB3R, 15)),
53862306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(21, B5,
53962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 8),
54062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 8),
54162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 8),
54262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 8),
54362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 8),
54462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 8),
54562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 8),
54662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 8),
54762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 8),
54862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 8),
54962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 8),
55062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 8),
55162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 8),
55262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 8),
55362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPB5R, 1),
55462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPB5R, 2),
55562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPB5R, 5),
55662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPB5R, 6),
55762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPB5R, 7),
55862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPB5R, 9),
55962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPB5R, 10),
56062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPB5R, 11),
56162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPB5R, 12),
56262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPB5R, 13),
56362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPB5R, 14),
56462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPB5R, 15)),
56562306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(22, B6,
56662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 4),
56762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 4),
56862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 4),
56962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 4),
57062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 4),
57162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 4),
57262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 4),
57362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 4),
57462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 4),
57562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 4),
57662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 4),
57762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 4),
57862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPB6R, 1),
57962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPB6R, 2),
58062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPB6R, 3),
58162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPB6R, 4),
58262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPB6R, 6),
58362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPB6R, 8),
58462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPB6R, 10),
58562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPB6R, 11),
58662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPB6R, 12),
58762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPB6R, 13),
58862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPB6R, 15)),
58962306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(23, B7,
59062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 7),
59162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 7),
59262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 7),
59362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 7),
59462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 7),
59562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 7),
59662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 7),
59762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 7),
59862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 7),
59962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 7),
60062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 7),
60162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 7),
60262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 7),
60362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 7),
60462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPB7R, 1),
60562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPB7R, 2),
60662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPB7R, 4),
60762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPB7R, 5),
60862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPB7R, 7),
60962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPB7R, 8),
61062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPB7R, 9),
61162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPB7R, 10),
61262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPB7R, 11),
61362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPB7R, 12),
61462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPB7R, 14),
61562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB7R, 15)),
61662306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(24, B8,
61762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 2),
61862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 2),
61962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 2),
62062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 2),
62162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 2),
62262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 2),
62362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 2),
62462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 2),
62562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 2),
62662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 2),
62762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 2),
62862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 2),
62962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 2),
63062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 2),
63162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPB8R, 1),
63262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPB8R, 2),
63362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPB8R, 4),
63462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPB8R, 5),
63562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPB8R, 7),
63662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPB8R, 8),
63762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPB8R, 9),
63862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPB8R, 10),
63962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPB8R, 11),
64062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPB8R, 12),
64162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPB8R, 14),
64262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB8R, 15)),
64362306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(25, B9,
64462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 5),
64562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 5),
64662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 5),
64762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 5),
64862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 5),
64962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 5),
65062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 5),
65162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 5),
65262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 5),
65362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 5),
65462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 5),
65562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 5),
65662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 5),
65762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 5),
65862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPB9R, 1),
65962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPB9R, 2),
66062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPB9R, 5),
66162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPB9R, 6),
66262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPB9R, 7),
66362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPB9R, 9),
66462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPB9R, 10),
66562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPB9R, 11),
66662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPB9R, 12),
66762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPB9R, 13),
66862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPB9R, 14),
66962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPB9R, 15)),
67062306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(26, B10,
67162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 6),
67262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 6),
67362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 6),
67462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 6),
67562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 6),
67662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 6),
67762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 6),
67862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 6),
67962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 6),
68062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 6),
68162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 6),
68262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 6),
68362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 6),
68462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 6),
68562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPB10R, 1),
68662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPB10R, 2),
68762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPB10R, 5),
68862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPB10R, 6),
68962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPB10R, 7),
69062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPB10R, 9),
69162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPB10R, 10),
69262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPB10R, 11),
69362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPB10R, 12),
69462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPB10R, 13),
69562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPB10R, 14),
69662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPB10R, 15)),
69762306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(30, B14,
69862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 2),
69962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 2),
70062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 2),
70162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 2),
70262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 2),
70362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 2),
70462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 2),
70562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 2),
70662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 2),
70762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 2),
70862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 2),
70962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 2),
71062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPB14R, 1),
71162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPB14R, 2),
71262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPB14R, 3),
71362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPB14R, 4),
71462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPB14R, 6),
71562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPB14R, 8),
71662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPB14R, 10),
71762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPB14R, 11),
71862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPB14R, 12),
71962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPB14R, 13),
72062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPB14R, 15)),
72162306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(31, B15,
72262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 3),
72362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 3),
72462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 3),
72562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 3),
72662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 3),
72762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 3),
72862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 3),
72962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 3),
73062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 3),
73162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 3),
73262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 3),
73362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 3),
73462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 3),
73562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 3),
73662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPB15R, 1),
73762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPB15R, 2),
73862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPB15R, 4),
73962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPB15R, 5),
74062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPB15R, 7),
74162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPB15R, 8),
74262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPB15R, 9),
74362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPB15R, 10),
74462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPB15R, 11),
74562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPB15R, 12),
74662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPB15R, 14),
74762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPB15R, 15)),
74862306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(33, C1,
74962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 10),
75062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 10),
75162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 10),
75262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 10),
75362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 10),
75462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 10),
75562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 10),
75662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 10),
75762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 10),
75862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 10),
75962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 10),
76062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 10),
76162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 10),
76262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 10),
76362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPC1R, 1),
76462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPC1R, 2),
76562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPC1R, 5),
76662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPC1R, 6),
76762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPC1R, 7),
76862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPC1R, 9),
76962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPC1R, 10),
77062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPC1R, 11),
77162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPC1R, 12),
77262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPC1R, 13),
77362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPC1R, 14),
77462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPC1R, 15)),
77562306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(34, C2,
77662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 12),
77762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 12),
77862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 12),
77962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 12),
78062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 12),
78162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 12),
78262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 12),
78362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 12),
78462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 12),
78562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 12),
78662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 12),
78762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 12),
78862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPC2R, 1),
78962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPC2R, 2),
79062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPC2R, 3),
79162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPC2R, 4),
79262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPC2R, 6),
79362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPC2R, 8),
79462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPC2R, 10),
79562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPC2R, 11),
79662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPC2R, 12),
79762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPC2R, 13),
79862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPC2R, 15)),
79962306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(35, C3,
80062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 12),
80162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 12),
80262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 12),
80362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 12),
80462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 12),
80562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 12),
80662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 12),
80762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 12),
80862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 12),
80962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 12),
81062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 12),
81162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 12),
81262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 12),
81362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 12),
81462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPC3R, 1),
81562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPC3R, 2),
81662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPC3R, 4),
81762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPC3R, 5),
81862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPC3R, 7),
81962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPC3R, 8),
82062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPC3R, 9),
82162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPC3R, 10),
82262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPC3R, 11),
82362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPC3R, 12),
82462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPC3R, 14),
82562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPC3R, 15)),
82662306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(36, C4,
82762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 10),
82862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 10),
82962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 10),
83062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 10),
83162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 10),
83262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 10),
83362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 10),
83462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 10),
83562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 10),
83662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 10),
83762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 10),
83862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPC4R, 1),
83962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPC4R, 2),
84062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPC4R, 3),
84162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPC4R, 4),
84262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPC4R, 5),
84362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPC4R, 6),
84462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPC4R, 7),
84562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPC4R, 8),
84662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPC4R, 9),
84762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPC4R, 11),
84862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPC4R, 12),
84962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPC4R, 15)),
85062306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(45, C13,
85162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 7),
85262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 7),
85362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 7),
85462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 7),
85562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 7),
85662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 7),
85762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 7),
85862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 7),
85962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 7),
86062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 7),
86162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 7),
86262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPC13R, 1),
86362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPC13R, 2),
86462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPC13R, 3),
86562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPC13R, 4),
86662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPC13R, 5),
86762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPC13R, 6),
86862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPC13R, 7),
86962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPC13R, 8),
87062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPC13R, 9),
87162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPC13R, 11),
87262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPC13R, 12),
87362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPC13R, 15)),
87462306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(46, C14,
87562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 7),
87662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 7),
87762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 7),
87862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 7),
87962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 7),
88062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 7),
88162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 7),
88262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 7),
88362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 7),
88462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 7),
88562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 7),
88662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 7),
88762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 7),
88862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 7),
88962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPC14R, 1),
89062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPC14R, 2),
89162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPC14R, 5),
89262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPC14R, 6),
89362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPC14R, 7),
89462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPC14R, 9),
89562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPC14R, 10),
89662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPC14R, 11),
89762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPC14R, 12),
89862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPC14R, 13),
89962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPC14R, 14),
90062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPC14R, 15)),
90162306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(48, D0,
90262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 3),
90362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 3),
90462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 3),
90562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 3),
90662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 3),
90762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 3),
90862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 3),
90962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 3),
91062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 3),
91162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 3),
91262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 3),
91362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 3),
91462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPD0R, 1),
91562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPD0R, 2),
91662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPD0R, 3),
91762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPD0R, 4),
91862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPD0R, 6),
91962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPD0R, 8),
92062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPD0R, 10),
92162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPD0R, 11),
92262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPD0R, 12),
92362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPD0R, 13),
92462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPD0R, 15)),
92562306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(50, D2,
92662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 0),
92762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 0),
92862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 0),
92962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 0),
93062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 0),
93162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 0),
93262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 0),
93362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 0),
93462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 0),
93562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 0),
93662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 0),
93762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 0),
93862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 0),
93962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 0),
94062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPD2R, 1),
94162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPD2R, 2),
94262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD2R, 5),
94362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD2R, 6),
94462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD2R, 7),
94562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD2R, 9),
94662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPD2R, 10),
94762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPD2R, 11),
94862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPD2R, 12),
94962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD2R, 13),
95062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPD2R, 14),
95162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPD2R, 15)),
95262306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(51, D3,
95362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 0),
95462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 0),
95562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 0),
95662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 0),
95762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 0),
95862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 0),
95962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 0),
96062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 0),
96162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 0),
96262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 0),
96362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 0),
96462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPD3R, 1),
96562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPD3R, 2),
96662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPD3R, 3),
96762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPD3R, 4),
96862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD3R, 5),
96962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD3R, 6),
97062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD3R, 7),
97162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPD3R, 8),
97262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD3R, 9),
97362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPD3R, 11),
97462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPD3R, 12),
97562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD3R, 15)),
97662306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(52, D4,
97762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 4),
97862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 4),
97962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 4),
98062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 4),
98162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 4),
98262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 4),
98362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 4),
98462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 4),
98562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 4),
98662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 4),
98762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 4),
98862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 4),
98962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 4),
99062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 4),
99162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPD4R, 1),
99262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPD4R, 2),
99362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPD4R, 4),
99462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPD4R, 5),
99562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPD4R, 7),
99662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPD4R, 8),
99762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPD4R, 9),
99862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPD4R, 10),
99962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPD4R, 11),
100062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPD4R, 12),
100162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPD4R, 14),
100262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPD4R, 15)),
100362306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(53, D5,
100462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 6),
100562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 6),
100662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 6),
100762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 6),
100862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 6),
100962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 6),
101062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 6),
101162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 6),
101262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 6),
101362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 6),
101462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 6),
101562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 6),
101662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPD5R, 1),
101762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPD5R, 2),
101862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPD5R, 3),
101962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPD5R, 4),
102062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPD5R, 6),
102162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPD5R, 8),
102262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPD5R, 10),
102362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPD5R, 11),
102462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPD5R, 12),
102562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPD5R, 13),
102662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPD5R, 15)),
102762306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(54, D6,
102862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 14),
102962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 14),
103062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 14),
103162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 14),
103262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 14),
103362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 14),
103462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 14),
103562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 14),
103662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 14),
103762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 14),
103862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 14),
103962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 14),
104062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 14),
104162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 14),
104262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPD6R, 1),
104362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPD6R, 2),
104462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD6R, 5),
104562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD6R, 6),
104662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD6R, 7),
104762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD6R, 9),
104862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPD6R, 10),
104962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPD6R, 11),
105062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPD6R, 12),
105162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD6R, 13),
105262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPD6R, 14),
105362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPD6R, 15)),
105462306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(55, D7,
105562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 14),
105662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 14),
105762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 14),
105862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 14),
105962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 14),
106062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 14),
106162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 14),
106262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 14),
106362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 14),
106462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 14),
106562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 14),
106662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPD7R, 1),
106762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPD7R, 2),
106862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPD7R, 3),
106962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPD7R, 4),
107062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD7R, 5),
107162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD7R, 6),
107262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD7R, 7),
107362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPD7R, 8),
107462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD7R, 9),
107562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPD7R, 11),
107662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPD7R, 12),
107762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD7R, 15)),
107862306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(57, D9,
107962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 0),
108062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 0),
108162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 0),
108262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 0),
108362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 0),
108462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 0),
108562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 0),
108662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 0),
108762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 0),
108862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 0),
108962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 0),
109062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 0),
109162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 0),
109262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 0),
109362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPD9R, 1),
109462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPD9R, 2),
109562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPD9R, 4),
109662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPD9R, 5),
109762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPD9R, 7),
109862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPD9R, 8),
109962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPD9R, 9),
110062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPD9R, 10),
110162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPD9R, 11),
110262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPD9R, 12),
110362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPD9R, 14),
110462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPD9R, 15)),
110562306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(58, D10,
110662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPD10R, 1),
110762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPD10R, 2),
110862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD10R, 5),
110962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD10R, 6),
111062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD10R, 7),
111162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD10R, 9),
111262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPD10R, 10),
111362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPD10R, 11),
111462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPD10R, 12),
111562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD10R, 13),
111662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPD10R, 14),
111762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPD10R, 15)),
111862306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(59, D11,
111962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 3),
112062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 3),
112162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 3),
112262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 3),
112362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 3),
112462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 3),
112562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 3),
112662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 3),
112762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 3),
112862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 3),
112962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 3),
113062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPD11R, 1),
113162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPD11R, 2),
113262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPD11R, 3),
113362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPD11R, 4),
113462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD11R, 5),
113562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD11R, 6),
113662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD11R, 7),
113762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPD11R, 8),
113862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD11R, 9),
113962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPD11R, 11),
114062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPD11R, 12),
114162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD11R, 15)),
114262306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(60, D12,
114362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 10),
114462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 10),
114562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 10),
114662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 10),
114762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 10),
114862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 10),
114962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 10),
115062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 10),
115162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 10),
115262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 10),
115362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 10),
115462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 10),
115562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 10),
115662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 10),
115762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPD12R, 1),
115862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPD12R, 2),
115962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPD12R, 4),
116062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPD12R, 5),
116162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPD12R, 7),
116262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPD12R, 8),
116362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPD12R, 9),
116462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPD12R, 10),
116562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPD12R, 11),
116662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPD12R, 12),
116762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPD12R, 14),
116862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPD12R, 15)),
116962306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(62, D14,
117062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 11),
117162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 11),
117262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 11),
117362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 11),
117462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 11),
117562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 11),
117662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 11),
117762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 11),
117862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 11),
117962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 11),
118062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 11),
118162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 11),
118262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 11),
118362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 11),
118462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPD14R, 1),
118562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPD14R, 2),
118662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD14R, 5),
118762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD14R, 6),
118862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD14R, 7),
118962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD14R, 9),
119062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPD14R, 10),
119162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPD14R, 11),
119262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPD14R, 12),
119362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPD14R, 13),
119462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPD14R, 14),
119562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPD14R, 15)),
119662306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(63, D15,
119762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPD15R, 1),
119862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPD15R, 2),
119962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPD15R, 3),
120062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPD15R, 4),
120162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPD15R, 5),
120262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPD15R, 6),
120362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPD15R, 7),
120462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPD15R, 8),
120562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPD15R, 9),
120662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPD15R, 11),
120762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPD15R, 12),
120862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPD15R, 15)),
120962306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(67, E3,
121062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 6),
121162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 6),
121262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 6),
121362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 6),
121462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 6),
121562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 6),
121662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 6),
121762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 6),
121862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 6),
121962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 6),
122062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 6),
122162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 6),
122262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 6),
122362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 6),
122462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPE3R, 1),
122562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPE3R, 2),
122662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPE3R, 4),
122762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPE3R, 5),
122862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPE3R, 7),
122962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPE3R, 8),
123062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPE3R, 9),
123162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPE3R, 10),
123262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPE3R, 11),
123362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPE3R, 12),
123462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPE3R, 14),
123562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPE3R, 15)),
123662306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(69, E5,
123762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 6),
123862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 6),
123962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 6),
124062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 6),
124162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 6),
124262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 6),
124362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 6),
124462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 6),
124562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 6),
124662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 6),
124762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 6),
124862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPE5R, 1),
124962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPE5R, 2),
125062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPE5R, 3),
125162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPE5R, 4),
125262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPE5R, 5),
125362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPE5R, 6),
125462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPE5R, 7),
125562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPE5R, 8),
125662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPE5R, 9),
125762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPE5R, 11),
125862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPE5R, 12),
125962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPE5R, 15)),
126062306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(72, E8,
126162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 13),
126262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 13),
126362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 13),
126462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 13),
126562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 13),
126662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 13),
126762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 13),
126862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 13),
126962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 13),
127062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 13),
127162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 13),
127262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 13),
127362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPE8R, 1),
127462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPE8R, 2),
127562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPE8R, 3),
127662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPE8R, 4),
127762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPE8R, 6),
127862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPE8R, 8),
127962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPE8R, 10),
128062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPE8R, 11),
128162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPE8R, 12),
128262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPE8R, 13),
128362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPE8R, 15)),
128462306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(73, E9,
128562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 13),
128662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 13),
128762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 13),
128862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 13),
128962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 13),
129062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 13),
129162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 13),
129262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 13),
129362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 13),
129462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 13),
129562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 13),
129662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 13),
129762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 13),
129862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 13),
129962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPE9R, 1),
130062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPE9R, 2),
130162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPE9R, 4),
130262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPE9R, 5),
130362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPE9R, 7),
130462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPE9R, 8),
130562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPE9R, 9),
130662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPE9R, 10),
130762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPE9R, 11),
130862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPE9R, 12),
130962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPE9R, 14),
131062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPE9R, 15)),
131162306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(80, F0,
131262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 4),
131362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 4),
131462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 4),
131562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 4),
131662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 4),
131762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 4),
131862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 4),
131962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 4),
132062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 4),
132162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 4),
132262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 4),
132362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPF0R, 1),
132462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPF0R, 2),
132562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPF0R, 3),
132662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPF0R, 4),
132762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPF0R, 5),
132862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPF0R, 6),
132962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPF0R, 7),
133062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPF0R, 8),
133162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPF0R, 9),
133262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPF0R, 11),
133362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPF0R, 12),
133462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPF0R, 15)),
133562306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(81, F1,
133662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 4),
133762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 4),
133862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 4),
133962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 4),
134062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 4),
134162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 4),
134262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 4),
134362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 4),
134462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 4),
134562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 4),
134662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 4),
134762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 4),
134862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 4),
134962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 4),
135062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPF1R, 1),
135162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPF1R, 2),
135262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPF1R, 5),
135362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPF1R, 6),
135462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPF1R, 7),
135562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPF1R, 9),
135662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPF1R, 10),
135762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPF1R, 11),
135862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPF1R, 12),
135962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPF1R, 13),
136062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPF1R, 14),
136162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPF1R, 15)),
136262306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(82, F2,
136362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 11),
136462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 11),
136562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 11),
136662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 11),
136762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 11),
136862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 11),
136962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 11),
137062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 11),
137162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 11),
137262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 11),
137362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 11),
137462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 11),
137562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPF2R, 1),
137662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPF2R, 2),
137762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPF2R, 3),
137862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPF2R, 4),
137962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPF2R, 6),
138062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPF2R, 8),
138162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPF2R, 10),
138262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPF2R, 11),
138362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPF2R, 12),
138462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPF2R, 13),
138562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPF2R, 15)),
138662306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(83, F3,
138762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 8),
138862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 8),
138962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 8),
139062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 8),
139162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 8),
139262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 8),
139362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 8),
139462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 8),
139562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 8),
139662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 8),
139762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 8),
139862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 8),
139962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPF3R, 1),
140062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPF3R, 2),
140162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPF3R, 3),
140262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPF3R, 4),
140362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPF3R, 6),
140462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPF3R, 8),
140562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPF3R, 10),
140662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPF3R, 11),
140762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPF3R, 12),
140862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPF3R, 13),
140962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPF3R, 15)),
141062306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(84, F4,
141162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 2),
141262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 2),
141362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 2),
141462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 2),
141562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 2),
141662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 2),
141762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 2),
141862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 2),
141962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 2),
142062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 2),
142162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 2),
142262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 2),
142362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 2),
142462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 2),
142562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPF4R, 1),
142662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPF4R, 2),
142762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPF4R, 5),
142862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPF4R, 6),
142962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPF4R, 7),
143062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPF4R, 9),
143162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPF4R, 10),
143262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPF4R, 11),
143362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPF4R, 12),
143462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPF4R, 13),
143562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPF4R, 14),
143662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPF4R, 15)),
143762306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(85, F5,
143862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 2),
143962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 2),
144062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 2),
144162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 2),
144262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 2),
144362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 2),
144462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 2),
144562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 2),
144662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 2),
144762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 2),
144862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 2),
144962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPF5R, 1),
145062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPF5R, 2),
145162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPF5R, 3),
145262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPF5R, 4),
145362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPF5R, 5),
145462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPF5R, 6),
145562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPF5R, 7),
145662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPF5R, 8),
145762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPF5R, 9),
145862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPF5R, 11),
145962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPF5R, 12),
146062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPF5R, 15)),
146162306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(88, F8,
146262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 11),
146362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 11),
146462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 11),
146562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 11),
146662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 11),
146762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 11),
146862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 11),
146962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 11),
147062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 11),
147162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 11),
147262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 11),
147362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 11),
147462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 11),
147562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 11),
147662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPF8R, 1),
147762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPF8R, 2),
147862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPF8R, 4),
147962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPF8R, 5),
148062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPF8R, 7),
148162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPF8R, 8),
148262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPF8R, 9),
148362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPF8R, 10),
148462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPF8R, 11),
148562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPF8R, 12),
148662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPF8R, 14),
148762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPF8R, 15)),
148862306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(92, F12,
148962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 9),
149062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 9),
149162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 9),
149262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 9),
149362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 9),
149462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 9),
149562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 9),
149662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 9),
149762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 9),
149862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 9),
149962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 9),
150062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 9),
150162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 9),
150262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 9),
150362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPF12R, 1),
150462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPF12R, 2),
150562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPF12R, 4),
150662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPF12R, 5),
150762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPF12R, 7),
150862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPF12R, 8),
150962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPF12R, 9),
151062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPF12R, 10),
151162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPF12R, 11),
151262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPF12R, 12),
151362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPF12R, 14),
151462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPF12R, 15)),
151562306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(93, F13,
151662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 9),
151762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 9),
151862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 9),
151962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 9),
152062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 9),
152162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 9),
152262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 9),
152362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 9),
152462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 9),
152562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 9),
152662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 9),
152762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 9),
152862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPF13R, 1),
152962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPF13R, 2),
153062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPF13R, 3),
153162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPF13R, 4),
153262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPF13R, 6),
153362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPF13R, 8),
153462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPF13R, 10),
153562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPF13R, 11),
153662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPF13R, 12),
153762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPF13R, 13),
153862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPF13R, 15)),
153962306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(96, G0,
154062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 12),
154162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 12),
154262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 12),
154362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 12),
154462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 12),
154562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 12),
154662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 12),
154762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 12),
154862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 12),
154962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 12),
155062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 12),
155162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPG0R, 1),
155262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPG0R, 2),
155362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPG0R, 3),
155462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPG0R, 4),
155562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPG0R, 5),
155662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPG0R, 6),
155762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPG0R, 7),
155862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPG0R, 8),
155962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPG0R, 9),
156062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPG0R, 11),
156162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPG0R, 12),
156262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPG0R, 15)),
156362306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(97, G1,
156462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 12),
156562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 12),
156662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 12),
156762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 12),
156862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 12),
156962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 12),
157062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 12),
157162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 12),
157262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 12),
157362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 12),
157462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 12),
157562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 12),
157662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 12),
157762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 12),
157862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPG1R, 1),
157962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPG1R, 2),
158062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPG1R, 5),
158162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPG1R, 6),
158262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPG1R, 7),
158362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPG1R, 9),
158462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPG1R, 10),
158562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPG1R, 11),
158662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPG1R, 12),
158762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPG1R, 13),
158862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPG1R, 14),
158962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPG1R, 15)),
159062306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(102, G6,
159162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT2, INT2R, 1),
159262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T3CK, T3CKR, 1),
159362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T8CK, T8CKR, 1),
159462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC2, IC2R, 1),
159562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC5, IC5R, 1),
159662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC9, IC9R, 1),
159762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1CTS, U1CTSR, 1),
159862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RX, U2RXR, 1),
159962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5CTS, U5CTSR, 1),
160062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1IN, SS1INR, 1),
160162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3IN, SS3INR, 1),
160262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4IN, SS4INR, 1),
160362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5IN, SS5INR, 1),
160462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2RX, C2RXR, 1),
160562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RTS, RPG6R, 1),
160662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4TX, RPG6R, 2),
160762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPG6R, 4),
160862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS1OUT, RPG6R, 5),
160962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS3OUT, RPG6R, 7),
161062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS4OUT, RPG6R, 8),
161162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS5OUT, RPG6R, 9),
161262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPG6R, 10),
161362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC5, RPG6R, 11),
161462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC8, RPG6R, 12),
161562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1OUT, RPG6R, 14),
161662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO3, RPG6R, 15)),
161762306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(103, G7,
161862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT4, INT4R, 1),
161962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T5CK, T5CKR, 1),
162062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T7CK, T7CKR, 1),
162162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC4, IC4R, 1),
162262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC8, IC8R, 1),
162362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3RX, U3RXR, 1),
162462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4CTS, U4CTSR, 1),
162562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI2, SDI2R, 1),
162662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI4, SDI4R, 1),
162762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1RX, C1RXR, 1),
162862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI4, REFCLKI4R, 1),
162962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1TX, RPG7R, 1),
163062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2RTS, RPG7R, 2),
163162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5TX, RPG7R, 3),
163262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RTS, RPG7R, 4),
163362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPG7R, 5),
163462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPG7R, 6),
163562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPG7R, 7),
163662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPG7R, 8),
163762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPG7R, 9),
163862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC4, RPG7R, 11),
163962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC7, RPG7R, 12),
164062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO1, RPG7R, 15)),
164162306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(104, G8,
164262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT3, INT3R, 1),
164362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T2CK, T2CKR, 1),
164462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T6CK, T6CKR, 1),
164562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC3, IC3R, 1),
164662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC7, IC7R, 1),
164762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RX, U1RXR, 1),
164862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2CTS, U2CTSR, 1),
164962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RX, U5RXR, 1),
165062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6CTS, U6CTSR, 1),
165162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI1, SDI1R, 1),
165262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI3, SDI3R, 1),
165362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI5, SDI5R, 1),
165462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6IN, SS6INR, 1),
165562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI1, REFCLKI1R, 1),
165662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3TX, RPG8R, 1),
165762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RTS, RPG8R, 2),
165862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO1, RPG8R, 5),
165962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO2, RPG8R, 6),
166062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO3, RPG8R, 7),
166162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO5, RPG8R, 9),
166262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS6OUT, RPG8R, 10),
166362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC3, RPG8R, 11),
166462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC6, RPG8R, 12),
166562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKO4, RPG8R, 13),
166662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2OUT, RPG8R, 14),
166762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C1TX, RPG8R, 15)),
166862306a36Sopenharmony_ci	PIC32_PINCTRL_GROUP(105, G9,
166962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(INT1, INT1R, 1),
167062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T4CK, T4CKR, 1),
167162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(T9CK, T9CKR, 1),
167262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC1, IC1R, 1),
167362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(IC6, IC6R, 1),
167462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U3CTS, U3CTSR, 1),
167562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U4RX, U4RXR, 1),
167662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6RX, U6RXR, 1),
167762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2IN, SS2INR, 1),
167862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDI6, SDI6R, 1),
167962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OCFA, OCFAR, 1),
168062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(REFCLKI3, REFCLKI3R, 1),
168162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U1RTS, RPG9R, 1),
168262306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U2TX, RPG9R, 2),
168362306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U5RTS, RPG9R, 3),
168462306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(U6TX, RPG9R, 4),
168562306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SS2OUT, RPG9R, 6),
168662306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO4, RPG9R, 8),
168762306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(SDO6, RPG9R, 10),
168862306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC2, RPG9R, 11),
168962306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC1, RPG9R, 12),
169062306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(OC9, RPG9R, 13),
169162306a36Sopenharmony_ci			PIC32_PINCTRL_FUNCTION(C2TX, RPG9R, 15)),
169262306a36Sopenharmony_ci};
169362306a36Sopenharmony_ci
169462306a36Sopenharmony_cistatic inline struct pic32_gpio_bank *irqd_to_bank(struct irq_data *d)
169562306a36Sopenharmony_ci{
169662306a36Sopenharmony_ci	return gpiochip_get_data(irq_data_get_irq_chip_data(d));
169762306a36Sopenharmony_ci}
169862306a36Sopenharmony_ci
169962306a36Sopenharmony_cistatic inline struct pic32_gpio_bank *pctl_to_bank(struct pic32_pinctrl *pctl,
170062306a36Sopenharmony_ci						unsigned pin)
170162306a36Sopenharmony_ci{
170262306a36Sopenharmony_ci	return &pctl->gpio_banks[pin / PINS_PER_BANK];
170362306a36Sopenharmony_ci}
170462306a36Sopenharmony_ci
170562306a36Sopenharmony_cistatic int pic32_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
170662306a36Sopenharmony_ci{
170762306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
170862306a36Sopenharmony_ci
170962306a36Sopenharmony_ci	return pctl->ngroups;
171062306a36Sopenharmony_ci}
171162306a36Sopenharmony_ci
171262306a36Sopenharmony_cistatic const char *pic32_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
171362306a36Sopenharmony_ci						    unsigned group)
171462306a36Sopenharmony_ci{
171562306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
171662306a36Sopenharmony_ci
171762306a36Sopenharmony_ci	return pctl->groups[group].name;
171862306a36Sopenharmony_ci}
171962306a36Sopenharmony_ci
172062306a36Sopenharmony_cistatic int pic32_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
172162306a36Sopenharmony_ci					    unsigned group,
172262306a36Sopenharmony_ci					    const unsigned **pins,
172362306a36Sopenharmony_ci					    unsigned *num_pins)
172462306a36Sopenharmony_ci{
172562306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
172662306a36Sopenharmony_ci
172762306a36Sopenharmony_ci	*pins = &pctl->groups[group].pin;
172862306a36Sopenharmony_ci	*num_pins = 1;
172962306a36Sopenharmony_ci
173062306a36Sopenharmony_ci	return 0;
173162306a36Sopenharmony_ci}
173262306a36Sopenharmony_ci
173362306a36Sopenharmony_cistatic const struct pinctrl_ops pic32_pinctrl_ops = {
173462306a36Sopenharmony_ci	.get_groups_count = pic32_pinctrl_get_groups_count,
173562306a36Sopenharmony_ci	.get_group_name = pic32_pinctrl_get_group_name,
173662306a36Sopenharmony_ci	.get_group_pins = pic32_pinctrl_get_group_pins,
173762306a36Sopenharmony_ci	.dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
173862306a36Sopenharmony_ci	.dt_free_map = pinctrl_utils_free_map,
173962306a36Sopenharmony_ci};
174062306a36Sopenharmony_ci
174162306a36Sopenharmony_cistatic int pic32_pinmux_get_functions_count(struct pinctrl_dev *pctldev)
174262306a36Sopenharmony_ci{
174362306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
174462306a36Sopenharmony_ci
174562306a36Sopenharmony_ci	return pctl->nfunctions;
174662306a36Sopenharmony_ci}
174762306a36Sopenharmony_ci
174862306a36Sopenharmony_cistatic const char *
174962306a36Sopenharmony_cipic32_pinmux_get_function_name(struct pinctrl_dev *pctldev, unsigned func)
175062306a36Sopenharmony_ci{
175162306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
175262306a36Sopenharmony_ci
175362306a36Sopenharmony_ci	return pctl->functions[func].name;
175462306a36Sopenharmony_ci}
175562306a36Sopenharmony_ci
175662306a36Sopenharmony_cistatic int pic32_pinmux_get_function_groups(struct pinctrl_dev *pctldev,
175762306a36Sopenharmony_ci						unsigned func,
175862306a36Sopenharmony_ci						const char * const **groups,
175962306a36Sopenharmony_ci						unsigned * const num_groups)
176062306a36Sopenharmony_ci{
176162306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
176262306a36Sopenharmony_ci
176362306a36Sopenharmony_ci	*groups = pctl->functions[func].groups;
176462306a36Sopenharmony_ci	*num_groups = pctl->functions[func].ngroups;
176562306a36Sopenharmony_ci
176662306a36Sopenharmony_ci	return 0;
176762306a36Sopenharmony_ci}
176862306a36Sopenharmony_ci
176962306a36Sopenharmony_cistatic int pic32_pinmux_enable(struct pinctrl_dev *pctldev,
177062306a36Sopenharmony_ci				   unsigned func, unsigned group)
177162306a36Sopenharmony_ci{
177262306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
177362306a36Sopenharmony_ci	const struct pic32_pin_group *pg = &pctl->groups[group];
177462306a36Sopenharmony_ci	const struct pic32_function *pf = &pctl->functions[func];
177562306a36Sopenharmony_ci	const char *fname = pf->name;
177662306a36Sopenharmony_ci	struct pic32_desc_function *functions = pg->functions;
177762306a36Sopenharmony_ci
177862306a36Sopenharmony_ci	while (functions->name) {
177962306a36Sopenharmony_ci		if (!strcmp(functions->name, fname)) {
178062306a36Sopenharmony_ci			dev_dbg(pctl->dev,
178162306a36Sopenharmony_ci				"setting function %s reg 0x%x = %d\n",
178262306a36Sopenharmony_ci				fname, functions->muxreg, functions->muxval);
178362306a36Sopenharmony_ci
178462306a36Sopenharmony_ci			writel(functions->muxval, pctl->reg_base + functions->muxreg);
178562306a36Sopenharmony_ci
178662306a36Sopenharmony_ci			return 0;
178762306a36Sopenharmony_ci		}
178862306a36Sopenharmony_ci
178962306a36Sopenharmony_ci		functions++;
179062306a36Sopenharmony_ci	}
179162306a36Sopenharmony_ci
179262306a36Sopenharmony_ci	dev_err(pctl->dev, "cannot mux pin %u to function %u\n", group, func);
179362306a36Sopenharmony_ci
179462306a36Sopenharmony_ci	return -EINVAL;
179562306a36Sopenharmony_ci}
179662306a36Sopenharmony_ci
179762306a36Sopenharmony_cistatic int pic32_gpio_request_enable(struct pinctrl_dev *pctldev,
179862306a36Sopenharmony_ci				     struct pinctrl_gpio_range *range,
179962306a36Sopenharmony_ci				     unsigned offset)
180062306a36Sopenharmony_ci{
180162306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
180262306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(range->gc);
180362306a36Sopenharmony_ci	u32 mask = BIT(offset - bank->gpio_chip.base);
180462306a36Sopenharmony_ci
180562306a36Sopenharmony_ci	dev_dbg(pctl->dev, "requesting gpio %d in bank %d with mask 0x%x\n",
180662306a36Sopenharmony_ci		offset, bank->gpio_chip.base, mask);
180762306a36Sopenharmony_ci
180862306a36Sopenharmony_ci	writel(mask, bank->reg_base + PIC32_CLR(ANSEL_REG));
180962306a36Sopenharmony_ci
181062306a36Sopenharmony_ci	return 0;
181162306a36Sopenharmony_ci}
181262306a36Sopenharmony_ci
181362306a36Sopenharmony_cistatic int pic32_gpio_direction_input(struct gpio_chip *chip,
181462306a36Sopenharmony_ci					  unsigned offset)
181562306a36Sopenharmony_ci{
181662306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
181762306a36Sopenharmony_ci	u32 mask = BIT(offset);
181862306a36Sopenharmony_ci
181962306a36Sopenharmony_ci	writel(mask, bank->reg_base + PIC32_SET(TRIS_REG));
182062306a36Sopenharmony_ci
182162306a36Sopenharmony_ci	return 0;
182262306a36Sopenharmony_ci}
182362306a36Sopenharmony_ci
182462306a36Sopenharmony_cistatic int pic32_gpio_get(struct gpio_chip *chip, unsigned offset)
182562306a36Sopenharmony_ci{
182662306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
182762306a36Sopenharmony_ci
182862306a36Sopenharmony_ci	return !!(readl(bank->reg_base + PORT_REG) & BIT(offset));
182962306a36Sopenharmony_ci}
183062306a36Sopenharmony_ci
183162306a36Sopenharmony_cistatic void pic32_gpio_set(struct gpio_chip *chip, unsigned offset,
183262306a36Sopenharmony_ci			       int value)
183362306a36Sopenharmony_ci{
183462306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
183562306a36Sopenharmony_ci	u32 mask = BIT(offset);
183662306a36Sopenharmony_ci
183762306a36Sopenharmony_ci	if (value)
183862306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_SET(PORT_REG));
183962306a36Sopenharmony_ci	else
184062306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_CLR(PORT_REG));
184162306a36Sopenharmony_ci}
184262306a36Sopenharmony_ci
184362306a36Sopenharmony_cistatic int pic32_gpio_direction_output(struct gpio_chip *chip,
184462306a36Sopenharmony_ci					   unsigned offset, int value)
184562306a36Sopenharmony_ci{
184662306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
184762306a36Sopenharmony_ci	u32 mask = BIT(offset);
184862306a36Sopenharmony_ci
184962306a36Sopenharmony_ci	pic32_gpio_set(chip, offset, value);
185062306a36Sopenharmony_ci	writel(mask, bank->reg_base + PIC32_CLR(TRIS_REG));
185162306a36Sopenharmony_ci
185262306a36Sopenharmony_ci	return 0;
185362306a36Sopenharmony_ci}
185462306a36Sopenharmony_ci
185562306a36Sopenharmony_cistatic int pic32_gpio_set_direction(struct pinctrl_dev *pctldev,
185662306a36Sopenharmony_ci					      struct pinctrl_gpio_range *range,
185762306a36Sopenharmony_ci					      unsigned offset, bool input)
185862306a36Sopenharmony_ci{
185962306a36Sopenharmony_ci	struct gpio_chip *chip = range->gc;
186062306a36Sopenharmony_ci
186162306a36Sopenharmony_ci	if (input)
186262306a36Sopenharmony_ci		pic32_gpio_direction_input(chip, offset);
186362306a36Sopenharmony_ci	else
186462306a36Sopenharmony_ci		pic32_gpio_direction_output(chip, offset, 0);
186562306a36Sopenharmony_ci
186662306a36Sopenharmony_ci	return 0;
186762306a36Sopenharmony_ci}
186862306a36Sopenharmony_ci
186962306a36Sopenharmony_cistatic const struct pinmux_ops pic32_pinmux_ops = {
187062306a36Sopenharmony_ci	.get_functions_count = pic32_pinmux_get_functions_count,
187162306a36Sopenharmony_ci	.get_function_name = pic32_pinmux_get_function_name,
187262306a36Sopenharmony_ci	.get_function_groups = pic32_pinmux_get_function_groups,
187362306a36Sopenharmony_ci	.set_mux = pic32_pinmux_enable,
187462306a36Sopenharmony_ci	.gpio_request_enable = pic32_gpio_request_enable,
187562306a36Sopenharmony_ci	.gpio_set_direction = pic32_gpio_set_direction,
187662306a36Sopenharmony_ci};
187762306a36Sopenharmony_ci
187862306a36Sopenharmony_cistatic int pic32_pinconf_get(struct pinctrl_dev *pctldev, unsigned pin,
187962306a36Sopenharmony_ci				 unsigned long *config)
188062306a36Sopenharmony_ci{
188162306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
188262306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = pctl_to_bank(pctl, pin);
188362306a36Sopenharmony_ci	unsigned param = pinconf_to_config_param(*config);
188462306a36Sopenharmony_ci	u32 mask = BIT(pin - bank->gpio_chip.base);
188562306a36Sopenharmony_ci	u32 arg;
188662306a36Sopenharmony_ci
188762306a36Sopenharmony_ci	switch (param) {
188862306a36Sopenharmony_ci	case PIN_CONFIG_BIAS_PULL_UP:
188962306a36Sopenharmony_ci		arg = !!(readl(bank->reg_base + CNPU_REG) & mask);
189062306a36Sopenharmony_ci		break;
189162306a36Sopenharmony_ci	case PIN_CONFIG_BIAS_PULL_DOWN:
189262306a36Sopenharmony_ci		arg = !!(readl(bank->reg_base + CNPD_REG) & mask);
189362306a36Sopenharmony_ci		break;
189462306a36Sopenharmony_ci	case PIN_CONFIG_MICROCHIP_DIGITAL:
189562306a36Sopenharmony_ci		arg = !(readl(bank->reg_base + ANSEL_REG) & mask);
189662306a36Sopenharmony_ci		break;
189762306a36Sopenharmony_ci	case PIN_CONFIG_MICROCHIP_ANALOG:
189862306a36Sopenharmony_ci		arg = !!(readl(bank->reg_base + ANSEL_REG) & mask);
189962306a36Sopenharmony_ci		break;
190062306a36Sopenharmony_ci	case PIN_CONFIG_DRIVE_OPEN_DRAIN:
190162306a36Sopenharmony_ci		arg = !!(readl(bank->reg_base + ODCU_REG) & mask);
190262306a36Sopenharmony_ci		break;
190362306a36Sopenharmony_ci	case PIN_CONFIG_INPUT_ENABLE:
190462306a36Sopenharmony_ci		arg = !!(readl(bank->reg_base + TRIS_REG) & mask);
190562306a36Sopenharmony_ci		break;
190662306a36Sopenharmony_ci	case PIN_CONFIG_OUTPUT:
190762306a36Sopenharmony_ci		arg = !(readl(bank->reg_base + TRIS_REG) & mask);
190862306a36Sopenharmony_ci		break;
190962306a36Sopenharmony_ci	default:
191062306a36Sopenharmony_ci		dev_err(pctl->dev, "Property %u not supported\n", param);
191162306a36Sopenharmony_ci		return -ENOTSUPP;
191262306a36Sopenharmony_ci	}
191362306a36Sopenharmony_ci
191462306a36Sopenharmony_ci	*config = pinconf_to_config_packed(param, arg);
191562306a36Sopenharmony_ci
191662306a36Sopenharmony_ci	return 0;
191762306a36Sopenharmony_ci}
191862306a36Sopenharmony_ci
191962306a36Sopenharmony_cistatic int pic32_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin,
192062306a36Sopenharmony_ci				 unsigned long *configs, unsigned num_configs)
192162306a36Sopenharmony_ci{
192262306a36Sopenharmony_ci	struct pic32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
192362306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = pctl_to_bank(pctl, pin);
192462306a36Sopenharmony_ci	unsigned param;
192562306a36Sopenharmony_ci	u32 arg;
192662306a36Sopenharmony_ci	unsigned int i;
192762306a36Sopenharmony_ci	u32 offset = pin - bank->gpio_chip.base;
192862306a36Sopenharmony_ci	u32 mask = BIT(offset);
192962306a36Sopenharmony_ci
193062306a36Sopenharmony_ci	dev_dbg(pctl->dev, "setting pin %d bank %d mask 0x%x\n",
193162306a36Sopenharmony_ci		pin, bank->gpio_chip.base, mask);
193262306a36Sopenharmony_ci
193362306a36Sopenharmony_ci	for (i = 0; i < num_configs; i++) {
193462306a36Sopenharmony_ci		param = pinconf_to_config_param(configs[i]);
193562306a36Sopenharmony_ci		arg = pinconf_to_config_argument(configs[i]);
193662306a36Sopenharmony_ci
193762306a36Sopenharmony_ci		switch (param) {
193862306a36Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_UP:
193962306a36Sopenharmony_ci			dev_dbg(pctl->dev, "   pullup\n");
194062306a36Sopenharmony_ci			writel(mask, bank->reg_base +PIC32_SET(CNPU_REG));
194162306a36Sopenharmony_ci			break;
194262306a36Sopenharmony_ci		case PIN_CONFIG_BIAS_PULL_DOWN:
194362306a36Sopenharmony_ci			dev_dbg(pctl->dev, "   pulldown\n");
194462306a36Sopenharmony_ci			writel(mask, bank->reg_base + PIC32_SET(CNPD_REG));
194562306a36Sopenharmony_ci			break;
194662306a36Sopenharmony_ci		case PIN_CONFIG_MICROCHIP_DIGITAL:
194762306a36Sopenharmony_ci			dev_dbg(pctl->dev, "   digital\n");
194862306a36Sopenharmony_ci			writel(mask, bank->reg_base + PIC32_CLR(ANSEL_REG));
194962306a36Sopenharmony_ci			break;
195062306a36Sopenharmony_ci		case PIN_CONFIG_MICROCHIP_ANALOG:
195162306a36Sopenharmony_ci			dev_dbg(pctl->dev, "   analog\n");
195262306a36Sopenharmony_ci			writel(mask, bank->reg_base + PIC32_SET(ANSEL_REG));
195362306a36Sopenharmony_ci			break;
195462306a36Sopenharmony_ci		case PIN_CONFIG_DRIVE_OPEN_DRAIN:
195562306a36Sopenharmony_ci			dev_dbg(pctl->dev, "   opendrain\n");
195662306a36Sopenharmony_ci			writel(mask, bank->reg_base + PIC32_SET(ODCU_REG));
195762306a36Sopenharmony_ci			break;
195862306a36Sopenharmony_ci		case PIN_CONFIG_INPUT_ENABLE:
195962306a36Sopenharmony_ci			pic32_gpio_direction_input(&bank->gpio_chip, offset);
196062306a36Sopenharmony_ci			break;
196162306a36Sopenharmony_ci		case PIN_CONFIG_OUTPUT:
196262306a36Sopenharmony_ci			pic32_gpio_direction_output(&bank->gpio_chip,
196362306a36Sopenharmony_ci						    offset, arg);
196462306a36Sopenharmony_ci			break;
196562306a36Sopenharmony_ci		default:
196662306a36Sopenharmony_ci			dev_err(pctl->dev, "Property %u not supported\n",
196762306a36Sopenharmony_ci				param);
196862306a36Sopenharmony_ci			return -ENOTSUPP;
196962306a36Sopenharmony_ci		}
197062306a36Sopenharmony_ci	}
197162306a36Sopenharmony_ci
197262306a36Sopenharmony_ci	return 0;
197362306a36Sopenharmony_ci}
197462306a36Sopenharmony_ci
197562306a36Sopenharmony_cistatic const struct pinconf_ops pic32_pinconf_ops = {
197662306a36Sopenharmony_ci	.pin_config_get = pic32_pinconf_get,
197762306a36Sopenharmony_ci	.pin_config_set = pic32_pinconf_set,
197862306a36Sopenharmony_ci	.is_generic = true,
197962306a36Sopenharmony_ci};
198062306a36Sopenharmony_ci
198162306a36Sopenharmony_cistatic struct pinctrl_desc pic32_pinctrl_desc = {
198262306a36Sopenharmony_ci	.name = "pic32-pinctrl",
198362306a36Sopenharmony_ci	.pctlops = &pic32_pinctrl_ops,
198462306a36Sopenharmony_ci	.pmxops = &pic32_pinmux_ops,
198562306a36Sopenharmony_ci	.confops = &pic32_pinconf_ops,
198662306a36Sopenharmony_ci	.owner = THIS_MODULE,
198762306a36Sopenharmony_ci};
198862306a36Sopenharmony_ci
198962306a36Sopenharmony_cistatic int pic32_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
199062306a36Sopenharmony_ci{
199162306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(chip);
199262306a36Sopenharmony_ci
199362306a36Sopenharmony_ci	if (readl(bank->reg_base + TRIS_REG) & BIT(offset))
199462306a36Sopenharmony_ci		return GPIO_LINE_DIRECTION_IN;
199562306a36Sopenharmony_ci
199662306a36Sopenharmony_ci	return GPIO_LINE_DIRECTION_OUT;
199762306a36Sopenharmony_ci}
199862306a36Sopenharmony_ci
199962306a36Sopenharmony_cistatic void pic32_gpio_irq_ack(struct irq_data *data)
200062306a36Sopenharmony_ci{
200162306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = irqd_to_bank(data);
200262306a36Sopenharmony_ci
200362306a36Sopenharmony_ci	writel(0, bank->reg_base + CNF_REG);
200462306a36Sopenharmony_ci}
200562306a36Sopenharmony_ci
200662306a36Sopenharmony_cistatic void pic32_gpio_irq_mask(struct irq_data *data)
200762306a36Sopenharmony_ci{
200862306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = irqd_to_bank(data);
200962306a36Sopenharmony_ci
201062306a36Sopenharmony_ci	writel(BIT(PIC32_CNCON_ON), bank->reg_base + PIC32_CLR(CNCON_REG));
201162306a36Sopenharmony_ci	gpiochip_disable_irq(&bank->gpio_chip, irqd_to_hwirq(data));
201262306a36Sopenharmony_ci}
201362306a36Sopenharmony_ci
201462306a36Sopenharmony_cistatic void pic32_gpio_irq_unmask(struct irq_data *data)
201562306a36Sopenharmony_ci{
201662306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = irqd_to_bank(data);
201762306a36Sopenharmony_ci
201862306a36Sopenharmony_ci	gpiochip_enable_irq(&bank->gpio_chip, irqd_to_hwirq(data));
201962306a36Sopenharmony_ci	writel(BIT(PIC32_CNCON_ON), bank->reg_base + PIC32_SET(CNCON_REG));
202062306a36Sopenharmony_ci}
202162306a36Sopenharmony_ci
202262306a36Sopenharmony_cistatic unsigned int pic32_gpio_irq_startup(struct irq_data *data)
202362306a36Sopenharmony_ci{
202462306a36Sopenharmony_ci	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
202562306a36Sopenharmony_ci
202662306a36Sopenharmony_ci	pic32_gpio_direction_input(chip, data->hwirq);
202762306a36Sopenharmony_ci	pic32_gpio_irq_unmask(data);
202862306a36Sopenharmony_ci
202962306a36Sopenharmony_ci	return 0;
203062306a36Sopenharmony_ci}
203162306a36Sopenharmony_ci
203262306a36Sopenharmony_cistatic int pic32_gpio_irq_set_type(struct irq_data *data, unsigned int type)
203362306a36Sopenharmony_ci{
203462306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = irqd_to_bank(data);
203562306a36Sopenharmony_ci	u32 mask = irqd_to_hwirq(data);
203662306a36Sopenharmony_ci
203762306a36Sopenharmony_ci	switch (type & IRQ_TYPE_SENSE_MASK) {
203862306a36Sopenharmony_ci	case IRQ_TYPE_EDGE_RISING:
203962306a36Sopenharmony_ci		/* enable RISE */
204062306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_SET(CNEN_REG));
204162306a36Sopenharmony_ci		/* disable FALL */
204262306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_CLR(CNNE_REG));
204362306a36Sopenharmony_ci		/* enable EDGE */
204462306a36Sopenharmony_ci		writel(BIT(PIC32_CNCON_EDGE), bank->reg_base + PIC32_SET(CNCON_REG));
204562306a36Sopenharmony_ci		break;
204662306a36Sopenharmony_ci	case IRQ_TYPE_EDGE_FALLING:
204762306a36Sopenharmony_ci		/* disable RISE */
204862306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_CLR(CNEN_REG));
204962306a36Sopenharmony_ci		/* enable FALL */
205062306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_SET(CNNE_REG));
205162306a36Sopenharmony_ci		/* enable EDGE */
205262306a36Sopenharmony_ci		writel(BIT(PIC32_CNCON_EDGE), bank->reg_base + PIC32_SET(CNCON_REG));
205362306a36Sopenharmony_ci		break;
205462306a36Sopenharmony_ci	case IRQ_TYPE_EDGE_BOTH:
205562306a36Sopenharmony_ci		/* enable RISE */
205662306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_SET(CNEN_REG));
205762306a36Sopenharmony_ci		/* enable FALL */
205862306a36Sopenharmony_ci		writel(mask, bank->reg_base + PIC32_SET(CNNE_REG));
205962306a36Sopenharmony_ci		/* enable EDGE */
206062306a36Sopenharmony_ci		writel(BIT(PIC32_CNCON_EDGE), bank->reg_base + PIC32_SET(CNCON_REG));
206162306a36Sopenharmony_ci		break;
206262306a36Sopenharmony_ci	default:
206362306a36Sopenharmony_ci		return -EINVAL;
206462306a36Sopenharmony_ci	}
206562306a36Sopenharmony_ci
206662306a36Sopenharmony_ci	irq_set_handler_locked(data, handle_edge_irq);
206762306a36Sopenharmony_ci
206862306a36Sopenharmony_ci	return 0;
206962306a36Sopenharmony_ci}
207062306a36Sopenharmony_ci
207162306a36Sopenharmony_cistatic u32 pic32_gpio_get_pending(struct gpio_chip *gc, unsigned long status)
207262306a36Sopenharmony_ci{
207362306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(gc);
207462306a36Sopenharmony_ci	u32 pending = 0;
207562306a36Sopenharmony_ci	u32 cnen_rise, cnne_fall;
207662306a36Sopenharmony_ci	u32 pin;
207762306a36Sopenharmony_ci
207862306a36Sopenharmony_ci	cnen_rise = readl(bank->reg_base + CNEN_REG);
207962306a36Sopenharmony_ci	cnne_fall = readl(bank->reg_base + CNNE_REG);
208062306a36Sopenharmony_ci
208162306a36Sopenharmony_ci	for_each_set_bit(pin, &status, BITS_PER_LONG) {
208262306a36Sopenharmony_ci		u32 mask = BIT(pin);
208362306a36Sopenharmony_ci
208462306a36Sopenharmony_ci		if ((mask & cnen_rise) || (mask && cnne_fall))
208562306a36Sopenharmony_ci			pending |= mask;
208662306a36Sopenharmony_ci	}
208762306a36Sopenharmony_ci
208862306a36Sopenharmony_ci	return pending;
208962306a36Sopenharmony_ci}
209062306a36Sopenharmony_ci
209162306a36Sopenharmony_cistatic void pic32_gpio_irq_handler(struct irq_desc *desc)
209262306a36Sopenharmony_ci{
209362306a36Sopenharmony_ci	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
209462306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = gpiochip_get_data(gc);
209562306a36Sopenharmony_ci	struct irq_chip *chip = irq_desc_get_chip(desc);
209662306a36Sopenharmony_ci	unsigned long pending;
209762306a36Sopenharmony_ci	unsigned int pin;
209862306a36Sopenharmony_ci	u32 stat;
209962306a36Sopenharmony_ci
210062306a36Sopenharmony_ci	chained_irq_enter(chip, desc);
210162306a36Sopenharmony_ci
210262306a36Sopenharmony_ci	stat = readl(bank->reg_base + CNF_REG);
210362306a36Sopenharmony_ci	pending = pic32_gpio_get_pending(gc, stat);
210462306a36Sopenharmony_ci
210562306a36Sopenharmony_ci	for_each_set_bit(pin, &pending, BITS_PER_LONG)
210662306a36Sopenharmony_ci		generic_handle_domain_irq(gc->irq.domain, pin);
210762306a36Sopenharmony_ci
210862306a36Sopenharmony_ci	chained_irq_exit(chip, desc);
210962306a36Sopenharmony_ci}
211062306a36Sopenharmony_ci
211162306a36Sopenharmony_ci#define GPIO_BANK(_bank, _npins)					\
211262306a36Sopenharmony_ci	{								\
211362306a36Sopenharmony_ci		.gpio_chip = {						\
211462306a36Sopenharmony_ci			.label = "GPIO" #_bank,				\
211562306a36Sopenharmony_ci			.request = gpiochip_generic_request,		\
211662306a36Sopenharmony_ci			.free = gpiochip_generic_free,			\
211762306a36Sopenharmony_ci			.get_direction = pic32_gpio_get_direction,	\
211862306a36Sopenharmony_ci			.direction_input = pic32_gpio_direction_input,	\
211962306a36Sopenharmony_ci			.direction_output = pic32_gpio_direction_output, \
212062306a36Sopenharmony_ci			.get = pic32_gpio_get,				\
212162306a36Sopenharmony_ci			.set = pic32_gpio_set,				\
212262306a36Sopenharmony_ci			.ngpio = _npins,				\
212362306a36Sopenharmony_ci			.base = GPIO_BANK_START(_bank),			\
212462306a36Sopenharmony_ci			.owner = THIS_MODULE,				\
212562306a36Sopenharmony_ci			.can_sleep = 0,					\
212662306a36Sopenharmony_ci		},							\
212762306a36Sopenharmony_ci		.instance = (_bank),					\
212862306a36Sopenharmony_ci	}
212962306a36Sopenharmony_ci
213062306a36Sopenharmony_cistatic struct pic32_gpio_bank pic32_gpio_banks[] = {
213162306a36Sopenharmony_ci	GPIO_BANK(0, PINS_PER_BANK),
213262306a36Sopenharmony_ci	GPIO_BANK(1, PINS_PER_BANK),
213362306a36Sopenharmony_ci	GPIO_BANK(2, PINS_PER_BANK),
213462306a36Sopenharmony_ci	GPIO_BANK(3, PINS_PER_BANK),
213562306a36Sopenharmony_ci	GPIO_BANK(4, PINS_PER_BANK),
213662306a36Sopenharmony_ci	GPIO_BANK(5, PINS_PER_BANK),
213762306a36Sopenharmony_ci	GPIO_BANK(6, PINS_PER_BANK),
213862306a36Sopenharmony_ci	GPIO_BANK(7, PINS_PER_BANK),
213962306a36Sopenharmony_ci	GPIO_BANK(8, PINS_PER_BANK),
214062306a36Sopenharmony_ci	GPIO_BANK(9, PINS_PER_BANK),
214162306a36Sopenharmony_ci};
214262306a36Sopenharmony_ci
214362306a36Sopenharmony_cistatic void pic32_gpio_irq_print_chip(struct irq_data *data, struct seq_file *p)
214462306a36Sopenharmony_ci{
214562306a36Sopenharmony_ci	struct pic32_gpio_bank *bank = irqd_to_bank(data);
214662306a36Sopenharmony_ci
214762306a36Sopenharmony_ci	seq_printf(p, "GPIO%d", bank->instance);
214862306a36Sopenharmony_ci}
214962306a36Sopenharmony_ci
215062306a36Sopenharmony_cistatic const struct irq_chip pic32_gpio_irq_chip = {
215162306a36Sopenharmony_ci	.irq_startup = pic32_gpio_irq_startup,
215262306a36Sopenharmony_ci	.irq_ack = pic32_gpio_irq_ack,
215362306a36Sopenharmony_ci	.irq_mask = pic32_gpio_irq_mask,
215462306a36Sopenharmony_ci	.irq_unmask = pic32_gpio_irq_unmask,
215562306a36Sopenharmony_ci	.irq_set_type = pic32_gpio_irq_set_type,
215662306a36Sopenharmony_ci	.irq_print_chip = pic32_gpio_irq_print_chip,
215762306a36Sopenharmony_ci	.flags = IRQCHIP_IMMUTABLE,
215862306a36Sopenharmony_ci	GPIOCHIP_IRQ_RESOURCE_HELPERS,
215962306a36Sopenharmony_ci};
216062306a36Sopenharmony_ci
216162306a36Sopenharmony_cistatic int pic32_pinctrl_probe(struct platform_device *pdev)
216262306a36Sopenharmony_ci{
216362306a36Sopenharmony_ci	struct pic32_pinctrl *pctl;
216462306a36Sopenharmony_ci	int ret;
216562306a36Sopenharmony_ci
216662306a36Sopenharmony_ci	pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
216762306a36Sopenharmony_ci	if (!pctl)
216862306a36Sopenharmony_ci		return -ENOMEM;
216962306a36Sopenharmony_ci	pctl->dev = &pdev->dev;
217062306a36Sopenharmony_ci	dev_set_drvdata(&pdev->dev, pctl);
217162306a36Sopenharmony_ci
217262306a36Sopenharmony_ci	pctl->reg_base = devm_platform_ioremap_resource(pdev, 0);
217362306a36Sopenharmony_ci	if (IS_ERR(pctl->reg_base))
217462306a36Sopenharmony_ci		return PTR_ERR(pctl->reg_base);
217562306a36Sopenharmony_ci
217662306a36Sopenharmony_ci	pctl->clk = devm_clk_get(&pdev->dev, NULL);
217762306a36Sopenharmony_ci	if (IS_ERR(pctl->clk)) {
217862306a36Sopenharmony_ci		ret = PTR_ERR(pctl->clk);
217962306a36Sopenharmony_ci		dev_err(&pdev->dev, "clk get failed\n");
218062306a36Sopenharmony_ci		return ret;
218162306a36Sopenharmony_ci	}
218262306a36Sopenharmony_ci
218362306a36Sopenharmony_ci	ret = clk_prepare_enable(pctl->clk);
218462306a36Sopenharmony_ci	if (ret) {
218562306a36Sopenharmony_ci		dev_err(&pdev->dev, "clk enable failed\n");
218662306a36Sopenharmony_ci		return ret;
218762306a36Sopenharmony_ci	}
218862306a36Sopenharmony_ci
218962306a36Sopenharmony_ci	pctl->pins = pic32_pins;
219062306a36Sopenharmony_ci	pctl->npins = ARRAY_SIZE(pic32_pins);
219162306a36Sopenharmony_ci	pctl->functions = pic32_functions;
219262306a36Sopenharmony_ci	pctl->nfunctions = ARRAY_SIZE(pic32_functions);
219362306a36Sopenharmony_ci	pctl->groups = pic32_groups;
219462306a36Sopenharmony_ci	pctl->ngroups = ARRAY_SIZE(pic32_groups);
219562306a36Sopenharmony_ci	pctl->gpio_banks = pic32_gpio_banks;
219662306a36Sopenharmony_ci	pctl->nbanks = ARRAY_SIZE(pic32_gpio_banks);
219762306a36Sopenharmony_ci
219862306a36Sopenharmony_ci	pic32_pinctrl_desc.pins = pctl->pins;
219962306a36Sopenharmony_ci	pic32_pinctrl_desc.npins = pctl->npins;
220062306a36Sopenharmony_ci	pic32_pinctrl_desc.custom_params = pic32_mpp_bindings;
220162306a36Sopenharmony_ci	pic32_pinctrl_desc.num_custom_params = ARRAY_SIZE(pic32_mpp_bindings);
220262306a36Sopenharmony_ci
220362306a36Sopenharmony_ci	pctl->pctldev = devm_pinctrl_register(&pdev->dev, &pic32_pinctrl_desc,
220462306a36Sopenharmony_ci					      pctl);
220562306a36Sopenharmony_ci	if (IS_ERR(pctl->pctldev)) {
220662306a36Sopenharmony_ci		dev_err(&pdev->dev, "Failed to register pinctrl device\n");
220762306a36Sopenharmony_ci		return PTR_ERR(pctl->pctldev);
220862306a36Sopenharmony_ci	}
220962306a36Sopenharmony_ci
221062306a36Sopenharmony_ci	return 0;
221162306a36Sopenharmony_ci}
221262306a36Sopenharmony_ci
221362306a36Sopenharmony_cistatic int pic32_gpio_probe(struct platform_device *pdev)
221462306a36Sopenharmony_ci{
221562306a36Sopenharmony_ci	struct device_node *np = pdev->dev.of_node;
221662306a36Sopenharmony_ci	struct pic32_gpio_bank *bank;
221762306a36Sopenharmony_ci	u32 id;
221862306a36Sopenharmony_ci	int irq, ret;
221962306a36Sopenharmony_ci	struct gpio_irq_chip *girq;
222062306a36Sopenharmony_ci
222162306a36Sopenharmony_ci	if (of_property_read_u32(np, "microchip,gpio-bank", &id)) {
222262306a36Sopenharmony_ci		dev_err(&pdev->dev, "microchip,gpio-bank property not found\n");
222362306a36Sopenharmony_ci		return -EINVAL;
222462306a36Sopenharmony_ci	}
222562306a36Sopenharmony_ci
222662306a36Sopenharmony_ci	if (id >= ARRAY_SIZE(pic32_gpio_banks)) {
222762306a36Sopenharmony_ci		dev_err(&pdev->dev, "invalid microchip,gpio-bank property\n");
222862306a36Sopenharmony_ci		return -EINVAL;
222962306a36Sopenharmony_ci	}
223062306a36Sopenharmony_ci
223162306a36Sopenharmony_ci	bank = &pic32_gpio_banks[id];
223262306a36Sopenharmony_ci
223362306a36Sopenharmony_ci	bank->reg_base = devm_platform_ioremap_resource(pdev, 0);
223462306a36Sopenharmony_ci	if (IS_ERR(bank->reg_base))
223562306a36Sopenharmony_ci		return PTR_ERR(bank->reg_base);
223662306a36Sopenharmony_ci
223762306a36Sopenharmony_ci	irq = platform_get_irq(pdev, 0);
223862306a36Sopenharmony_ci	if (irq < 0)
223962306a36Sopenharmony_ci		return irq;
224062306a36Sopenharmony_ci
224162306a36Sopenharmony_ci	bank->clk = devm_clk_get(&pdev->dev, NULL);
224262306a36Sopenharmony_ci	if (IS_ERR(bank->clk)) {
224362306a36Sopenharmony_ci		ret = PTR_ERR(bank->clk);
224462306a36Sopenharmony_ci		dev_err(&pdev->dev, "clk get failed\n");
224562306a36Sopenharmony_ci		return ret;
224662306a36Sopenharmony_ci	}
224762306a36Sopenharmony_ci
224862306a36Sopenharmony_ci	ret = clk_prepare_enable(bank->clk);
224962306a36Sopenharmony_ci	if (ret) {
225062306a36Sopenharmony_ci		dev_err(&pdev->dev, "clk enable failed\n");
225162306a36Sopenharmony_ci		return ret;
225262306a36Sopenharmony_ci	}
225362306a36Sopenharmony_ci
225462306a36Sopenharmony_ci	bank->gpio_chip.parent = &pdev->dev;
225562306a36Sopenharmony_ci
225662306a36Sopenharmony_ci	girq = &bank->gpio_chip.irq;
225762306a36Sopenharmony_ci	gpio_irq_chip_set_chip(girq, &pic32_gpio_irq_chip);
225862306a36Sopenharmony_ci	girq->parent_handler = pic32_gpio_irq_handler;
225962306a36Sopenharmony_ci	girq->num_parents = 1;
226062306a36Sopenharmony_ci	girq->parents = devm_kcalloc(&pdev->dev, 1, sizeof(*girq->parents),
226162306a36Sopenharmony_ci				     GFP_KERNEL);
226262306a36Sopenharmony_ci	if (!girq->parents)
226362306a36Sopenharmony_ci		return -ENOMEM;
226462306a36Sopenharmony_ci	girq->default_type = IRQ_TYPE_NONE;
226562306a36Sopenharmony_ci	girq->handler = handle_level_irq;
226662306a36Sopenharmony_ci	girq->parents[0] = irq;
226762306a36Sopenharmony_ci	ret = gpiochip_add_data(&bank->gpio_chip, bank);
226862306a36Sopenharmony_ci	if (ret < 0) {
226962306a36Sopenharmony_ci		dev_err(&pdev->dev, "Failed to add GPIO chip %u: %d\n",
227062306a36Sopenharmony_ci			id, ret);
227162306a36Sopenharmony_ci		return ret;
227262306a36Sopenharmony_ci	}
227362306a36Sopenharmony_ci	return 0;
227462306a36Sopenharmony_ci}
227562306a36Sopenharmony_ci
227662306a36Sopenharmony_cistatic const struct of_device_id pic32_pinctrl_of_match[] = {
227762306a36Sopenharmony_ci	{ .compatible = "microchip,pic32mzda-pinctrl", },
227862306a36Sopenharmony_ci	{ },
227962306a36Sopenharmony_ci};
228062306a36Sopenharmony_ci
228162306a36Sopenharmony_cistatic struct platform_driver pic32_pinctrl_driver = {
228262306a36Sopenharmony_ci	.driver = {
228362306a36Sopenharmony_ci		.name = "pic32-pinctrl",
228462306a36Sopenharmony_ci		.of_match_table = pic32_pinctrl_of_match,
228562306a36Sopenharmony_ci		.suppress_bind_attrs = true,
228662306a36Sopenharmony_ci	},
228762306a36Sopenharmony_ci	.probe = pic32_pinctrl_probe,
228862306a36Sopenharmony_ci};
228962306a36Sopenharmony_ci
229062306a36Sopenharmony_cistatic const struct of_device_id pic32_gpio_of_match[] = {
229162306a36Sopenharmony_ci	{ .compatible = "microchip,pic32mzda-gpio", },
229262306a36Sopenharmony_ci	{ },
229362306a36Sopenharmony_ci};
229462306a36Sopenharmony_ci
229562306a36Sopenharmony_cistatic struct platform_driver pic32_gpio_driver = {
229662306a36Sopenharmony_ci	.driver = {
229762306a36Sopenharmony_ci		.name = "pic32-gpio",
229862306a36Sopenharmony_ci		.of_match_table = pic32_gpio_of_match,
229962306a36Sopenharmony_ci		.suppress_bind_attrs = true,
230062306a36Sopenharmony_ci	},
230162306a36Sopenharmony_ci	.probe = pic32_gpio_probe,
230262306a36Sopenharmony_ci};
230362306a36Sopenharmony_ci
230462306a36Sopenharmony_cistatic int __init pic32_gpio_register(void)
230562306a36Sopenharmony_ci{
230662306a36Sopenharmony_ci	return platform_driver_register(&pic32_gpio_driver);
230762306a36Sopenharmony_ci}
230862306a36Sopenharmony_ciarch_initcall(pic32_gpio_register);
230962306a36Sopenharmony_ci
231062306a36Sopenharmony_cistatic int __init pic32_pinctrl_register(void)
231162306a36Sopenharmony_ci{
231262306a36Sopenharmony_ci	return platform_driver_register(&pic32_pinctrl_driver);
231362306a36Sopenharmony_ci}
231462306a36Sopenharmony_ciarch_initcall(pic32_pinctrl_register);
2315