2 * Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved.
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.
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.
15 #include <linux/device.h>
16 #include <linux/kernel.h>
17 #include <linux/notifier.h>
18 #include <linux/string.h>
20 #include "board-pinmux.h"
23 unsigned long tegra_pincfg_pullnone_driven
[2] = {
24 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_NONE
),
25 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_DRIVEN
),
28 unsigned long tegra_pincfg_pullnone_tristate
[2] = {
29 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_NONE
),
30 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_TRISTATE
),
33 unsigned long tegra_pincfg_pullnone_na
[1] = {
34 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_NONE
),
37 unsigned long tegra_pincfg_pullup_driven
[2] = {
38 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_UP
),
39 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_DRIVEN
),
42 unsigned long tegra_pincfg_pullup_tristate
[2] = {
43 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_UP
),
44 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_TRISTATE
),
47 unsigned long tegra_pincfg_pullup_na
[1] = {
48 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_UP
),
51 unsigned long tegra_pincfg_pulldown_driven
[2] = {
52 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_DOWN
),
53 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_DRIVEN
),
56 unsigned long tegra_pincfg_pulldown_tristate
[2] = {
57 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_DOWN
),
58 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_TRISTATE
),
61 unsigned long tegra_pincfg_pulldown_na
[1] = {
62 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL
, TEGRA_PINCONFIG_PULL_DOWN
),
65 unsigned long tegra_pincfg_pullna_driven
[1] = {
66 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_DRIVEN
),
69 unsigned long tegra_pincfg_pullna_tristate
[1] = {
70 TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE
, TEGRA_PINCONFIG_TRISTATE
),
73 static struct platform_device
*devices
[] = {
78 void tegra_board_pinmux_init(struct tegra_board_pinmux_conf
*conf_a
,
79 struct tegra_board_pinmux_conf
*conf_b
)
82 pinctrl_register_mappings(conf_a
->maps
, conf_a
->map_count
);
84 pinctrl_register_mappings(conf_b
->maps
, conf_b
->map_count
);
86 platform_add_devices(devices
, ARRAY_SIZE(devices
));