board-harmony-pcie.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * arch/arm/mach-tegra/board-harmony-pcie.c
  3. *
  4. * Copyright (C) 2010 CompuLab, Ltd.
  5. * Mike Rapoport <mike@compulab.co.il>
  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. #include <linux/kernel.h>
  18. #include <linux/gpio.h>
  19. #include <linux/err.h>
  20. #include <linux/regulator/consumer.h>
  21. #include <asm/mach-types.h>
  22. #include <mach/pinmux.h>
  23. #include "board.h"
  24. #ifdef CONFIG_TEGRA_PCI
  25. static int __init harmony_pcie_init(void)
  26. {
  27. int err;
  28. if (!machine_is_harmony())
  29. return 0;
  30. tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL);
  31. tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL);
  32. tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL);
  33. err = tegra_pcie_init(true, true);
  34. if (err)
  35. goto err_pcie;
  36. return 0;
  37. err_pcie:
  38. tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_TRISTATE);
  39. tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE);
  40. tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE);
  41. return err;
  42. }
  43. subsys_initcall(harmony_pcie_init);
  44. #endif