Merge branch 'v6v7' into devel
[linux/fpc-iii.git] / arch / arm / mach-tegra / board-harmony-pcie.c
blobf7e7d4514b6ad7ffc28ba86bcf5377c2749b604f
1 /*
2 * arch/arm/mach-tegra/board-harmony-pcie.c
4 * Copyright (C) 2010 CompuLab, Ltd.
5 * Mike Rapoport <mike@compulab.co.il>
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.
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.
18 #include <linux/kernel.h>
19 #include <linux/gpio.h>
20 #include <linux/err.h>
21 #include <linux/regulator/consumer.h>
23 #include <asm/mach-types.h>
25 #include <mach/pinmux.h>
26 #include "board.h"
28 #ifdef CONFIG_TEGRA_PCI
30 static int __init harmony_pcie_init(void)
32 int err;
34 if (!machine_is_harmony())
35 return 0;
37 tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL);
38 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL);
39 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL);
41 err = tegra_pcie_init(true, true);
42 if (err)
43 goto err_pcie;
45 return 0;
47 err_pcie:
48 tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_TRISTATE);
49 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE);
50 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE);
52 return err;
55 subsys_initcall(harmony_pcie_init);
57 #endif