14 #include <linux/module.h>
19 #define DRIVER_NAME "spear300-pinmux"
22 #define PMX_CONFIG_REG 0x00
23 #define MODE_CONFIG_REG 0x04
26 #define NAND_MODE (1 << 0)
27 #define NOR_MODE (1 << 1)
28 #define PHOTO_FRAME_MODE (1 << 2)
29 #define LEND_IP_PHONE_MODE (1 << 3)
30 #define HEND_IP_PHONE_MODE (1 << 4)
31 #define LEND_WIFI_PHONE_MODE (1 << 5)
32 #define HEND_WIFI_PHONE_MODE (1 << 6)
33 #define ATA_PABX_WI2S_MODE (1 << 7)
34 #define ATA_PABX_I2S_MODE (1 << 8)
35 #define CAML_LCDW_MODE (1 << 9)
36 #define CAMU_LCD_MODE (1 << 10)
37 #define CAMU_WLCD_MODE (1 << 11)
38 #define CAML_LCD_MODE (1 << 12)
57 .name =
"photo frame mode",
65 .name =
"lend ip phone mode",
73 .name =
"hend ip phone mode",
81 .name =
"lend wifi phone mode",
89 .name =
"hend wifi phone mode",
97 .name =
"ata pabx wi2s mode",
105 .name =
"ata pabx i2s mode",
113 .name =
"caml lcdw mode",
121 .name =
"camu lcd mode",
129 .name =
"camu wlcd mode",
137 .name =
"caml lcd mode",
147 &pmx_mode_photo_frame,
148 &pmx_mode_lend_ip_phone,
149 &pmx_mode_hend_ip_phone,
150 &pmx_mode_lend_wifi_phone,
151 &pmx_mode_hend_wifi_phone,
152 &pmx_mode_ata_pabx_wi2s,
153 &pmx_mode_ata_pabx_i2s,
161 static const unsigned fsmc_2chips_pins[] = { 1, 97 };
174 .muxregs = fsmc_2chips_muxreg,
180 .name =
"fsmc_2chips_grp",
181 .pins = fsmc_2chips_pins,
183 .modemuxs = fsmc_2chips_modemux,
188 static const unsigned fsmc_4chips_pins[] = { 1, 2, 3, 97 };
201 .muxregs = fsmc_4chips_muxreg,
207 .name =
"fsmc_4chips_grp",
208 .pins = fsmc_4chips_pins,
210 .modemuxs = fsmc_4chips_modemux,
214 static const char *
const fsmc_grps[] = {
"fsmc_2chips_grp",
"fsmc_4chips_grp"
223 static const unsigned clcd_lcdmode_pins[] = { 49, 50 };
236 .muxregs = clcd_lcdmode_muxreg,
242 .name =
"clcd_lcdmode_grp",
243 .pins = clcd_lcdmode_pins,
245 .modemuxs = clcd_lcdmode_modemux,
246 .nmodemuxs =
ARRAY_SIZE(clcd_lcdmode_modemux),
250 static const unsigned clcd_pfmode_pins[] = { 47, 48, 49, 50 };
262 .muxregs = clcd_pfmode_muxreg,
268 .name =
"clcd_pfmode_grp",
269 .pins = clcd_pfmode_pins,
271 .modemuxs = clcd_pfmode_modemux,
275 static const char *
const clcd_grps[] = {
"clcd_lcdmode_grp",
"clcd_pfmode_grp"
284 static const unsigned tdm_pins[] = { 34, 35, 36, 37, 38 };
300 .muxregs = tdm_muxreg,
309 .modemuxs = tdm_modemux,
313 static const char *
const tdm_grps[] = {
"tdm_grp" };
321 static const unsigned i2c_clk_pins[] = { 45, 46, 47, 48 };
336 .muxregs = i2c_clk_muxreg,
342 .name =
"i2c_clk_grp_grp",
343 .pins = i2c_clk_pins,
345 .modemuxs = i2c_clk_modemux,
349 static const char *
const i2c_grps[] = {
"i2c_clk_grp" };
357 static const unsigned caml_pins[] = { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 };
369 .muxregs = caml_muxreg,
378 .modemuxs = caml_modemux,
383 static const unsigned camu_pins[] = { 16, 17, 18, 19, 20, 21, 45, 46, 47, 48 };
395 .muxregs = camu_muxreg,
404 .modemuxs = camu_modemux,
408 static const char *
const cam_grps[] = {
"caml_grp",
"camu_grp" };
416 static const unsigned dac_pins[] = { 43, 44 };
429 .muxregs = dac_muxreg,
438 .modemuxs = dac_modemux,
442 static const char *
const dac_grps[] = {
"dac_grp" };
450 static const unsigned i2s_pins[] = { 39, 40, 41, 42 };
465 .muxregs = i2s_muxreg,
474 .modemuxs = i2s_modemux,
478 static const char *
const i2s_grps[] = {
"i2s_grp" };
486 static const unsigned sdhci_4bit_pins[] = { 28, 29, 30, 31, 32, 33 };
503 .muxregs = sdhci_4bit_muxreg,
509 .name =
"sdhci_4bit_grp",
510 .pins = sdhci_4bit_pins,
512 .modemuxs = sdhci_4bit_modemux,
517 static const unsigned sdhci_8bit_pins[] = { 24, 25, 26, 27, 28, 29, 30, 31, 32,
535 .muxregs = sdhci_8bit_muxreg,
541 .name =
"sdhci_8bit_grp",
542 .pins = sdhci_8bit_pins,
544 .modemuxs = sdhci_8bit_modemux,
548 static const char *
const sdhci_grps[] = {
"sdhci_4bit_grp",
"sdhci_8bit_grp" };
551 .groups = sdhci_grps,
556 static const unsigned gpio1_0_to_3_pins[] = { 39, 40, 41, 42 };
568 .muxregs = gpio1_0_to_3_muxreg,
574 .name =
"gpio1_0_to_3_grp",
575 .pins = gpio1_0_to_3_pins,
577 .modemuxs = gpio1_0_to_3_modemux,
578 .nmodemuxs =
ARRAY_SIZE(gpio1_0_to_3_modemux),
582 static const unsigned gpio1_4_to_7_pins[] = { 43, 44, 45, 46 };
595 .muxregs = gpio1_4_to_7_muxreg,
601 .name =
"gpio1_4_to_7_grp",
602 .pins = gpio1_4_to_7_pins,
604 .modemuxs = gpio1_4_to_7_modemux,
605 .nmodemuxs =
ARRAY_SIZE(gpio1_4_to_7_modemux),
608 static const char *
const gpio1_grps[] = {
"gpio1_0_to_3_grp",
"gpio1_4_to_7_grp"
612 .groups = gpio1_grps,
619 &fsmc_2chips_pingroup,
620 &fsmc_4chips_pingroup,
621 &clcd_lcdmode_pingroup,
622 &clcd_pfmode_pingroup,
629 &sdhci_4bit_pingroup,
630 &sdhci_8bit_pingroup,
631 &gpio1_0_to_3_pingroup,
632 &gpio1_4_to_7_pingroup,
651 .compatible =
"st,spear300-pinmux",
687 .of_match_table = spear300_pinctrl_of_match,
689 .probe = spear300_pinctrl_probe,
693 static int __init spear300_pinctrl_init(
void)
699 static void __exit spear300_pinctrl_exit(
void)