[U-Boot] [PATCH 1/3] imx25: Move MXC_GPIO_PORT_TO_NUM to imx-regs.h

Fabio Estevam festevam at gmail.com
Sun Jun 10 16:33:12 CEST 2012


Hi Vikram,

On Sun, Jun 10, 2012 at 10:02 AM, Vikram Narayanan <vikram186 at gmail.com> wrote:

> +
> +/* Converts a GPIO port number and the internal bit position
> + * to the GPIO number
> + */
> +#define MXC_GPIO_PORT_TO_NUM(port, bit) (((port - 1) << 5) + (bit & 0x1f))

Just a minor comment:

MXC_GPIO_PORT_TO_NUM looks like a very looong string.

Couldn't we use the same macro as in the Linux kernel (IMX_GPIO_NR) instead?

It is more concise and it would nice to have the same macro name for
kernel and U-boot.

What do you think?

Thanks,

Fabio Estevam


More information about the U-Boot mailing list