funcmux.c 869 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * (C) Copyright 2013-2015
  3. * NVIDIA Corporation <www.nvidia.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /* Tegra210 high-level function multiplexing */
  8. #include <common.h>
  9. #include <asm/arch/clock.h>
  10. #include <asm/arch/funcmux.h>
  11. #include <asm/arch/pinmux.h>
  12. int funcmux_select(enum periph_id id, int config)
  13. {
  14. int bad_config = config != FUNCMUX_DEFAULT;
  15. switch (id) {
  16. /*
  17. * Add other periph IDs here as needed.
  18. * Note that all pinmux/pads should have already
  19. * been set up in the board pinmux table in
  20. * pinmux-config-<board>.h for all periphs.
  21. * Leave this in for the odd case where a mux
  22. * needs to be changed on-the-fly.
  23. */
  24. default:
  25. debug("%s: invalid periph_id %d", __func__, id);
  26. return -1;
  27. }
  28. if (bad_config) {
  29. debug("%s: invalid config %d for periph_id %d", __func__,
  30. config, id);
  31. return -1;
  32. }
  33. return 0;
  34. }