2 * linux/arch/arm/mach-tegra/include/mach/pinmux.h
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2010,2011 Nvidia, Inc.
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #ifndef __MACH_TEGRA_PINMUX_H
19 #define __MACH_TEGRA_PINMUX_H
22 TEGRA_MUX_RSVD
= 0x8000,
23 TEGRA_MUX_RSVD1
= 0x8000,
24 TEGRA_MUX_RSVD2
= 0x8001,
25 TEGRA_MUX_RSVD3
= 0x8002,
26 TEGRA_MUX_RSVD4
= 0x8003,
27 TEGRA_MUX_INVALID
= 0x4000,
40 TEGRA_MUX_EMC_TEST0_DLL
,
41 TEGRA_MUX_EMC_TEST1_DLL
,
87 TEGRA_MUX_VI_SENSOR_CLK
,
101 TEGRA_MUX_EXTPERIPH1
,
102 TEGRA_MUX_EXTPERIPH2
,
103 TEGRA_MUX_EXTPERIPH3
,
136 enum tegra_pullupdown
{
137 TEGRA_PUPD_NORMAL
= 0,
138 TEGRA_PUPD_PULL_DOWN
,
142 enum tegra_tristate
{
143 TEGRA_TRI_NORMAL
= 0,
144 TEGRA_TRI_TRISTATE
= 1,
148 TEGRA_PIN_OUTPUT
= 0,
170 struct tegra_pingroup_config
{
172 enum tegra_mux_func func
;
173 enum tegra_pullupdown pupd
;
174 enum tegra_tristate tristate
;
178 TEGRA_SLEW_FASTEST
= 0,
185 enum tegra_pull_strength
{
222 TEGRA_DRIVE_DIV_8
= 0,
230 TEGRA_HSM_DISABLE
= 0,
235 TEGRA_SCHMITT_DISABLE
= 0,
236 TEGRA_SCHMITT_ENABLE
,
239 struct tegra_drive_pingroup_config
{
242 enum tegra_schmitt schmitt
;
243 enum tegra_drive drive
;
244 enum tegra_pull_strength pull_down
;
245 enum tegra_pull_strength pull_up
;
246 enum tegra_slew slew_rising
;
247 enum tegra_slew slew_falling
;
250 struct tegra_drive_pingroup_desc
{
256 struct tegra_pingroup_desc
{
261 enum tegra_pin_io io_default
;
262 s16 tri_bank
; /* Register bank the tri_reg exists within */
263 s16 mux_bank
; /* Register bank the mux_reg exists within */
264 s16 pupd_bank
; /* Register bank the pupd_reg exists within */
265 s16 tri_reg
; /* offset into the TRISTATE_REG_* register bank */
266 s16 mux_reg
; /* offset into the PIN_MUX_CTL_* register bank */
267 s16 pupd_reg
; /* offset into the PULL_UPDOWN_REG_* register bank */
268 s8 tri_bit
; /* offset into the TRISTATE_REG_* register bit */
269 s8 mux_bit
; /* offset into the PIN_MUX_CTL_* 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 */
276 typedef void (*pinmux_init
) (const struct tegra_pingroup_desc
**pg
,
277 int *pg_max
, const struct tegra_drive_pingroup_desc
**pgdrive
,
280 void tegra20_pinmux_init(const struct tegra_pingroup_desc
**pg
, int *pg_max
,
281 const struct tegra_drive_pingroup_desc
**pgdrive
, int *pgdrive_max
);
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
);
286 int tegra_pinmux_set_tristate(int pg
, enum tegra_tristate tristate
);
287 int tegra_pinmux_set_pullupdown(int pg
, enum tegra_pullupdown pupd
);
289 void tegra_pinmux_config_table(const struct tegra_pingroup_config
*config
,
292 void tegra_drive_pinmux_config_table(struct tegra_drive_pingroup_config
*config
,
294 void tegra_pinmux_set_safe_pinmux_table(const struct tegra_pingroup_config
*config
,
296 void tegra_pinmux_config_pinmux_table(const struct tegra_pingroup_config
*config
,
298 void tegra_pinmux_config_tristate_table(const struct tegra_pingroup_config
*config
,
299 int len
, enum tegra_tristate tristate
);
300 void tegra_pinmux_config_pullupdown_table(const struct tegra_pingroup_config
*config
,
301 int len
, enum tegra_pullupdown pupd
);