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