blob: c5f3f3381e86ef1ec4d440c43795873000e3a16d [file] [log] [blame]
Stephen Warren54862bf2011-12-16 15:12:31 -07001/*
Stephen Warrenf30d12b2011-12-13 15:21:01 -07002 * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved.
Stephen Warren54862bf2011-12-16 15:12:31 -07003 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __MACH_TEGRA_BOARD_PINMUX_H
16#define __MACH_TEGRA_BOARD_PINMUX_H
17
Stephen Warrenf30d12b2011-12-13 15:21:01 -070018#include <linux/pinctrl/machine.h>
19
20#include <mach/pinconf-tegra.h>
21
Stephen Warren52f48fe2012-04-11 12:53:09 -060022#define PINMUX_DEV "tegra20-pinctrl"
Stephen Warren54862bf2011-12-16 15:12:31 -070023
Stephen Warrenf30d12b2011-12-13 15:21:01 -070024#define TEGRA_MAP_MUX(_group_, _function_) \
25 PIN_MAP_MUX_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, _function_)
26
27#define TEGRA_MAP_CONF(_group_, _pull_, _drive_) \
28 PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, tegra_pincfg_pull##_pull_##_##_drive_)
29
30#define TEGRA_MAP_MUXCONF(_group_, _function_, _pull_, _drive_) \
31 TEGRA_MAP_MUX(_group_, _function_), \
32 TEGRA_MAP_CONF(_group_, _pull_, _drive_)
33
34extern unsigned long tegra_pincfg_pullnone_driven[2];
35extern unsigned long tegra_pincfg_pullnone_tristate[2];
36extern unsigned long tegra_pincfg_pullnone_na[1];
37extern unsigned long tegra_pincfg_pullup_driven[2];
38extern unsigned long tegra_pincfg_pullup_tristate[2];
39extern unsigned long tegra_pincfg_pullup_na[1];
40extern unsigned long tegra_pincfg_pulldown_driven[2];
41extern unsigned long tegra_pincfg_pulldown_tristate[2];
42extern unsigned long tegra_pincfg_pulldown_na[1];
43extern unsigned long tegra_pincfg_pullna_driven[1];
44extern unsigned long tegra_pincfg_pullna_tristate[1];
Stephen Warren54862bf2011-12-16 15:12:31 -070045
46struct tegra_board_pinmux_conf {
Stephen Warrenf30d12b2011-12-13 15:21:01 -070047 struct pinctrl_map *maps;
48 int map_count;
Stephen Warren54862bf2011-12-16 15:12:31 -070049};
50
51void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a,
52 struct tegra_board_pinmux_conf *conf_b);
53
54#endif