ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / include / mach / pinmux.h
1 /*
2  * linux/arch/arm/mach-tegra/include/mach/pinmux.h
3  *
4  * Copyright (C) 2010 Google, Inc.
5  * Copyright (c) 2011-2013, NVIDIA CORPORATION.  All rights reserved.
6  *
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.
10  *
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.
15  *
16  */
17
18 #ifndef __MACH_TEGRA_PINMUX_H
19 #define __MACH_TEGRA_PINMUX_H
20
21 #include <mach/pinmux-defines.h>
22 #include <linux/pinctrl/pinctrl-tegra.h>
23
24 static inline int tegra_pinmux_get_pingroup(int gpio_nr)
25 {
26         return tegra_pinctrl_gpio_to_pingroup(gpio_nr);
27 }
28
29 static inline int tegra_pinmux_set_func(
30                 const struct tegra_pingroup_config *config)
31 {
32         return tegra_pinctrl_pg_set_func(config);
33 }
34
35 static inline int tegra_pinmux_get_func(int pg)
36 {
37         return tegra_pinctrl_pg_get_func(pg);
38 }
39
40 static inline int tegra_pinmux_set_tristate(
41                 int pg, enum tegra_tristate tristate)
42 {
43         return tegra_pinctrl_pg_set_tristate(pg, tristate);
44 }
45
46 static inline int tegra_pinmux_set_io(int pg, enum tegra_pin_io input)
47 {
48         return tegra_pinctrl_pg_set_io(pg, input);
49 }
50
51 static inline int tegra_pinmux_set_lock(int pg, enum tegra_pin_lock lock)
52 {
53         return tegra_pinctrl_pg_set_lock(pg, lock);
54 }
55
56 static inline int tegra_pinmux_set_od(int pg, enum tegra_pin_od od)
57 {
58         return tegra_pinctrl_pg_set_od(pg, od);
59 }
60
61 static inline int tegra_pinmux_set_ioreset(
62                 int pg, enum tegra_pin_ioreset ioreset)
63 {
64         return tegra_pinctrl_pg_set_ioreset(pg, ioreset);
65 }
66
67 static inline int tegra_pinmux_set_rcv_sel(
68                 int pg, enum tegra_pin_rcv_sel rcv_sel)
69 {
70         return tegra_pinctrl_pg_set_rcv_sel(pg, rcv_sel);
71 }
72
73 static inline int tegra_pinmux_set_pullupdown(
74                 int pg, enum tegra_pullupdown pupd)
75 {
76         return tegra_pinctrl_pg_set_pullupdown(pg, pupd);
77 }
78
79 static inline void tegra_pinmux_config_pingroup(
80                 const struct tegra_pingroup_config *config)
81 {
82         tegra_pinctrl_pg_config_pingroup(config);
83
84 }
85
86 static inline void tegra_pinmux_config_table(
87                 const struct tegra_pingroup_config *config, int len)
88 {
89         tegra_pinctrl_pg_config_table(config, len);
90 }
91
92 static inline int tegra_drive_pinmux_set_hsm(
93                 int pg, enum tegra_hsm hsm)
94 {
95         return tegra_pinctrl_pg_drive_set_hsm(pg, hsm);
96 }
97
98 static inline int tegra_drive_pinmux_set_schmitt(
99                 int pg, enum tegra_schmitt schmitt)
100 {
101         return tegra_pinctrl_pg_drive_set_schmitt(pg, schmitt);
102 }
103
104 static inline int tegra_drive_pinmux_set_drive(
105                 int pg, enum tegra_drive drive)
106 {
107         return tegra_pinctrl_pg_drive_set_drive(pg, drive);
108 }
109
110 static inline int tegra_drive_pinmux_set_pull_down(
111                 int pg, enum tegra_pull_strength pull_down)
112 {
113         return tegra_pinctrl_pg_drive_set_pull_down(pg, pull_down);
114 }
115
116 static inline int tegra_drive_pinmux_set_pull_up(
117                 int pg, enum tegra_pull_strength pull_up)
118 {
119         return tegra_pinctrl_pg_drive_set_pull_up(pg, pull_up);
120 }
121
122 static inline int tegra_drive_pinmux_set_slew_rising(
123                 int pg, enum tegra_slew slew_rising)
124 {
125         return tegra_pinctrl_pg_drive_set_slew_rising(pg, slew_rising);
126 }
127
128 static inline int tegra_drive_pinmux_set_slew_falling(
129                 int pg, enum tegra_slew slew_falling)
130 {
131         return tegra_pinctrl_pg_drive_set_slew_falling(pg, slew_falling);
132 }
133
134 static inline int tegra_drive_pinmux_set_drive_type(
135                 int pg, enum tegra_drive_type drive_type)
136 {
137         return tegra_pinctrl_pg_drive_set_drive_type(pg, drive_type);
138 }
139
140 static inline void tegra_drive_pinmux_config_pingroup(
141                 int pingroup, enum tegra_hsm hsm,
142                 enum tegra_schmitt schmitt, enum tegra_drive drive,
143                 enum tegra_pull_strength pull_down,
144                 enum tegra_pull_strength pull_up,
145                 enum tegra_slew slew_rising,
146                 enum tegra_slew slew_falling,
147                 enum tegra_drive_type drive_type)
148 {
149         tegra_pinctrl_pg_drive_config_pingroup(pingroup, hsm, schmitt,
150                         drive, pull_down, pull_up, slew_rising,
151                         slew_falling, drive_type);
152 }
153
154 static inline void tegra_drive_pinmux_config_table(
155                 struct tegra_drive_pingroup_config *config, int len)
156 {
157         tegra_pinctrl_pg_drive_config_table(config, len);
158 }
159
160 static inline int tegra_drive_get_pingroup(struct device *dev)
161 {
162         return tegra_pinctrl_pg_drive_get_pingroup(dev);
163 }
164
165 static inline void tegra_pinmux_set_safe_pinmux_table(
166                 const struct tegra_pingroup_config *config, int len)
167 {
168         tegra_pinctrl_pg_set_safe_pinmux_table(config, len);
169 }
170
171 static inline void tegra_pinmux_config_pinmux_table(
172                 const struct tegra_pingroup_config *config, int len)
173 {
174         tegra_pinctrl_pg_config_pinmux_table(config, len);
175 }
176
177 static inline void tegra_pinmux_config_tristate_table(
178                 const struct tegra_pingroup_config *config, int len,
179                 enum tegra_tristate tristate)
180 {
181         tegra_pinctrl_pg_config_tristate_table(config, len, tristate);
182 }
183
184 static inline void tegra_pinmux_config_pullupdown_table(
185                 const struct tegra_pingroup_config *config,
186                 int len, enum tegra_pullupdown pupd)
187 {
188         tegra_pinctrl_pg_config_pullupdown_table(config, len, pupd);
189 }
190 #endif