]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/tegra-common/pinmux-common.c
ARM: tegra: pack pinmux data tables tighter
[karo-tx-uboot.git] / arch / arm / cpu / tegra-common / pinmux-common.c
index 32a46d53f068e3b35875a8cb037a47d0059c3177..d62618cd0f618230fd01a85766e949e6a61a1554 100644 (file)
@@ -14,8 +14,7 @@
 
 /* return 1 if a pmux_func is in range */
 #define pmux_func_isvalid(func) \
-       ((((func) >= 0) && ((func) < PMUX_FUNC_COUNT)) || \
-        (((func) >= PMUX_FUNC_RSVD1) && ((func) <= PMUX_FUNC_RSVD4)))
+       (((func) >= 0) && ((func) < PMUX_FUNC_COUNT))
 
 /* return 1 if a pin_pupd_is in range */
 #define pmux_pin_pupd_isvalid(pupd) \
@@ -97,8 +96,8 @@ void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func)
        assert(pmux_pingrp_isvalid(pin));
        assert(pmux_func_isvalid(func));
 
-       if (func & PMUX_FUNC_RSVD1) {
-               mux = func & 3;
+       if (func >= PMUX_FUNC_RSVD1) {
+               mux = (func - PMUX_FUNC_RSVD1) & 3;
        } else {
                /* Search for the appropriate function */
                for (i = 0; i < 4; i++) {