summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/tegra_prod.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/linux/tegra_prod.h b/include/linux/tegra_prod.h
new file mode 100644
index 000000000..76678112b
--- /dev/null
+++ b/include/linux/tegra_prod.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _TEGRA_PRODS_H
18#define _TEGRA_PRODS_H
19
20#define PROD_TUPLE_NUM (sizeof(struct prod_tuple)/sizeof(u32))
21
22struct prod_tuple {
23 u32 index; /* Address base index */
24 u32 addr; /* offset address*/
25 u32 mask; /* mask */
26 u32 val; /* value */
27};
28
29struct tegra_prod {
30 const char *name;
31 struct prod_tuple *prod_tuple;
32 int count; /* number of prod_tuple*/
33 bool boot_init;
34};
35
36/* tegra_prod_list: Tegra Prod list for the given submodule
37 * @n_prod_cells: Number of prod setting cells.
38 */
39struct tegra_prod_list {
40 struct tegra_prod *tegra_prod;
41 int num; /* number of tegra_prod*/
42 int n_prod_cells;
43};
44
45int tegra_prod_set_tuple(void __iomem **base, struct prod_tuple *prod_tuple);
46
47int tegra_prod_set(void __iomem **base, struct tegra_prod *tegra_prod);
48
49int tegra_prod_set_list(void __iomem **base,
50 struct tegra_prod_list *tegra_prod_list);
51
52int tegra_prod_set_boot_init(void __iomem **base,
53 struct tegra_prod_list *tegra_prod_list);
54
55int tegra_prod_set_by_name(void __iomem **base, const char *name,
56 struct tegra_prod_list *tegra_prod_list);
57
58struct tegra_prod_list *tegra_prod_init(const struct device_node *np);
59
60struct tegra_prod_list *tegra_prod_get(struct device *dev, const char *name);
61
62int tegra_prod_release(struct tegra_prod_list **tegra_prod_list);
63#endif