diff options
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/pinmux.h')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/pinmux.h | 88 |
1 files changed, 73 insertions, 15 deletions
diff --git a/arch/arm/mach-tegra/include/mach/pinmux.h b/arch/arm/mach-tegra/include/mach/pinmux.h index bb7dfdb61205..055f1792c8ff 100644 --- a/arch/arm/mach-tegra/include/mach/pinmux.h +++ b/arch/arm/mach-tegra/include/mach/pinmux.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/arm/mach-tegra/include/mach/pinmux.h | 2 | * linux/arch/arm/mach-tegra/include/mach/pinmux.h |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Google, Inc. | 4 | * Copyright (C) 2010 Google, Inc. |
5 | * Copyright (C) 2010,2011 Nvidia, Inc. | ||
5 | * | 6 | * |
6 | * This software is licensed under the terms of the GNU General Public | 7 | * This software is licensed under the terms of the GNU General Public |
7 | * License version 2, as published by the Free Software Foundation, and | 8 | * License version 2, as published by the Free Software Foundation, and |
@@ -17,18 +18,13 @@ | |||
17 | #ifndef __MACH_TEGRA_PINMUX_H | 18 | #ifndef __MACH_TEGRA_PINMUX_H |
18 | #define __MACH_TEGRA_PINMUX_H | 19 | #define __MACH_TEGRA_PINMUX_H |
19 | 20 | ||
20 | #if defined(CONFIG_ARCH_TEGRA_2x_SOC) | ||
21 | #include "pinmux-t2.h" | ||
22 | #else | ||
23 | #error "Undefined Tegra architecture" | ||
24 | #endif | ||
25 | |||
26 | enum tegra_mux_func { | 21 | enum tegra_mux_func { |
27 | TEGRA_MUX_RSVD = 0x8000, | 22 | TEGRA_MUX_RSVD = 0x8000, |
28 | TEGRA_MUX_RSVD1 = 0x8000, | 23 | TEGRA_MUX_RSVD1 = 0x8000, |
29 | TEGRA_MUX_RSVD2 = 0x8001, | 24 | TEGRA_MUX_RSVD2 = 0x8001, |
30 | TEGRA_MUX_RSVD3 = 0x8002, | 25 | TEGRA_MUX_RSVD3 = 0x8002, |
31 | TEGRA_MUX_RSVD4 = 0x8003, | 26 | TEGRA_MUX_RSVD4 = 0x8003, |
27 | TEGRA_MUX_INVALID = 0x4000, | ||
32 | TEGRA_MUX_NONE = -1, | 28 | TEGRA_MUX_NONE = -1, |
33 | TEGRA_MUX_AHB_CLK, | 29 | TEGRA_MUX_AHB_CLK, |
34 | TEGRA_MUX_APB_CLK, | 30 | TEGRA_MUX_APB_CLK, |
@@ -90,6 +86,49 @@ enum tegra_mux_func { | |||
90 | TEGRA_MUX_VI, | 86 | TEGRA_MUX_VI, |
91 | TEGRA_MUX_VI_SENSOR_CLK, | 87 | TEGRA_MUX_VI_SENSOR_CLK, |
92 | TEGRA_MUX_XIO, | 88 | TEGRA_MUX_XIO, |
89 | TEGRA_MUX_BLINK, | ||
90 | TEGRA_MUX_CEC, | ||
91 | TEGRA_MUX_CLK12, | ||
92 | TEGRA_MUX_DAP, | ||
93 | TEGRA_MUX_DAPSDMMC2, | ||
94 | TEGRA_MUX_DDR, | ||
95 | TEGRA_MUX_DEV3, | ||
96 | TEGRA_MUX_DTV, | ||
97 | TEGRA_MUX_VI_ALT1, | ||
98 | TEGRA_MUX_VI_ALT2, | ||
99 | TEGRA_MUX_VI_ALT3, | ||
100 | TEGRA_MUX_EMC_DLL, | ||
101 | TEGRA_MUX_EXTPERIPH1, | ||
102 | TEGRA_MUX_EXTPERIPH2, | ||
103 | TEGRA_MUX_EXTPERIPH3, | ||
104 | TEGRA_MUX_GMI_ALT, | ||
105 | TEGRA_MUX_HDA, | ||
106 | TEGRA_MUX_HSI, | ||
107 | TEGRA_MUX_I2C4, | ||
108 | TEGRA_MUX_I2C5, | ||
109 | TEGRA_MUX_I2CPWR, | ||
110 | TEGRA_MUX_I2S0, | ||
111 | TEGRA_MUX_I2S1, | ||
112 | TEGRA_MUX_I2S2, | ||
113 | TEGRA_MUX_I2S3, | ||
114 | TEGRA_MUX_I2S4, | ||
115 | TEGRA_MUX_NAND_ALT, | ||
116 | TEGRA_MUX_POPSDIO4, | ||
117 | TEGRA_MUX_POPSDMMC4, | ||
118 | TEGRA_MUX_PWM0, | ||
119 | TEGRA_MUX_PWM1, | ||
120 | TEGRA_MUX_PWM2, | ||
121 | TEGRA_MUX_PWM3, | ||
122 | TEGRA_MUX_SATA, | ||
123 | TEGRA_MUX_SPI5, | ||
124 | TEGRA_MUX_SPI6, | ||
125 | TEGRA_MUX_SYSCLK, | ||
126 | TEGRA_MUX_VGP1, | ||
127 | TEGRA_MUX_VGP2, | ||
128 | TEGRA_MUX_VGP3, | ||
129 | TEGRA_MUX_VGP4, | ||
130 | TEGRA_MUX_VGP5, | ||
131 | TEGRA_MUX_VGP6, | ||
93 | TEGRA_MUX_SAFE, | 132 | TEGRA_MUX_SAFE, |
94 | TEGRA_MAX_MUX, | 133 | TEGRA_MAX_MUX, |
95 | }; | 134 | }; |
@@ -105,6 +144,11 @@ enum tegra_tristate { | |||
105 | TEGRA_TRI_TRISTATE = 1, | 144 | TEGRA_TRI_TRISTATE = 1, |
106 | }; | 145 | }; |
107 | 146 | ||
147 | enum tegra_pin_io { | ||
148 | TEGRA_PIN_OUTPUT = 0, | ||
149 | TEGRA_PIN_INPUT = 1, | ||
150 | }; | ||
151 | |||
108 | enum tegra_vddio { | 152 | enum tegra_vddio { |
109 | TEGRA_VDDIO_BB = 0, | 153 | TEGRA_VDDIO_BB = 0, |
110 | TEGRA_VDDIO_LCD, | 154 | TEGRA_VDDIO_LCD, |
@@ -115,10 +159,16 @@ enum tegra_vddio { | |||
115 | TEGRA_VDDIO_SYS, | 159 | TEGRA_VDDIO_SYS, |
116 | TEGRA_VDDIO_AUDIO, | 160 | TEGRA_VDDIO_AUDIO, |
117 | TEGRA_VDDIO_SD, | 161 | TEGRA_VDDIO_SD, |
162 | TEGRA_VDDIO_CAM, | ||
163 | TEGRA_VDDIO_GMI, | ||
164 | TEGRA_VDDIO_PEXCTL, | ||
165 | TEGRA_VDDIO_SDMMC1, | ||
166 | TEGRA_VDDIO_SDMMC3, | ||
167 | TEGRA_VDDIO_SDMMC4, | ||
118 | }; | 168 | }; |
119 | 169 | ||
120 | struct tegra_pingroup_config { | 170 | struct tegra_pingroup_config { |
121 | enum tegra_pingroup pingroup; | 171 | int pingroup; |
122 | enum tegra_mux_func func; | 172 | enum tegra_mux_func func; |
123 | enum tegra_pullupdown pupd; | 173 | enum tegra_pullupdown pupd; |
124 | enum tegra_tristate tristate; | 174 | enum tegra_tristate tristate; |
@@ -187,7 +237,7 @@ enum tegra_schmitt { | |||
187 | }; | 237 | }; |
188 | 238 | ||
189 | struct tegra_drive_pingroup_config { | 239 | struct tegra_drive_pingroup_config { |
190 | enum tegra_drive_pingroup pingroup; | 240 | int pingroup; |
191 | enum tegra_hsm hsm; | 241 | enum tegra_hsm hsm; |
192 | enum tegra_schmitt schmitt; | 242 | enum tegra_schmitt schmitt; |
193 | enum tegra_drive drive; | 243 | enum tegra_drive drive; |
@@ -208,6 +258,7 @@ struct tegra_pingroup_desc { | |||
208 | int funcs[4]; | 258 | int funcs[4]; |
209 | int func_safe; | 259 | int func_safe; |
210 | int vddio; | 260 | int vddio; |
261 | enum tegra_pin_io io_default; | ||
211 | s16 tri_bank; /* Register bank the tri_reg exists within */ | 262 | s16 tri_bank; /* Register bank the tri_reg exists within */ |
212 | s16 mux_bank; /* Register bank the mux_reg exists within */ | 263 | s16 mux_bank; /* Register bank the mux_reg exists within */ |
213 | s16 pupd_bank; /* Register bank the pupd_reg exists within */ | 264 | s16 pupd_bank; /* Register bank the pupd_reg exists within */ |
@@ -217,15 +268,23 @@ struct tegra_pingroup_desc { | |||
217 | s8 tri_bit; /* offset into the TRISTATE_REG_* register bit */ | 268 | s8 tri_bit; /* offset into the TRISTATE_REG_* register bit */ |
218 | s8 mux_bit; /* offset into the PIN_MUX_CTL_* register bit */ | 269 | s8 mux_bit; /* offset into the PIN_MUX_CTL_* register bit */ |
219 | s8 pupd_bit; /* offset into the PULL_UPDOWN_REG_* register bit */ | 270 | s8 pupd_bit; /* offset into the PULL_UPDOWN_REG_* register bit */ |
271 | s8 lock_bit; /* offset of the LOCK bit into mux register bit */ | ||
272 | s8 od_bit; /* offset of the OD bit into mux register bit */ | ||
273 | s8 ioreset_bit; /* offset of the IO_RESET bit into mux register bit */ | ||
220 | }; | 274 | }; |
221 | 275 | ||
222 | extern const struct tegra_pingroup_desc tegra_soc_pingroups[]; | 276 | typedef void (*pinmux_init) (const struct tegra_pingroup_desc **pg, |
223 | extern const struct tegra_drive_pingroup_desc tegra_soc_drive_pingroups[]; | 277 | int *pg_max, const struct tegra_drive_pingroup_desc **pgdrive, |
278 | int *pgdrive_max); | ||
224 | 279 | ||
225 | int tegra_pinmux_set_tristate(enum tegra_pingroup pg, | 280 | void tegra20_pinmux_init(const struct tegra_pingroup_desc **pg, int *pg_max, |
226 | enum tegra_tristate tristate); | 281 | const struct tegra_drive_pingroup_desc **pgdrive, int *pgdrive_max); |
227 | int tegra_pinmux_set_pullupdown(enum tegra_pingroup pg, | 282 | |
228 | enum tegra_pullupdown pupd); | 283 | void tegra30_pinmux_init(const struct tegra_pingroup_desc **pg, int *pg_max, |
284 | const struct tegra_drive_pingroup_desc **pgdrive, int *pgdrive_max); | ||
285 | |||
286 | int tegra_pinmux_set_tristate(int pg, enum tegra_tristate tristate); | ||
287 | int tegra_pinmux_set_pullupdown(int pg, enum tegra_pullupdown pupd); | ||
229 | 288 | ||
230 | void tegra_pinmux_config_table(const struct tegra_pingroup_config *config, | 289 | void tegra_pinmux_config_table(const struct tegra_pingroup_config *config, |
231 | int len); | 290 | int len); |
@@ -241,4 +300,3 @@ void tegra_pinmux_config_tristate_table(const struct tegra_pingroup_config *conf | |||
241 | void tegra_pinmux_config_pullupdown_table(const struct tegra_pingroup_config *config, | 300 | void tegra_pinmux_config_pullupdown_table(const struct tegra_pingroup_config *config, |
242 | int len, enum tegra_pullupdown pupd); | 301 | int len, enum tegra_pullupdown pupd); |
243 | #endif | 302 | #endif |
244 | |||