Re: [PATCH] pinctrl: freescale: avoid overwriting pin config when freeing GPIO

From: Linus Walleij
Date: Mon Oct 10 2016 - 04:42:09 EST


On Tue, Sep 27, 2016 at 2:26 AM, Stefan Agner <stefan@xxxxxxxx> wrote:

> + /* Only change pad configuration if pad is still a GPIO */
> + if (reg & (0x7 << 20))
> + return;
> +
> + /* Clear IBE/OBE/PUE to disable the pin (Hi-Z) */
> reg &= ~0x7;
> writel(reg, ipctl->base + pin_reg->mux_reg);

Please #define the magic 7 and 20 above so we see what is going
on if you choose this approach.

Yours,
Linus Walleij