From: Mike Frysinger Date: Wed, 23 Nov 2011 18:36:37 -0500 Subject: [U-Boot] [PATCH 3/6] tegra: Add a function mux feature In-Reply-To: <1322089148-2810-4-git-send-email-sjg@chromium.org> References: <1322089148-2810-1-git-send-email-sjg@chromium.org> <1322089148-2810-4-git-send-email-sjg@chromium.org> Message-ID: <201111231836.38291.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 23 November 2011 17:59:05 Simon Glass wrote: > --- /dev/null > +++ b/arch/arm/cpu/armv7/tegra2/funcmux.c > > +void funcmux_select(enum periph_id id, int func) > +{ > + switch (id) { > + case PERIPH_ID_UART1: > + pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA); > + pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA); > + pinmux_tristate_disable(PINGRP_IRRX); > + pinmux_tristate_disable(PINGRP_IRTX); > + break; > + > + case PERIPH_ID_UART2: > + pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA); > + pinmux_tristate_disable(PINGRP_UAD); > + break; > + > + case PERIPH_ID_UART4: > + pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD); > + pinmux_tristate_disable(PINGRP_GMC); > + break; > + > + default: > + debug("%s: invalid periph_id %d", __func__, id); > + break; > + } > +} i don't know anything about the tegra pinmux details, but the way we setup the defines in the Blackfin code was to encode all of the bits. thus we didn't need to switch() on any of the id's, we just unpacked the values at runtime with bitshifts/masks. > --- /dev/null > +++ b/arch/arm/include/asm/arch-tegra2/funcmux.h needs ifdef protection against multiple inclusion -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: