diff options
author | viresh kumar <viresh.kumar@st.com> | 2010-04-01 07:31:29 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-04-14 06:34:38 -0400 |
commit | 70f4c0bf9e4d067744ee453bc37c0c4adcea6e53 (patch) | |
tree | 0918b10d980c503c258687a0c65b8d0428d3a455 /arch/arm/mach-spear3xx/spear310.c | |
parent | b77932a4d265586748f05a8c8fad7ef4174c0296 (diff) |
ARM: 6020/1: ST SPEAr: Adding gpio pad multiplexing support
GPIO Pads in spear platform are are multiplexed in various machines.
This patch adds support for this pad multiplexing.
Reviewed-by: Linus Walleij <linux.walleij@stericsson.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-spear3xx/spear310.c')
-rw-r--r-- | arch/arm/mach-spear3xx/spear310.c | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c index 6eb62f9de7ee..dd5a57282711 100644 --- a/arch/arm/mach-spear3xx/spear310.c +++ b/arch/arm/mach-spear3xx/spear310.c | |||
@@ -16,10 +16,139 @@ | |||
16 | #include <mach/generic.h> | 16 | #include <mach/generic.h> |
17 | #include <mach/spear.h> | 17 | #include <mach/spear.h> |
18 | 18 | ||
19 | /* pad multiplexing support */ | ||
20 | /* muxing registers */ | ||
21 | #define PAD_MUX_CONFIG_REG 0x08 | ||
22 | |||
23 | /* devices */ | ||
24 | struct pmx_dev_mode pmx_emi_cs_0_1_4_5_modes[] = { | ||
25 | { | ||
26 | .ids = 0x00, | ||
27 | .mask = PMX_TIMER_3_4_MASK, | ||
28 | }, | ||
29 | }; | ||
30 | |||
31 | struct pmx_dev pmx_emi_cs_0_1_4_5 = { | ||
32 | .name = "emi_cs_0_1_4_5", | ||
33 | .modes = pmx_emi_cs_0_1_4_5_modes, | ||
34 | .mode_count = ARRAY_SIZE(pmx_emi_cs_0_1_4_5_modes), | ||
35 | .enb_on_reset = 1, | ||
36 | }; | ||
37 | |||
38 | struct pmx_dev_mode pmx_emi_cs_2_3_modes[] = { | ||
39 | { | ||
40 | .ids = 0x00, | ||
41 | .mask = PMX_TIMER_1_2_MASK, | ||
42 | }, | ||
43 | }; | ||
44 | |||
45 | struct pmx_dev pmx_emi_cs_2_3 = { | ||
46 | .name = "emi_cs_2_3", | ||
47 | .modes = pmx_emi_cs_2_3_modes, | ||
48 | .mode_count = ARRAY_SIZE(pmx_emi_cs_2_3_modes), | ||
49 | .enb_on_reset = 1, | ||
50 | }; | ||
51 | |||
52 | struct pmx_dev_mode pmx_uart1_modes[] = { | ||
53 | { | ||
54 | .ids = 0x00, | ||
55 | .mask = PMX_FIRDA_MASK, | ||
56 | }, | ||
57 | }; | ||
58 | |||
59 | struct pmx_dev pmx_uart1 = { | ||
60 | .name = "uart1", | ||
61 | .modes = pmx_uart1_modes, | ||
62 | .mode_count = ARRAY_SIZE(pmx_uart1_modes), | ||
63 | .enb_on_reset = 1, | ||
64 | }; | ||
65 | |||
66 | struct pmx_dev_mode pmx_uart2_modes[] = { | ||
67 | { | ||
68 | .ids = 0x00, | ||
69 | .mask = PMX_TIMER_1_2_MASK, | ||
70 | }, | ||
71 | }; | ||
72 | |||
73 | struct pmx_dev pmx_uart2 = { | ||
74 | .name = "uart2", | ||
75 | .modes = pmx_uart2_modes, | ||
76 | .mode_count = ARRAY_SIZE(pmx_uart2_modes), | ||
77 | .enb_on_reset = 1, | ||
78 | }; | ||
79 | |||
80 | struct pmx_dev_mode pmx_uart3_4_5_modes[] = { | ||
81 | { | ||
82 | .ids = 0x00, | ||
83 | .mask = PMX_UART0_MODEM_MASK, | ||
84 | }, | ||
85 | }; | ||
86 | |||
87 | struct pmx_dev pmx_uart3_4_5 = { | ||
88 | .name = "uart3_4_5", | ||
89 | .modes = pmx_uart3_4_5_modes, | ||
90 | .mode_count = ARRAY_SIZE(pmx_uart3_4_5_modes), | ||
91 | .enb_on_reset = 1, | ||
92 | }; | ||
93 | |||
94 | struct pmx_dev_mode pmx_fsmc_modes[] = { | ||
95 | { | ||
96 | .ids = 0x00, | ||
97 | .mask = PMX_SSP_CS_MASK, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | struct pmx_dev pmx_fsmc = { | ||
102 | .name = "fsmc", | ||
103 | .modes = pmx_fsmc_modes, | ||
104 | .mode_count = ARRAY_SIZE(pmx_fsmc_modes), | ||
105 | .enb_on_reset = 1, | ||
106 | }; | ||
107 | |||
108 | struct pmx_dev_mode pmx_rs485_0_1_modes[] = { | ||
109 | { | ||
110 | .ids = 0x00, | ||
111 | .mask = PMX_MII_MASK, | ||
112 | }, | ||
113 | }; | ||
114 | |||
115 | struct pmx_dev pmx_rs485_0_1 = { | ||
116 | .name = "rs485_0_1", | ||
117 | .modes = pmx_rs485_0_1_modes, | ||
118 | .mode_count = ARRAY_SIZE(pmx_rs485_0_1_modes), | ||
119 | .enb_on_reset = 1, | ||
120 | }; | ||
121 | |||
122 | struct pmx_dev_mode pmx_tdm0_modes[] = { | ||
123 | { | ||
124 | .ids = 0x00, | ||
125 | .mask = PMX_MII_MASK, | ||
126 | }, | ||
127 | }; | ||
128 | |||
129 | struct pmx_dev pmx_tdm0 = { | ||
130 | .name = "tdm0", | ||
131 | .modes = pmx_tdm0_modes, | ||
132 | .mode_count = ARRAY_SIZE(pmx_tdm0_modes), | ||
133 | .enb_on_reset = 1, | ||
134 | }; | ||
135 | |||
136 | /* pmx driver structure */ | ||
137 | struct pmx_driver pmx_driver = { | ||
138 | .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, | ||
139 | }; | ||
140 | |||
19 | /* Add spear310 specific devices here */ | 141 | /* Add spear310 specific devices here */ |
20 | 142 | ||
143 | /* spear310 routines */ | ||
21 | void __init spear310_init(void) | 144 | void __init spear310_init(void) |
22 | { | 145 | { |
23 | /* call spear3xx family common init function */ | 146 | /* call spear3xx family common init function */ |
24 | spear3xx_init(); | 147 | spear3xx_init(); |
25 | } | 148 | } |
149 | |||
150 | void spear310_pmx_init(void) | ||
151 | { | ||
152 | spear_pmx_init(&pmx_driver, SPEAR310_SOC_CONFIG_BASE, | ||
153 | SPEAR310_SOC_CONFIG_SIZE); | ||
154 | } | ||