[U-Boot] [PATCH] M28: Added guarding for reserved bits in GPIO driver
Robert Deliën
Robert at delien.nl
Tue Nov 22 20:24:12 CET 2011
> Careful here !!
>
> The driver _should_ work for MX233 too! What I'd like to see is you introducing
> a function like:
>
> int mxs_gpio_is_valid(gpio)
> {
> char mxs_banks[PINCTRL_BANKS] = PINCTRL_BANK_COUNTS;
>
> if (PAD_PIN(gpio) > mxs_bank[PAD_BANK(gpio)])
> return -EINVAL;
>
> return 0;
> }
>
> And define PINCTRL_BANK_COUNTS in the section of mxs_gpio.c where all the
> remaining mx28 and mx233 specific defines are hoarded (near the top of the
> file).
Does mx233 use arch/arm/include/asm/arch-mx28/iomux.h? In that case we should consider renaming it to arch/arm/include/asm/arch-mxs, for all Sigmatel base FreeScale SoCs.
I do like the idea of a function validating pins. If I'm going to introduce changes that big, I may also introduce functionality to set pin functions run-time, as that is very useful during board bring-up.
More information about the U-Boot
mailing list