board-pinmux.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) 2011,2012, 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. #ifndef __MACH_TEGRA_BOARD_PINMUX_H
  15. #define __MACH_TEGRA_BOARD_PINMUX_H
  16. #include <linux/pinctrl/machine.h>
  17. #include <mach/pinconf-tegra.h>
  18. #define PINMUX_DEV "tegra20-pinctrl"
  19. #define TEGRA_MAP_MUX(_group_, _function_) \
  20. PIN_MAP_MUX_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, _function_)
  21. #define TEGRA_MAP_CONF(_group_, _pull_, _drive_) \
  22. PIN_MAP_CONFIGS_GROUP_HOG_DEFAULT(PINMUX_DEV, _group_, tegra_pincfg_pull##_pull_##_##_drive_)
  23. #define TEGRA_MAP_MUXCONF(_group_, _function_, _pull_, _drive_) \
  24. TEGRA_MAP_MUX(_group_, _function_), \
  25. TEGRA_MAP_CONF(_group_, _pull_, _drive_)
  26. extern unsigned long tegra_pincfg_pullnone_driven[2];
  27. extern unsigned long tegra_pincfg_pullnone_tristate[2];
  28. extern unsigned long tegra_pincfg_pullnone_na[1];
  29. extern unsigned long tegra_pincfg_pullup_driven[2];
  30. extern unsigned long tegra_pincfg_pullup_tristate[2];
  31. extern unsigned long tegra_pincfg_pullup_na[1];
  32. extern unsigned long tegra_pincfg_pulldown_driven[2];
  33. extern unsigned long tegra_pincfg_pulldown_tristate[2];
  34. extern unsigned long tegra_pincfg_pulldown_na[1];
  35. extern unsigned long tegra_pincfg_pullna_driven[1];
  36. extern unsigned long tegra_pincfg_pullna_tristate[1];
  37. struct tegra_board_pinmux_conf {
  38. struct pinctrl_map *maps;
  39. int map_count;
  40. };
  41. void tegra_board_pinmux_init(struct tegra_board_pinmux_conf *conf_a,
  42. struct tegra_board_pinmux_conf *conf_b);
  43. #endif