xref: /openbmc/linux/drivers/pinctrl/vt8500/pinctrl-wm8750.c (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*2025cf9eSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
2170c6152STony Prisk /*
3170c6152STony Prisk  * Pinctrl data for Wondermedia WM8750 SoC
4170c6152STony Prisk  *
5170c6152STony Prisk  * Copyright (c) 2013 Tony Prisk <linux@prisktech.co.nz>
6170c6152STony Prisk  */
7170c6152STony Prisk 
8170c6152STony Prisk #include <linux/io.h>
923d511f6SPaul Gortmaker #include <linux/init.h>
10170c6152STony Prisk #include <linux/pinctrl/pinctrl.h>
11170c6152STony Prisk #include <linux/platform_device.h>
12170c6152STony Prisk #include <linux/slab.h>
13170c6152STony Prisk 
14170c6152STony Prisk #include "pinctrl-wmt.h"
15170c6152STony Prisk 
16170c6152STony Prisk /*
17170c6152STony Prisk  * Describe the register offsets within the GPIO memory space
18170c6152STony Prisk  * The dedicated external GPIO's should always be listed in bank 0
19170c6152STony Prisk  * so they are exported in the 0..31 range which is what users
20170c6152STony Prisk  * expect.
21170c6152STony Prisk  *
22170c6152STony Prisk  * Do not reorder these banks as it will change the pin numbering
23170c6152STony Prisk  */
24170c6152STony Prisk static const struct wmt_pinctrl_bank_registers wm8750_banks[] = {
25170c6152STony Prisk 	WMT_PINCTRL_BANK(0x40, 0x80, 0xC0, 0x00, 0x480, 0x4C0),	/* 0 */
26170c6152STony Prisk 	WMT_PINCTRL_BANK(0x44, 0x84, 0xC4, 0x04, 0x484, 0x4C4),	/* 1 */
27170c6152STony Prisk 	WMT_PINCTRL_BANK(0x48, 0x88, 0xC8, 0x08, 0x488, 0x4C8),	/* 2 */
28170c6152STony Prisk 	WMT_PINCTRL_BANK(0x4C, 0x8C, 0xCC, 0x0C, 0x48C, 0x4CC),	/* 3 */
29170c6152STony Prisk 	WMT_PINCTRL_BANK(0x50, 0x90, 0xD0, 0x10, 0x490, 0x4D0),	/* 4 */
30170c6152STony Prisk 	WMT_PINCTRL_BANK(0x54, 0x94, 0xD4, 0x14, 0x494, 0x4D4),	/* 5 */
31170c6152STony Prisk 	WMT_PINCTRL_BANK(0x58, 0x98, 0xD8, 0x18, 0x498, 0x4D8),	/* 6 */
32170c6152STony Prisk 	WMT_PINCTRL_BANK(0x5C, 0x9C, 0xDC, 0x1C, 0x49C, 0x4DC),	/* 7 */
33170c6152STony Prisk 	WMT_PINCTRL_BANK(0x60, 0xA0, 0xE0, 0x20, 0x4A0, 0x4E0),	/* 8 */
34170c6152STony Prisk 	WMT_PINCTRL_BANK(0x70, 0xB0, 0xF0, 0x30, 0x4B0, 0x4F0),	/* 9 */
35170c6152STony Prisk 	WMT_PINCTRL_BANK(0x7C, 0xBC, 0xDC, 0x3C, 0x4BC, 0x4FC),	/* 10 */
36170c6152STony Prisk };
37170c6152STony Prisk 
38170c6152STony Prisk /* Please keep sorted by bank/bit */
39170c6152STony Prisk #define WMT_PIN_EXTGPIO0	WMT_PIN(0, 0)
40170c6152STony Prisk #define WMT_PIN_EXTGPIO1	WMT_PIN(0, 1)
41170c6152STony Prisk #define WMT_PIN_EXTGPIO2	WMT_PIN(0, 2)
42170c6152STony Prisk #define WMT_PIN_EXTGPIO3	WMT_PIN(0, 3)
43170c6152STony Prisk #define WMT_PIN_EXTGPIO4	WMT_PIN(0, 4)
44170c6152STony Prisk #define WMT_PIN_EXTGPIO5	WMT_PIN(0, 5)
45170c6152STony Prisk #define WMT_PIN_EXTGPIO6	WMT_PIN(0, 6)
46170c6152STony Prisk #define WMT_PIN_EXTGPIO7	WMT_PIN(0, 7)
47170c6152STony Prisk #define WMT_PIN_WAKEUP0		WMT_PIN(0, 16)
481c7ad8f0STony Prisk #define WMT_PIN_WAKEUP1		WMT_PIN(0, 17)
49170c6152STony Prisk #define WMT_PIN_SD0CD		WMT_PIN(0, 28)
50170c6152STony Prisk #define WMT_PIN_VDOUT0		WMT_PIN(1, 0)
51170c6152STony Prisk #define WMT_PIN_VDOUT1		WMT_PIN(1, 1)
52170c6152STony Prisk #define WMT_PIN_VDOUT2		WMT_PIN(1, 2)
53170c6152STony Prisk #define WMT_PIN_VDOUT3		WMT_PIN(1, 3)
54170c6152STony Prisk #define WMT_PIN_VDOUT4		WMT_PIN(1, 4)
55170c6152STony Prisk #define WMT_PIN_VDOUT5		WMT_PIN(1, 5)
56170c6152STony Prisk #define WMT_PIN_VDOUT6		WMT_PIN(1, 6)
57170c6152STony Prisk #define WMT_PIN_VDOUT7		WMT_PIN(1, 7)
58170c6152STony Prisk #define WMT_PIN_VDOUT8		WMT_PIN(1, 8)
59170c6152STony Prisk #define WMT_PIN_VDOUT9		WMT_PIN(1, 9)
60170c6152STony Prisk #define WMT_PIN_VDOUT10		WMT_PIN(1, 10)
61170c6152STony Prisk #define WMT_PIN_VDOUT11		WMT_PIN(1, 11)
62170c6152STony Prisk #define WMT_PIN_VDOUT12		WMT_PIN(1, 12)
63170c6152STony Prisk #define WMT_PIN_VDOUT13		WMT_PIN(1, 13)
64170c6152STony Prisk #define WMT_PIN_VDOUT14		WMT_PIN(1, 14)
65170c6152STony Prisk #define WMT_PIN_VDOUT15		WMT_PIN(1, 15)
66170c6152STony Prisk #define WMT_PIN_VDOUT16		WMT_PIN(1, 16)
67170c6152STony Prisk #define WMT_PIN_VDOUT17		WMT_PIN(1, 17)
68170c6152STony Prisk #define WMT_PIN_VDOUT18		WMT_PIN(1, 18)
69170c6152STony Prisk #define WMT_PIN_VDOUT19		WMT_PIN(1, 19)
70170c6152STony Prisk #define WMT_PIN_VDOUT20		WMT_PIN(1, 20)
71170c6152STony Prisk #define WMT_PIN_VDOUT21		WMT_PIN(1, 21)
72170c6152STony Prisk #define WMT_PIN_VDOUT22		WMT_PIN(1, 22)
73170c6152STony Prisk #define WMT_PIN_VDOUT23		WMT_PIN(1, 23)
74170c6152STony Prisk #define WMT_PIN_VDIN0		WMT_PIN(2, 0)
75170c6152STony Prisk #define WMT_PIN_VDIN1		WMT_PIN(2, 1)
76170c6152STony Prisk #define WMT_PIN_VDIN2		WMT_PIN(2, 2)
77170c6152STony Prisk #define WMT_PIN_VDIN3		WMT_PIN(2, 3)
78170c6152STony Prisk #define WMT_PIN_VDIN4		WMT_PIN(2, 4)
79170c6152STony Prisk #define WMT_PIN_VDIN5		WMT_PIN(2, 5)
80170c6152STony Prisk #define WMT_PIN_VDIN6		WMT_PIN(2, 6)
81170c6152STony Prisk #define WMT_PIN_VDIN7		WMT_PIN(2, 7)
82170c6152STony Prisk #define WMT_PIN_SPI0_MOSI	WMT_PIN(2, 24)
83170c6152STony Prisk #define WMT_PIN_SPI0_MISO	WMT_PIN(2, 25)
84170c6152STony Prisk #define WMT_PIN_SPI0_SS		WMT_PIN(2, 26)
85170c6152STony Prisk #define WMT_PIN_SPI0_CLK	WMT_PIN(2, 27)
86170c6152STony Prisk #define WMT_PIN_SPI0_SSB	WMT_PIN(2, 28)
87170c6152STony Prisk #define WMT_PIN_SD0CLK		WMT_PIN(3, 17)
88170c6152STony Prisk #define WMT_PIN_SD0CMD		WMT_PIN(3, 18)
89170c6152STony Prisk #define WMT_PIN_SD0WP		WMT_PIN(3, 19)
90170c6152STony Prisk #define WMT_PIN_SD0DATA0	WMT_PIN(3, 20)
91170c6152STony Prisk #define WMT_PIN_SD0DATA1	WMT_PIN(3, 21)
92170c6152STony Prisk #define WMT_PIN_SD0DATA2	WMT_PIN(3, 22)
93170c6152STony Prisk #define WMT_PIN_SD0DATA3	WMT_PIN(3, 23)
94170c6152STony Prisk #define WMT_PIN_SD1DATA0	WMT_PIN(3, 24)
95170c6152STony Prisk #define WMT_PIN_SD1DATA1	WMT_PIN(3, 25)
96170c6152STony Prisk #define WMT_PIN_SD1DATA2	WMT_PIN(3, 26)
97170c6152STony Prisk #define WMT_PIN_SD1DATA3	WMT_PIN(3, 27)
98170c6152STony Prisk #define WMT_PIN_SD1DATA4	WMT_PIN(3, 28)
99170c6152STony Prisk #define WMT_PIN_SD1DATA5	WMT_PIN(3, 29)
100170c6152STony Prisk #define WMT_PIN_SD1DATA6	WMT_PIN(3, 30)
101170c6152STony Prisk #define WMT_PIN_SD1DATA7	WMT_PIN(3, 31)
102170c6152STony Prisk #define WMT_PIN_I2C0_SCL	WMT_PIN(5, 8)
103170c6152STony Prisk #define WMT_PIN_I2C0_SDA	WMT_PIN(5, 9)
104170c6152STony Prisk #define WMT_PIN_I2C1_SCL	WMT_PIN(5, 10)
105170c6152STony Prisk #define WMT_PIN_I2C1_SDA	WMT_PIN(5, 11)
106170c6152STony Prisk #define WMT_PIN_I2C2_SCL	WMT_PIN(5, 12)
107170c6152STony Prisk #define WMT_PIN_I2C2_SDA	WMT_PIN(5, 13)
108170c6152STony Prisk #define WMT_PIN_UART0_RTS	WMT_PIN(5, 16)
109170c6152STony Prisk #define WMT_PIN_UART0_TXD	WMT_PIN(5, 17)
110170c6152STony Prisk #define WMT_PIN_UART0_CTS	WMT_PIN(5, 18)
111170c6152STony Prisk #define WMT_PIN_UART0_RXD	WMT_PIN(5, 19)
112170c6152STony Prisk #define WMT_PIN_UART1_RTS	WMT_PIN(5, 20)
113170c6152STony Prisk #define WMT_PIN_UART1_TXD	WMT_PIN(5, 21)
114170c6152STony Prisk #define WMT_PIN_UART1_CTS	WMT_PIN(5, 22)
115170c6152STony Prisk #define WMT_PIN_UART1_RXD	WMT_PIN(5, 23)
116170c6152STony Prisk #define WMT_PIN_UART2_RTS	WMT_PIN(5, 24)
117170c6152STony Prisk #define WMT_PIN_UART2_TXD	WMT_PIN(5, 25)
118170c6152STony Prisk #define WMT_PIN_UART2_CTS	WMT_PIN(5, 26)
119170c6152STony Prisk #define WMT_PIN_UART2_RXD	WMT_PIN(5, 27)
120170c6152STony Prisk #define WMT_PIN_UART3_RTS	WMT_PIN(5, 28)
121170c6152STony Prisk #define WMT_PIN_UART3_TXD	WMT_PIN(5, 29)
122170c6152STony Prisk #define WMT_PIN_UART3_CTS	WMT_PIN(5, 30)
123170c6152STony Prisk #define WMT_PIN_UART3_RXD	WMT_PIN(5, 31)
124170c6152STony Prisk #define WMT_PIN_SD2CD		WMT_PIN(6, 0)
125170c6152STony Prisk #define WMT_PIN_SD2DATA3	WMT_PIN(6, 1)
126170c6152STony Prisk #define WMT_PIN_SD2DATA0	WMT_PIN(6, 2)
127170c6152STony Prisk #define WMT_PIN_SD2WP		WMT_PIN(6, 3)
128170c6152STony Prisk #define WMT_PIN_SD2DATA1	WMT_PIN(6, 4)
129170c6152STony Prisk #define WMT_PIN_SD2DATA2	WMT_PIN(6, 5)
130170c6152STony Prisk #define WMT_PIN_SD2CMD		WMT_PIN(6, 6)
131170c6152STony Prisk #define WMT_PIN_SD2CLK		WMT_PIN(6, 7)
132170c6152STony Prisk #define WMT_PIN_SD2PWR		WMT_PIN(6, 9)
133170c6152STony Prisk #define WMT_PIN_SD1CLK		WMT_PIN(7, 0)
134170c6152STony Prisk #define WMT_PIN_SD1CMD		WMT_PIN(7, 1)
135170c6152STony Prisk #define WMT_PIN_SD1PWR		WMT_PIN(7, 10)
136170c6152STony Prisk #define WMT_PIN_SD1WP		WMT_PIN(7, 11)
137170c6152STony Prisk #define WMT_PIN_SD1CD		WMT_PIN(7, 12)
138170c6152STony Prisk #define WMT_PIN_SPI0SS3		WMT_PIN(7, 24)
139170c6152STony Prisk #define WMT_PIN_SPI0SS2		WMT_PIN(7, 25)
140170c6152STony Prisk #define WMT_PIN_PWMOUT1		WMT_PIN(7, 26)
141170c6152STony Prisk #define WMT_PIN_PWMOUT0		WMT_PIN(7, 27)
142170c6152STony Prisk 
143170c6152STony Prisk static const struct pinctrl_pin_desc wm8750_pins[] = {
144170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO0, "extgpio0"),
145170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO1, "extgpio1"),
146170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO2, "extgpio2"),
147170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO3, "extgpio3"),
148170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO4, "extgpio4"),
149170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO5, "extgpio5"),
150170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO6, "extgpio6"),
151170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_EXTGPIO7, "extgpio7"),
152170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_WAKEUP0, "wakeup0"),
153170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_WAKEUP1, "wakeup1"),
154170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0CD, "sd0_cd"),
155170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT0, "vdout0"),
156170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT1, "vdout1"),
157170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT2, "vdout2"),
158170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT3, "vdout3"),
159170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT4, "vdout4"),
160170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT5, "vdout5"),
161170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT6, "vdout6"),
162170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT7, "vdout7"),
163170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT8, "vdout8"),
164170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT9, "vdout9"),
165170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT10, "vdout10"),
166170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT11, "vdout11"),
167170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT12, "vdout12"),
168170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT13, "vdout13"),
169170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT14, "vdout14"),
170170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT15, "vdout15"),
171170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT16, "vdout16"),
172170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT17, "vdout17"),
173170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT18, "vdout18"),
174170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT19, "vdout19"),
175170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT20, "vdout20"),
176170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT21, "vdout21"),
177170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT22, "vdout22"),
178170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDOUT23, "vdout23"),
179170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN0, "vdin0"),
180170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN1, "vdin1"),
181170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN2, "vdin2"),
182170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN3, "vdin3"),
183170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN4, "vdin4"),
184170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN5, "vdin5"),
185170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN6, "vdin6"),
186170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_VDIN7, "vdin7"),
187170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SPI0_MOSI, "spi0_mosi"),
188170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SPI0_MISO, "spi0_miso"),
189170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SPI0_SS, "spi0_ss"),
190170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SPI0_CLK, "spi0_clk"),
191170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SPI0_SSB, "spi0_ssb"),
192170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0CLK, "sd0_clk"),
193170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0CMD, "sd0_cmd"),
194170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0WP, "sd0_wp"),
195170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0DATA0, "sd0_data0"),
196170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0DATA1, "sd0_data1"),
197170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0DATA2, "sd0_data2"),
198170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD0DATA3, "sd0_data3"),
199170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA0, "sd1_data0"),
200170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA1, "sd1_data1"),
201170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA2, "sd1_data2"),
202170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA3, "sd1_data3"),
203170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA4, "sd1_data4"),
204170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA5, "sd1_data5"),
205170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA6, "sd1_data6"),
206170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1DATA7, "sd1_data7"),
207170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_I2C0_SCL, "i2c0_scl"),
208170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_I2C0_SDA, "i2c0_sda"),
209170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_I2C1_SCL, "i2c1_scl"),
210170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_I2C1_SDA, "i2c1_sda"),
211170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_I2C2_SCL, "i2c2_scl"),
212170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_I2C2_SDA, "i2c2_sda"),
213170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART0_RTS, "uart0_rts"),
214170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART0_TXD, "uart0_txd"),
215170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART0_CTS, "uart0_cts"),
216170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART0_RXD, "uart0_rxd"),
217170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART1_RTS, "uart1_rts"),
218170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART1_TXD, "uart1_txd"),
219170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART1_CTS, "uart1_cts"),
220170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART1_RXD, "uart1_rxd"),
221170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART2_RTS, "uart2_rts"),
222170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART2_TXD, "uart2_txd"),
223170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART2_CTS, "uart2_cts"),
224170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART2_RXD, "uart2_rxd"),
225170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART3_RTS, "uart3_rts"),
226170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART3_TXD, "uart3_txd"),
227170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART3_CTS, "uart3_cts"),
228170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_UART3_RXD, "uart3_rxd"),
229170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2CD, "sd2_cd"),
230170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2DATA3, "sd2_data3"),
231170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2DATA0, "sd2_data0"),
232170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2WP, "sd2_wp"),
233170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2DATA1, "sd2_data1"),
234170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2DATA2, "sd2_data2"),
235170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2CMD, "sd2_cmd"),
236170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2CLK, "sd2_clk"),
237170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD2PWR, "sd2_pwr"),
238170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1CLK, "sd1_clk"),
239170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1CMD, "sd1_cmd"),
240170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1PWR, "sd1_pwr"),
241170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1WP, "sd1_wp"),
242170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SD1CD, "sd1_cd"),
243170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SPI0SS3, "spi0_ss3"),
244170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_SPI0SS2, "spi0_ss2"),
245170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_PWMOUT1, "pwmout1"),
246170c6152STony Prisk 	PINCTRL_PIN(WMT_PIN_PWMOUT0, "pwmout0"),
247170c6152STony Prisk };
248170c6152STony Prisk 
249170c6152STony Prisk /* Order of these names must match the above list */
250170c6152STony Prisk static const char * const wm8750_groups[] = {
251170c6152STony Prisk 	"extgpio0",
252170c6152STony Prisk 	"extgpio1",
253170c6152STony Prisk 	"extgpio2",
254170c6152STony Prisk 	"extgpio3",
255170c6152STony Prisk 	"extgpio4",
256170c6152STony Prisk 	"extgpio5",
257170c6152STony Prisk 	"extgpio6",
258170c6152STony Prisk 	"extgpio7",
259170c6152STony Prisk 	"wakeup0",
260170c6152STony Prisk 	"wakeup1",
261170c6152STony Prisk 	"sd0_cd",
262170c6152STony Prisk 	"vdout0",
263170c6152STony Prisk 	"vdout1",
264170c6152STony Prisk 	"vdout2",
265170c6152STony Prisk 	"vdout3",
266170c6152STony Prisk 	"vdout4",
267170c6152STony Prisk 	"vdout5",
268170c6152STony Prisk 	"vdout6",
269170c6152STony Prisk 	"vdout7",
270170c6152STony Prisk 	"vdout8",
271170c6152STony Prisk 	"vdout9",
272170c6152STony Prisk 	"vdout10",
273170c6152STony Prisk 	"vdout11",
274170c6152STony Prisk 	"vdout12",
275170c6152STony Prisk 	"vdout13",
276170c6152STony Prisk 	"vdout14",
277170c6152STony Prisk 	"vdout15",
278170c6152STony Prisk 	"vdout16",
279170c6152STony Prisk 	"vdout17",
280170c6152STony Prisk 	"vdout18",
281170c6152STony Prisk 	"vdout19",
282170c6152STony Prisk 	"vdout20",
283170c6152STony Prisk 	"vdout21",
284170c6152STony Prisk 	"vdout22",
285170c6152STony Prisk 	"vdout23",
286170c6152STony Prisk 	"vdin0",
287170c6152STony Prisk 	"vdin1",
288170c6152STony Prisk 	"vdin2",
289170c6152STony Prisk 	"vdin3",
290170c6152STony Prisk 	"vdin4",
291170c6152STony Prisk 	"vdin5",
292170c6152STony Prisk 	"vdin6",
293170c6152STony Prisk 	"vdin7",
294170c6152STony Prisk 	"spi0_mosi",
295170c6152STony Prisk 	"spi0_miso",
296170c6152STony Prisk 	"spi0_ss",
297170c6152STony Prisk 	"spi0_clk",
298170c6152STony Prisk 	"spi0_ssb",
299170c6152STony Prisk 	"sd0_clk",
300170c6152STony Prisk 	"sd0_cmd",
301170c6152STony Prisk 	"sd0_wp",
302170c6152STony Prisk 	"sd0_data0",
303170c6152STony Prisk 	"sd0_data1",
304170c6152STony Prisk 	"sd0_data2",
305170c6152STony Prisk 	"sd0_data3",
306170c6152STony Prisk 	"sd1_data0",
307170c6152STony Prisk 	"sd1_data1",
308170c6152STony Prisk 	"sd1_data2",
309170c6152STony Prisk 	"sd1_data3",
310170c6152STony Prisk 	"sd1_data4",
311170c6152STony Prisk 	"sd1_data5",
312170c6152STony Prisk 	"sd1_data6",
313170c6152STony Prisk 	"sd1_data7",
314170c6152STony Prisk 	"i2c0_scl",
315170c6152STony Prisk 	"i2c0_sda",
316170c6152STony Prisk 	"i2c1_scl",
317170c6152STony Prisk 	"i2c1_sda",
318170c6152STony Prisk 	"i2c2_scl",
319170c6152STony Prisk 	"i2c2_sda",
320170c6152STony Prisk 	"uart0_rts",
321170c6152STony Prisk 	"uart0_txd",
322170c6152STony Prisk 	"uart0_cts",
323170c6152STony Prisk 	"uart0_rxd",
324170c6152STony Prisk 	"uart1_rts",
325170c6152STony Prisk 	"uart1_txd",
326170c6152STony Prisk 	"uart1_cts",
327170c6152STony Prisk 	"uart1_rxd",
328170c6152STony Prisk 	"uart2_rts",
329170c6152STony Prisk 	"uart2_txd",
330170c6152STony Prisk 	"uart2_cts",
331170c6152STony Prisk 	"uart2_rxd",
332170c6152STony Prisk 	"uart3_rts",
333170c6152STony Prisk 	"uart3_txd",
334170c6152STony Prisk 	"uart3_cts",
335170c6152STony Prisk 	"uart3_rxd",
336170c6152STony Prisk 	"sd2_cd",
337170c6152STony Prisk 	"sd2_data3",
338170c6152STony Prisk 	"sd2_data0",
339170c6152STony Prisk 	"sd2_wp",
340170c6152STony Prisk 	"sd2_data1",
341170c6152STony Prisk 	"sd2_data2",
342170c6152STony Prisk 	"sd2_cmd",
343170c6152STony Prisk 	"sd2_clk",
344170c6152STony Prisk 	"sd2_pwr",
345170c6152STony Prisk 	"sd1_clk",
346170c6152STony Prisk 	"sd1_cmd",
347170c6152STony Prisk 	"sd1_pwr",
348170c6152STony Prisk 	"sd1_wp",
349170c6152STony Prisk 	"sd1_cd",
350170c6152STony Prisk 	"spi0_ss3",
351170c6152STony Prisk 	"spi0_ss2",
352170c6152STony Prisk 	"pwmout1",
353170c6152STony Prisk 	"pwmout0",
354170c6152STony Prisk };
355170c6152STony Prisk 
wm8750_pinctrl_probe(struct platform_device * pdev)356170c6152STony Prisk static int wm8750_pinctrl_probe(struct platform_device *pdev)
357170c6152STony Prisk {
358170c6152STony Prisk 	struct wmt_pinctrl_data *data;
359170c6152STony Prisk 
360170c6152STony Prisk 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
361659e7142SMarkus Elfring 	if (!data)
362170c6152STony Prisk 		return -ENOMEM;
363170c6152STony Prisk 
364170c6152STony Prisk 	data->banks = wm8750_banks;
365170c6152STony Prisk 	data->nbanks = ARRAY_SIZE(wm8750_banks);
366170c6152STony Prisk 	data->pins = wm8750_pins;
367170c6152STony Prisk 	data->npins = ARRAY_SIZE(wm8750_pins);
368170c6152STony Prisk 	data->groups = wm8750_groups;
369170c6152STony Prisk 	data->ngroups = ARRAY_SIZE(wm8750_groups);
370170c6152STony Prisk 
371170c6152STony Prisk 	return wmt_pinctrl_probe(pdev, data);
372170c6152STony Prisk }
373170c6152STony Prisk 
374baa9946eSFabian Frederick static const struct of_device_id wmt_pinctrl_of_match[] = {
375170c6152STony Prisk 	{ .compatible = "wm,wm8750-pinctrl" },
376170c6152STony Prisk 	{ /* sentinel */ },
377170c6152STony Prisk };
378170c6152STony Prisk 
379170c6152STony Prisk static struct platform_driver wmt_pinctrl_driver = {
380170c6152STony Prisk 	.probe	= wm8750_pinctrl_probe,
381170c6152STony Prisk 	.driver = {
382170c6152STony Prisk 		.name	= "pinctrl-wm8750",
383170c6152STony Prisk 		.of_match_table	= wmt_pinctrl_of_match,
38423d511f6SPaul Gortmaker 		.suppress_bind_attrs = true,
385170c6152STony Prisk 	},
386170c6152STony Prisk };
38723d511f6SPaul Gortmaker builtin_platform_driver(wmt_pinctrl_driver);
388