• Linus Walleij's avatar
    gpio: mpc8xxx: Do not reverse bits using bgpio · b3222f71
    Linus Walleij authored
    The MPC8xxx driver is always instantiating its generic GPIO functions
    with the flag BGPIOF_BIG_ENDIAN. This means "big-endian bit order"
    and means the bits representing the GPIO lines in the registers are
    reversed around 31 bits so line 0 is at bit 31 and so forth down to
    line 31 in bit 0.
    Instead of looping into the generic MMIO gpio to do the simple
    calculation of a bitmask, through a vtable call with two parameters
    likely using stack frames etc (unless the compiler optimize it)
    and obscuring the view for the programmer, let's just open-code
    what the call does. This likely executes faster, saves space and
    makes the code easier to read.
    Cc: Liu Gang <Gang.Liu@nxp.com>
    Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
gpio-mpc8xxx.c 11 KB