funcmux.c 862 B

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