blob: 103ef65ca62ab43870734f815356556c6f07b7e1 [file] [log] [blame]
Stephen Warren54862bf2011-12-16 15:12:31 -07001/*
2 * Copyright (c) 2011, 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/of.h>
16
17#include <mach/gpio-tegra.h>
18#include <mach/pinmux.h>
19
20#include "board-pinmux.h"
21#include "devices.h"
22
23static struct platform_device *devices[] = {
24 &tegra_gpio_device,
25 &tegra_pinmux_device,
26};
27
28void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a,
29 struct tegra_board_pinmux_conf *conf_b)
30{
31 struct tegra_board_pinmux_conf *confs[] = {conf_a, conf_b};
32 int i;
33
34 if (of_machine_is_compatible("nvidia,tegra20"))
35 platform_add_devices(devices, ARRAY_SIZE(devices));
36
37 for (i = 0; i < ARRAY_SIZE(confs); i++) {
38 if (!confs[i])
39 continue;
40
41 tegra_pinmux_config_table(confs[i]->pgs, confs[i]->pg_count);
42
43 if (confs[i]->drives)
44 tegra_drive_pinmux_config_table(confs[i]->drives,
45 confs[i]->drive_count);
46
47 tegra_gpio_config(confs[i]->gpios, confs[i]->gpio_count);
48 }
49
50 if (!of_machine_is_compatible("nvidia,tegra20"))
51 platform_add_devices(devices, ARRAY_SIZE(devices));
52}