162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Intel Merrifield SoC pinctrl driver
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2016, Intel Corporation
662306a36Sopenharmony_ci * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include <linux/init.h>
1062306a36Sopenharmony_ci#include <linux/kernel.h>
1162306a36Sopenharmony_ci#include <linux/mod_devicetable.h>
1262306a36Sopenharmony_ci#include <linux/module.h>
1362306a36Sopenharmony_ci#include <linux/platform_device.h>
1462306a36Sopenharmony_ci#include <linux/types.h>
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#include "pinctrl-intel.h"
1962306a36Sopenharmony_ci#include "pinctrl-tangier.h"
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_cistatic const struct pinctrl_pin_desc mrfld_pins[] = {
2262306a36Sopenharmony_ci	/* Family 0: OCP2SSC (0 pins) */
2362306a36Sopenharmony_ci	/* Family 1: ULPI (13 pins) */
2462306a36Sopenharmony_ci	PINCTRL_PIN(0, "ULPI_CLK"),
2562306a36Sopenharmony_ci	PINCTRL_PIN(1, "ULPI_D0"),
2662306a36Sopenharmony_ci	PINCTRL_PIN(2, "ULPI_D1"),
2762306a36Sopenharmony_ci	PINCTRL_PIN(3, "ULPI_D2"),
2862306a36Sopenharmony_ci	PINCTRL_PIN(4, "ULPI_D3"),
2962306a36Sopenharmony_ci	PINCTRL_PIN(5, "ULPI_D4"),
3062306a36Sopenharmony_ci	PINCTRL_PIN(6, "ULPI_D5"),
3162306a36Sopenharmony_ci	PINCTRL_PIN(7, "ULPI_D6"),
3262306a36Sopenharmony_ci	PINCTRL_PIN(8, "ULPI_D7"),
3362306a36Sopenharmony_ci	PINCTRL_PIN(9, "ULPI_DIR"),
3462306a36Sopenharmony_ci	PINCTRL_PIN(10, "ULPI_NXT"),
3562306a36Sopenharmony_ci	PINCTRL_PIN(11, "ULPI_REFCLK"),
3662306a36Sopenharmony_ci	PINCTRL_PIN(12, "ULPI_STP"),
3762306a36Sopenharmony_ci	/* Family 2: eMMC (24 pins) */
3862306a36Sopenharmony_ci	PINCTRL_PIN(13, "EMMC_CLK"),
3962306a36Sopenharmony_ci	PINCTRL_PIN(14, "EMMC_CMD"),
4062306a36Sopenharmony_ci	PINCTRL_PIN(15, "EMMC_D0"),
4162306a36Sopenharmony_ci	PINCTRL_PIN(16, "EMMC_D1"),
4262306a36Sopenharmony_ci	PINCTRL_PIN(17, "EMMC_D2"),
4362306a36Sopenharmony_ci	PINCTRL_PIN(18, "EMMC_D3"),
4462306a36Sopenharmony_ci	PINCTRL_PIN(19, "EMMC_D4"),
4562306a36Sopenharmony_ci	PINCTRL_PIN(20, "EMMC_D5"),
4662306a36Sopenharmony_ci	PINCTRL_PIN(21, "EMMC_D6"),
4762306a36Sopenharmony_ci	PINCTRL_PIN(22, "EMMC_D7"),
4862306a36Sopenharmony_ci	PINCTRL_PIN(23, "EMMC_RST_N"),
4962306a36Sopenharmony_ci	PINCTRL_PIN(24, "GP154"),
5062306a36Sopenharmony_ci	PINCTRL_PIN(25, "GP155"),
5162306a36Sopenharmony_ci	PINCTRL_PIN(26, "GP156"),
5262306a36Sopenharmony_ci	PINCTRL_PIN(27, "GP157"),
5362306a36Sopenharmony_ci	PINCTRL_PIN(28, "GP158"),
5462306a36Sopenharmony_ci	PINCTRL_PIN(29, "GP159"),
5562306a36Sopenharmony_ci	PINCTRL_PIN(30, "GP160"),
5662306a36Sopenharmony_ci	PINCTRL_PIN(31, "GP161"),
5762306a36Sopenharmony_ci	PINCTRL_PIN(32, "GP162"),
5862306a36Sopenharmony_ci	PINCTRL_PIN(33, "GP163"),
5962306a36Sopenharmony_ci	PINCTRL_PIN(34, "GP97"),
6062306a36Sopenharmony_ci	PINCTRL_PIN(35, "GP14"),
6162306a36Sopenharmony_ci	PINCTRL_PIN(36, "GP15"),
6262306a36Sopenharmony_ci	/* Family 3: SDIO (20 pins) */
6362306a36Sopenharmony_ci	PINCTRL_PIN(37, "GP77_SD_CD"),
6462306a36Sopenharmony_ci	PINCTRL_PIN(38, "GP78_SD_CLK"),
6562306a36Sopenharmony_ci	PINCTRL_PIN(39, "GP79_SD_CMD"),
6662306a36Sopenharmony_ci	PINCTRL_PIN(40, "GP80_SD_D0"),
6762306a36Sopenharmony_ci	PINCTRL_PIN(41, "GP81_SD_D1"),
6862306a36Sopenharmony_ci	PINCTRL_PIN(42, "GP82_SD_D2"),
6962306a36Sopenharmony_ci	PINCTRL_PIN(43, "GP83_SD_D3"),
7062306a36Sopenharmony_ci	PINCTRL_PIN(44, "GP84_SD_LS_CLK_FB"),
7162306a36Sopenharmony_ci	PINCTRL_PIN(45, "GP85_SD_LS_CMD_DIR"),
7262306a36Sopenharmony_ci	PINCTRL_PIN(46, "GP86_SD_LS_D_DIR"),
7362306a36Sopenharmony_ci	PINCTRL_PIN(47, "GP88_SD_LS_SEL"),
7462306a36Sopenharmony_ci	PINCTRL_PIN(48, "GP87_SD_PD"),
7562306a36Sopenharmony_ci	PINCTRL_PIN(49, "GP89_SD_WP"),
7662306a36Sopenharmony_ci	PINCTRL_PIN(50, "GP90_SDIO_CLK"),
7762306a36Sopenharmony_ci	PINCTRL_PIN(51, "GP91_SDIO_CMD"),
7862306a36Sopenharmony_ci	PINCTRL_PIN(52, "GP92_SDIO_D0"),
7962306a36Sopenharmony_ci	PINCTRL_PIN(53, "GP93_SDIO_D1"),
8062306a36Sopenharmony_ci	PINCTRL_PIN(54, "GP94_SDIO_D2"),
8162306a36Sopenharmony_ci	PINCTRL_PIN(55, "GP95_SDIO_D3"),
8262306a36Sopenharmony_ci	PINCTRL_PIN(56, "GP96_SDIO_PD"),
8362306a36Sopenharmony_ci	/* Family 4: HSI (8 pins) */
8462306a36Sopenharmony_ci	PINCTRL_PIN(57, "HSI_ACDATA"),
8562306a36Sopenharmony_ci	PINCTRL_PIN(58, "HSI_ACFLAG"),
8662306a36Sopenharmony_ci	PINCTRL_PIN(59, "HSI_ACREADY"),
8762306a36Sopenharmony_ci	PINCTRL_PIN(60, "HSI_ACWAKE"),
8862306a36Sopenharmony_ci	PINCTRL_PIN(61, "HSI_CADATA"),
8962306a36Sopenharmony_ci	PINCTRL_PIN(62, "HSI_CAFLAG"),
9062306a36Sopenharmony_ci	PINCTRL_PIN(63, "HSI_CAREADY"),
9162306a36Sopenharmony_ci	PINCTRL_PIN(64, "HSI_CAWAKE"),
9262306a36Sopenharmony_ci	/* Family 5: SSP Audio (14 pins) */
9362306a36Sopenharmony_ci	PINCTRL_PIN(65, "GP70"),
9462306a36Sopenharmony_ci	PINCTRL_PIN(66, "GP71"),
9562306a36Sopenharmony_ci	PINCTRL_PIN(67, "GP32_I2S_0_CLK"),
9662306a36Sopenharmony_ci	PINCTRL_PIN(68, "GP33_I2S_0_FS"),
9762306a36Sopenharmony_ci	PINCTRL_PIN(69, "GP34_I2S_0_RXD"),
9862306a36Sopenharmony_ci	PINCTRL_PIN(70, "GP35_I2S_0_TXD"),
9962306a36Sopenharmony_ci	PINCTRL_PIN(71, "GP36_I2S_1_CLK"),
10062306a36Sopenharmony_ci	PINCTRL_PIN(72, "GP37_I2S_1_FS"),
10162306a36Sopenharmony_ci	PINCTRL_PIN(73, "GP38_I2S_1_RXD"),
10262306a36Sopenharmony_ci	PINCTRL_PIN(74, "GP39_I2S_1_TXD"),
10362306a36Sopenharmony_ci	PINCTRL_PIN(75, "GP40_I2S_2_CLK"),
10462306a36Sopenharmony_ci	PINCTRL_PIN(76, "GP41_I2S_2_FS"),
10562306a36Sopenharmony_ci	PINCTRL_PIN(77, "GP42_I2S_2_RXD"),
10662306a36Sopenharmony_ci	PINCTRL_PIN(78, "GP43_I2S_2_TXD"),
10762306a36Sopenharmony_ci	/* Family 6: GP SSP (22 pins) */
10862306a36Sopenharmony_ci	PINCTRL_PIN(79, "GP120_SPI_0_CLK"),
10962306a36Sopenharmony_ci	PINCTRL_PIN(80, "GP121_SPI_0_SS"),
11062306a36Sopenharmony_ci	PINCTRL_PIN(81, "GP122_SPI_0_RXD"),
11162306a36Sopenharmony_ci	PINCTRL_PIN(82, "GP123_SPI_0_TXD"),
11262306a36Sopenharmony_ci	PINCTRL_PIN(83, "GP102_SPI_1_CLK"),
11362306a36Sopenharmony_ci	PINCTRL_PIN(84, "GP103_SPI_1_SS0"),
11462306a36Sopenharmony_ci	PINCTRL_PIN(85, "GP104_SPI_1_SS1"),
11562306a36Sopenharmony_ci	PINCTRL_PIN(86, "GP105_SPI_1_SS2"),
11662306a36Sopenharmony_ci	PINCTRL_PIN(87, "GP106_SPI_1_SS3"),
11762306a36Sopenharmony_ci	PINCTRL_PIN(88, "GP107_SPI_1_RXD"),
11862306a36Sopenharmony_ci	PINCTRL_PIN(89, "GP108_SPI_1_TXD"),
11962306a36Sopenharmony_ci	PINCTRL_PIN(90, "GP109_SPI_2_CLK"),
12062306a36Sopenharmony_ci	PINCTRL_PIN(91, "GP110_SPI_2_SS0"),
12162306a36Sopenharmony_ci	PINCTRL_PIN(92, "GP111_SPI_2_SS1"),
12262306a36Sopenharmony_ci	PINCTRL_PIN(93, "GP112_SPI_2_SS2"),
12362306a36Sopenharmony_ci	PINCTRL_PIN(94, "GP113_SPI_2_SS3"),
12462306a36Sopenharmony_ci	PINCTRL_PIN(95, "GP114_SPI_2_RXD"),
12562306a36Sopenharmony_ci	PINCTRL_PIN(96, "GP115_SPI_2_TXD"),
12662306a36Sopenharmony_ci	PINCTRL_PIN(97, "GP116_SPI_3_CLK"),
12762306a36Sopenharmony_ci	PINCTRL_PIN(98, "GP117_SPI_3_SS"),
12862306a36Sopenharmony_ci	PINCTRL_PIN(99, "GP118_SPI_3_RXD"),
12962306a36Sopenharmony_ci	PINCTRL_PIN(100, "GP119_SPI_3_TXD"),
13062306a36Sopenharmony_ci	/* Family 7: I2C (14 pins) */
13162306a36Sopenharmony_ci	PINCTRL_PIN(101, "GP19_I2C_1_SCL"),
13262306a36Sopenharmony_ci	PINCTRL_PIN(102, "GP20_I2C_1_SDA"),
13362306a36Sopenharmony_ci	PINCTRL_PIN(103, "GP21_I2C_2_SCL"),
13462306a36Sopenharmony_ci	PINCTRL_PIN(104, "GP22_I2C_2_SDA"),
13562306a36Sopenharmony_ci	PINCTRL_PIN(105, "GP17_I2C_3_SCL_HDMI"),
13662306a36Sopenharmony_ci	PINCTRL_PIN(106, "GP18_I2C_3_SDA_HDMI"),
13762306a36Sopenharmony_ci	PINCTRL_PIN(107, "GP23_I2C_4_SCL"),
13862306a36Sopenharmony_ci	PINCTRL_PIN(108, "GP24_I2C_4_SDA"),
13962306a36Sopenharmony_ci	PINCTRL_PIN(109, "GP25_I2C_5_SCL"),
14062306a36Sopenharmony_ci	PINCTRL_PIN(110, "GP26_I2C_5_SDA"),
14162306a36Sopenharmony_ci	PINCTRL_PIN(111, "GP27_I2C_6_SCL"),
14262306a36Sopenharmony_ci	PINCTRL_PIN(112, "GP28_I2C_6_SDA"),
14362306a36Sopenharmony_ci	PINCTRL_PIN(113, "GP29_I2C_7_SCL"),
14462306a36Sopenharmony_ci	PINCTRL_PIN(114, "GP30_I2C_7_SDA"),
14562306a36Sopenharmony_ci	/* Family 8: UART (12 pins) */
14662306a36Sopenharmony_ci	PINCTRL_PIN(115, "GP124_UART_0_CTS"),
14762306a36Sopenharmony_ci	PINCTRL_PIN(116, "GP125_UART_0_RTS"),
14862306a36Sopenharmony_ci	PINCTRL_PIN(117, "GP126_UART_0_RX"),
14962306a36Sopenharmony_ci	PINCTRL_PIN(118, "GP127_UART_0_TX"),
15062306a36Sopenharmony_ci	PINCTRL_PIN(119, "GP128_UART_1_CTS"),
15162306a36Sopenharmony_ci	PINCTRL_PIN(120, "GP129_UART_1_RTS"),
15262306a36Sopenharmony_ci	PINCTRL_PIN(121, "GP130_UART_1_RX"),
15362306a36Sopenharmony_ci	PINCTRL_PIN(122, "GP131_UART_1_TX"),
15462306a36Sopenharmony_ci	PINCTRL_PIN(123, "GP132_UART_2_CTS"),
15562306a36Sopenharmony_ci	PINCTRL_PIN(124, "GP133_UART_2_RTS"),
15662306a36Sopenharmony_ci	PINCTRL_PIN(125, "GP134_UART_2_RX"),
15762306a36Sopenharmony_ci	PINCTRL_PIN(126, "GP135_UART_2_TX"),
15862306a36Sopenharmony_ci	/* Family 9: GPIO South (19 pins) */
15962306a36Sopenharmony_ci	PINCTRL_PIN(127, "GP177"),
16062306a36Sopenharmony_ci	PINCTRL_PIN(128, "GP178"),
16162306a36Sopenharmony_ci	PINCTRL_PIN(129, "GP179"),
16262306a36Sopenharmony_ci	PINCTRL_PIN(130, "GP180"),
16362306a36Sopenharmony_ci	PINCTRL_PIN(131, "GP181"),
16462306a36Sopenharmony_ci	PINCTRL_PIN(132, "GP182_PWM2"),
16562306a36Sopenharmony_ci	PINCTRL_PIN(133, "GP183_PWM3"),
16662306a36Sopenharmony_ci	PINCTRL_PIN(134, "GP184"),
16762306a36Sopenharmony_ci	PINCTRL_PIN(135, "GP185"),
16862306a36Sopenharmony_ci	PINCTRL_PIN(136, "GP186"),
16962306a36Sopenharmony_ci	PINCTRL_PIN(137, "GP187"),
17062306a36Sopenharmony_ci	PINCTRL_PIN(138, "GP188"),
17162306a36Sopenharmony_ci	PINCTRL_PIN(139, "GP189"),
17262306a36Sopenharmony_ci	PINCTRL_PIN(140, "GP64_FAST_INT0"),
17362306a36Sopenharmony_ci	PINCTRL_PIN(141, "GP65_FAST_INT1"),
17462306a36Sopenharmony_ci	PINCTRL_PIN(142, "GP66_FAST_INT2"),
17562306a36Sopenharmony_ci	PINCTRL_PIN(143, "GP67_FAST_INT3"),
17662306a36Sopenharmony_ci	PINCTRL_PIN(144, "GP12_PWM0"),
17762306a36Sopenharmony_ci	PINCTRL_PIN(145, "GP13_PWM1"),
17862306a36Sopenharmony_ci	/* Family 10: Camera Sideband (12 pins) */
17962306a36Sopenharmony_ci	PINCTRL_PIN(146, "GP0"),
18062306a36Sopenharmony_ci	PINCTRL_PIN(147, "GP1"),
18162306a36Sopenharmony_ci	PINCTRL_PIN(148, "GP2"),
18262306a36Sopenharmony_ci	PINCTRL_PIN(149, "GP3"),
18362306a36Sopenharmony_ci	PINCTRL_PIN(150, "GP4"),
18462306a36Sopenharmony_ci	PINCTRL_PIN(151, "GP5"),
18562306a36Sopenharmony_ci	PINCTRL_PIN(152, "GP6"),
18662306a36Sopenharmony_ci	PINCTRL_PIN(153, "GP7"),
18762306a36Sopenharmony_ci	PINCTRL_PIN(154, "GP8"),
18862306a36Sopenharmony_ci	PINCTRL_PIN(155, "GP9"),
18962306a36Sopenharmony_ci	PINCTRL_PIN(156, "GP10"),
19062306a36Sopenharmony_ci	PINCTRL_PIN(157, "GP11"),
19162306a36Sopenharmony_ci	/* Family 11: Clock (22 pins) */
19262306a36Sopenharmony_ci	PINCTRL_PIN(158, "GP137"),
19362306a36Sopenharmony_ci	PINCTRL_PIN(159, "GP138"),
19462306a36Sopenharmony_ci	PINCTRL_PIN(160, "GP139"),
19562306a36Sopenharmony_ci	PINCTRL_PIN(161, "GP140"),
19662306a36Sopenharmony_ci	PINCTRL_PIN(162, "GP141"),
19762306a36Sopenharmony_ci	PINCTRL_PIN(163, "GP142"),
19862306a36Sopenharmony_ci	PINCTRL_PIN(164, "GP16_HDMI_HPD"),
19962306a36Sopenharmony_ci	PINCTRL_PIN(165, "GP68_DSI_A_TE"),
20062306a36Sopenharmony_ci	PINCTRL_PIN(166, "GP69_DSI_C_TE"),
20162306a36Sopenharmony_ci	PINCTRL_PIN(167, "OSC_CLK_CTRL0"),
20262306a36Sopenharmony_ci	PINCTRL_PIN(168, "OSC_CLK_CTRL1"),
20362306a36Sopenharmony_ci	PINCTRL_PIN(169, "OSC_CLK0"),
20462306a36Sopenharmony_ci	PINCTRL_PIN(170, "OSC_CLK1"),
20562306a36Sopenharmony_ci	PINCTRL_PIN(171, "OSC_CLK2"),
20662306a36Sopenharmony_ci	PINCTRL_PIN(172, "OSC_CLK3"),
20762306a36Sopenharmony_ci	PINCTRL_PIN(173, "OSC_CLK4"),
20862306a36Sopenharmony_ci	PINCTRL_PIN(174, "RESETOUT"),
20962306a36Sopenharmony_ci	PINCTRL_PIN(175, "PMODE"),
21062306a36Sopenharmony_ci	PINCTRL_PIN(176, "PRDY"),
21162306a36Sopenharmony_ci	PINCTRL_PIN(177, "PREQ"),
21262306a36Sopenharmony_ci	PINCTRL_PIN(178, "GP190"),
21362306a36Sopenharmony_ci	PINCTRL_PIN(179, "GP191"),
21462306a36Sopenharmony_ci	/* Family 12: MSIC (15 pins) */
21562306a36Sopenharmony_ci	PINCTRL_PIN(180, "I2C_0_SCL"),
21662306a36Sopenharmony_ci	PINCTRL_PIN(181, "I2C_0_SDA"),
21762306a36Sopenharmony_ci	PINCTRL_PIN(182, "IERR"),
21862306a36Sopenharmony_ci	PINCTRL_PIN(183, "JTAG_TCK"),
21962306a36Sopenharmony_ci	PINCTRL_PIN(184, "JTAG_TDI"),
22062306a36Sopenharmony_ci	PINCTRL_PIN(185, "JTAG_TDO"),
22162306a36Sopenharmony_ci	PINCTRL_PIN(186, "JTAG_TMS"),
22262306a36Sopenharmony_ci	PINCTRL_PIN(187, "JTAG_TRST"),
22362306a36Sopenharmony_ci	PINCTRL_PIN(188, "PROCHOT"),
22462306a36Sopenharmony_ci	PINCTRL_PIN(189, "RTC_CLK"),
22562306a36Sopenharmony_ci	PINCTRL_PIN(190, "SVID_ALERT"),
22662306a36Sopenharmony_ci	PINCTRL_PIN(191, "SVID_CLK"),
22762306a36Sopenharmony_ci	PINCTRL_PIN(192, "SVID_D"),
22862306a36Sopenharmony_ci	PINCTRL_PIN(193, "THERMTRIP"),
22962306a36Sopenharmony_ci	PINCTRL_PIN(194, "STANDBY"),
23062306a36Sopenharmony_ci	/* Family 13: Keyboard (20 pins) */
23162306a36Sopenharmony_ci	PINCTRL_PIN(195, "GP44"),
23262306a36Sopenharmony_ci	PINCTRL_PIN(196, "GP45"),
23362306a36Sopenharmony_ci	PINCTRL_PIN(197, "GP46"),
23462306a36Sopenharmony_ci	PINCTRL_PIN(198, "GP47"),
23562306a36Sopenharmony_ci	PINCTRL_PIN(199, "GP48"),
23662306a36Sopenharmony_ci	PINCTRL_PIN(200, "GP49"),
23762306a36Sopenharmony_ci	PINCTRL_PIN(201, "GP50"),
23862306a36Sopenharmony_ci	PINCTRL_PIN(202, "GP51"),
23962306a36Sopenharmony_ci	PINCTRL_PIN(203, "GP52"),
24062306a36Sopenharmony_ci	PINCTRL_PIN(204, "GP53"),
24162306a36Sopenharmony_ci	PINCTRL_PIN(205, "GP54"),
24262306a36Sopenharmony_ci	PINCTRL_PIN(206, "GP55"),
24362306a36Sopenharmony_ci	PINCTRL_PIN(207, "GP56"),
24462306a36Sopenharmony_ci	PINCTRL_PIN(208, "GP57"),
24562306a36Sopenharmony_ci	PINCTRL_PIN(209, "GP58"),
24662306a36Sopenharmony_ci	PINCTRL_PIN(210, "GP59"),
24762306a36Sopenharmony_ci	PINCTRL_PIN(211, "GP60"),
24862306a36Sopenharmony_ci	PINCTRL_PIN(212, "GP61"),
24962306a36Sopenharmony_ci	PINCTRL_PIN(213, "GP62"),
25062306a36Sopenharmony_ci	PINCTRL_PIN(214, "GP63"),
25162306a36Sopenharmony_ci	/* Family 14: GPIO North (13 pins) */
25262306a36Sopenharmony_ci	PINCTRL_PIN(215, "GP164"),
25362306a36Sopenharmony_ci	PINCTRL_PIN(216, "GP165"),
25462306a36Sopenharmony_ci	PINCTRL_PIN(217, "GP166"),
25562306a36Sopenharmony_ci	PINCTRL_PIN(218, "GP167"),
25662306a36Sopenharmony_ci	PINCTRL_PIN(219, "GP168_MJTAG_TCK"),
25762306a36Sopenharmony_ci	PINCTRL_PIN(220, "GP169_MJTAG_TDI"),
25862306a36Sopenharmony_ci	PINCTRL_PIN(221, "GP170_MJTAG_TDO"),
25962306a36Sopenharmony_ci	PINCTRL_PIN(222, "GP171_MJTAG_TMS"),
26062306a36Sopenharmony_ci	PINCTRL_PIN(223, "GP172_MJTAG_TRST"),
26162306a36Sopenharmony_ci	PINCTRL_PIN(224, "GP173"),
26262306a36Sopenharmony_ci	PINCTRL_PIN(225, "GP174"),
26362306a36Sopenharmony_ci	PINCTRL_PIN(226, "GP175"),
26462306a36Sopenharmony_ci	PINCTRL_PIN(227, "GP176"),
26562306a36Sopenharmony_ci	/* Family 15: PTI (5 pins) */
26662306a36Sopenharmony_ci	PINCTRL_PIN(228, "GP72_PTI_CLK"),
26762306a36Sopenharmony_ci	PINCTRL_PIN(229, "GP73_PTI_D0"),
26862306a36Sopenharmony_ci	PINCTRL_PIN(230, "GP74_PTI_D1"),
26962306a36Sopenharmony_ci	PINCTRL_PIN(231, "GP75_PTI_D2"),
27062306a36Sopenharmony_ci	PINCTRL_PIN(232, "GP76_PTI_D3"),
27162306a36Sopenharmony_ci	/* Family 16: USB3 (0 pins) */
27262306a36Sopenharmony_ci	/* Family 17: HSIC (0 pins) */
27362306a36Sopenharmony_ci	/* Family 18: Broadcast (0 pins) */
27462306a36Sopenharmony_ci};
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_cistatic const unsigned int mrfld_sdio_pins[] = { 50, 51, 52, 53, 54, 55, 56 };
27762306a36Sopenharmony_cistatic const unsigned int mrfld_i2s2_pins[] = { 75, 76, 77, 78 };
27862306a36Sopenharmony_cistatic const unsigned int mrfld_spi5_pins[] = { 90, 91, 92, 93, 94, 95, 96 };
27962306a36Sopenharmony_cistatic const unsigned int mrfld_uart0_pins[] = { 115, 116, 117, 118 };
28062306a36Sopenharmony_cistatic const unsigned int mrfld_uart1_pins[] = { 119, 120, 121, 122 };
28162306a36Sopenharmony_cistatic const unsigned int mrfld_uart2_pins[] = { 123, 124, 125, 126 };
28262306a36Sopenharmony_cistatic const unsigned int mrfld_pwm0_pins[] = { 144 };
28362306a36Sopenharmony_cistatic const unsigned int mrfld_pwm1_pins[] = { 145 };
28462306a36Sopenharmony_cistatic const unsigned int mrfld_pwm2_pins[] = { 132 };
28562306a36Sopenharmony_cistatic const unsigned int mrfld_pwm3_pins[] = { 133 };
28662306a36Sopenharmony_ci
28762306a36Sopenharmony_cistatic const struct intel_pingroup mrfld_groups[] = {
28862306a36Sopenharmony_ci	PIN_GROUP("sdio_grp", mrfld_sdio_pins, 1),
28962306a36Sopenharmony_ci	PIN_GROUP("i2s2_grp", mrfld_i2s2_pins, 1),
29062306a36Sopenharmony_ci	PIN_GROUP("spi5_grp", mrfld_spi5_pins, 1),
29162306a36Sopenharmony_ci	PIN_GROUP("uart0_grp", mrfld_uart0_pins, 1),
29262306a36Sopenharmony_ci	PIN_GROUP("uart1_grp", mrfld_uart1_pins, 1),
29362306a36Sopenharmony_ci	PIN_GROUP("uart2_grp", mrfld_uart2_pins, 1),
29462306a36Sopenharmony_ci	PIN_GROUP("pwm0_grp", mrfld_pwm0_pins, 1),
29562306a36Sopenharmony_ci	PIN_GROUP("pwm1_grp", mrfld_pwm1_pins, 1),
29662306a36Sopenharmony_ci	PIN_GROUP("pwm2_grp", mrfld_pwm2_pins, 1),
29762306a36Sopenharmony_ci	PIN_GROUP("pwm3_grp", mrfld_pwm3_pins, 1),
29862306a36Sopenharmony_ci};
29962306a36Sopenharmony_ci
30062306a36Sopenharmony_cistatic const char * const mrfld_sdio_groups[] = { "sdio_grp" };
30162306a36Sopenharmony_cistatic const char * const mrfld_i2s2_groups[] = { "i2s2_grp" };
30262306a36Sopenharmony_cistatic const char * const mrfld_spi5_groups[] = { "spi5_grp" };
30362306a36Sopenharmony_cistatic const char * const mrfld_uart0_groups[] = { "uart0_grp" };
30462306a36Sopenharmony_cistatic const char * const mrfld_uart1_groups[] = { "uart1_grp" };
30562306a36Sopenharmony_cistatic const char * const mrfld_uart2_groups[] = { "uart2_grp" };
30662306a36Sopenharmony_cistatic const char * const mrfld_pwm0_groups[] = { "pwm0_grp" };
30762306a36Sopenharmony_cistatic const char * const mrfld_pwm1_groups[] = { "pwm1_grp" };
30862306a36Sopenharmony_cistatic const char * const mrfld_pwm2_groups[] = { "pwm2_grp" };
30962306a36Sopenharmony_cistatic const char * const mrfld_pwm3_groups[] = { "pwm3_grp" };
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_cistatic const struct intel_function mrfld_functions[] = {
31262306a36Sopenharmony_ci	FUNCTION("sdio", mrfld_sdio_groups),
31362306a36Sopenharmony_ci	FUNCTION("i2s2", mrfld_i2s2_groups),
31462306a36Sopenharmony_ci	FUNCTION("spi5", mrfld_spi5_groups),
31562306a36Sopenharmony_ci	FUNCTION("uart0", mrfld_uart0_groups),
31662306a36Sopenharmony_ci	FUNCTION("uart1", mrfld_uart1_groups),
31762306a36Sopenharmony_ci	FUNCTION("uart2", mrfld_uart2_groups),
31862306a36Sopenharmony_ci	FUNCTION("pwm0", mrfld_pwm0_groups),
31962306a36Sopenharmony_ci	FUNCTION("pwm1", mrfld_pwm1_groups),
32062306a36Sopenharmony_ci	FUNCTION("pwm2", mrfld_pwm2_groups),
32162306a36Sopenharmony_ci	FUNCTION("pwm3", mrfld_pwm3_groups),
32262306a36Sopenharmony_ci};
32362306a36Sopenharmony_ci
32462306a36Sopenharmony_cistatic const struct tng_family mrfld_families[] = {
32562306a36Sopenharmony_ci	TNG_FAMILY(1, 0, 12),
32662306a36Sopenharmony_ci	TNG_FAMILY(2, 13, 36),
32762306a36Sopenharmony_ci	TNG_FAMILY(3, 37, 56),
32862306a36Sopenharmony_ci	TNG_FAMILY(4, 57, 64),
32962306a36Sopenharmony_ci	TNG_FAMILY(5, 65, 78),
33062306a36Sopenharmony_ci	TNG_FAMILY(6, 79, 100),
33162306a36Sopenharmony_ci	TNG_FAMILY_PROTECTED(7, 101, 114),
33262306a36Sopenharmony_ci	TNG_FAMILY(8, 115, 126),
33362306a36Sopenharmony_ci	TNG_FAMILY(9, 127, 145),
33462306a36Sopenharmony_ci	TNG_FAMILY(10, 146, 157),
33562306a36Sopenharmony_ci	TNG_FAMILY(11, 158, 179),
33662306a36Sopenharmony_ci	TNG_FAMILY_PROTECTED(12, 180, 194),
33762306a36Sopenharmony_ci	TNG_FAMILY(13, 195, 214),
33862306a36Sopenharmony_ci	TNG_FAMILY(14, 215, 227),
33962306a36Sopenharmony_ci	TNG_FAMILY(15, 228, 232),
34062306a36Sopenharmony_ci};
34162306a36Sopenharmony_ci
34262306a36Sopenharmony_cistatic const struct tng_pinctrl mrfld_soc_data = {
34362306a36Sopenharmony_ci	.pins = mrfld_pins,
34462306a36Sopenharmony_ci	.npins = ARRAY_SIZE(mrfld_pins),
34562306a36Sopenharmony_ci	.groups = mrfld_groups,
34662306a36Sopenharmony_ci	.ngroups = ARRAY_SIZE(mrfld_groups),
34762306a36Sopenharmony_ci	.families = mrfld_families,
34862306a36Sopenharmony_ci	.nfamilies = ARRAY_SIZE(mrfld_families),
34962306a36Sopenharmony_ci	.functions = mrfld_functions,
35062306a36Sopenharmony_ci	.nfunctions = ARRAY_SIZE(mrfld_functions),
35162306a36Sopenharmony_ci};
35262306a36Sopenharmony_ci
35362306a36Sopenharmony_cistatic const struct acpi_device_id mrfld_acpi_table[] = {
35462306a36Sopenharmony_ci	{ "INTC1002", (kernel_ulong_t)&mrfld_soc_data },
35562306a36Sopenharmony_ci	{ }
35662306a36Sopenharmony_ci};
35762306a36Sopenharmony_ciMODULE_DEVICE_TABLE(acpi, mrfld_acpi_table);
35862306a36Sopenharmony_ci
35962306a36Sopenharmony_cistatic struct platform_driver mrfld_pinctrl_driver = {
36062306a36Sopenharmony_ci	.probe = devm_tng_pinctrl_probe,
36162306a36Sopenharmony_ci	.driver = {
36262306a36Sopenharmony_ci		.name = "pinctrl-merrifield",
36362306a36Sopenharmony_ci		.acpi_match_table = mrfld_acpi_table,
36462306a36Sopenharmony_ci	},
36562306a36Sopenharmony_ci};
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_cistatic int __init mrfld_pinctrl_init(void)
36862306a36Sopenharmony_ci{
36962306a36Sopenharmony_ci	return platform_driver_register(&mrfld_pinctrl_driver);
37062306a36Sopenharmony_ci}
37162306a36Sopenharmony_cisubsys_initcall(mrfld_pinctrl_init);
37262306a36Sopenharmony_ci
37362306a36Sopenharmony_cistatic void __exit mrfld_pinctrl_exit(void)
37462306a36Sopenharmony_ci{
37562306a36Sopenharmony_ci	platform_driver_unregister(&mrfld_pinctrl_driver);
37662306a36Sopenharmony_ci}
37762306a36Sopenharmony_cimodule_exit(mrfld_pinctrl_exit);
37862306a36Sopenharmony_ci
37962306a36Sopenharmony_ciMODULE_AUTHOR("Andy Shevchenko <andriy.shevchenko@linux.intel.com>");
38062306a36Sopenharmony_ciMODULE_DESCRIPTION("Intel Merrifield SoC pinctrl driver");
38162306a36Sopenharmony_ciMODULE_LICENSE("GPL v2");
38262306a36Sopenharmony_ciMODULE_ALIAS("platform:pinctrl-merrifield");
38362306a36Sopenharmony_ciMODULE_IMPORT_NS(PINCTRL_TANGIER);
384