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