From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 22 Nov 2011 23:36:51 +0100 Subject: [U-Boot] [PATCH] M28: Added guarding for reserved bits in GPIO driver In-Reply-To: <790839E1-8C4C-49A4-A380-5F0AAF34BB35@delien.nl> References: <201111221920.59749.marek.vasut@gmail.com> <790839E1-8C4C-49A4-A380-5F0AAF34BB35@delien.nl> Message-ID: <201111222336.51506.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > > 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. It doesn't, because it's not yet supported. > > 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. Please introduce the validation function first, the runtime stuff can be done later. M