ARM: tegra: powermon: Fix copyrights from GPLv3 to GPLv2
[linux-3.10.git] / arch / arm / mach-tegra / board-pinmux.c
1 /*
2  * Copyright (c) 2011,2012, NVIDIA CORPORATION.  All rights reserved.
3  *
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 #include <linux/device.h>
16 #include <linux/kernel.h>
17 #include <linux/notifier.h>
18 #include <linux/string.h>
19
20 #include "board-pinmux.h"
21 #include "devices.h"
22
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),
26 };
27
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),
31 };
32
33 unsigned long tegra_pincfg_pullnone_na[1] = {
34         TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_NONE),
35 };
36
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),
40 };
41
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),
45 };
46
47 unsigned long tegra_pincfg_pullup_na[1] = {
48         TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_UP),
49 };
50
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),
54 };
55
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),
59 };
60
61 unsigned long tegra_pincfg_pulldown_na[1] = {
62         TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_PULL, TEGRA_PINCONFIG_PULL_DOWN),
63 };
64
65 unsigned long tegra_pincfg_pullna_driven[1] = {
66         TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_DRIVEN),
67 };
68
69 unsigned long tegra_pincfg_pullna_tristate[1] = {
70         TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, TEGRA_PINCONFIG_TRISTATE),
71 };
72
73 static struct platform_device *devices[] = {
74         &tegra_gpio_device,
75         &tegra_pinmux_device,
76 };
77
78 void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a,
79                              struct tegra_board_pinmux_conf *conf_b)
80 {
81         if (conf_a)
82                 pinctrl_register_mappings(conf_a->maps, conf_a->map_count);
83         if (conf_b)
84                 pinctrl_register_mappings(conf_b->maps, conf_b->map_count);
85
86         platform_add_devices(devices, ARRAY_SIZE(devices));
87 }