From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ajay Bhargav Date: Wed, 20 Jul 2011 11:06:38 +0530 (IST) Subject: [U-Boot] [PATCH 1/4] gpio: Adds GPIO driver support for Armada100 In-Reply-To: <814164661.33093.1311137863843.JavaMail.root@ahm.einfochips.com> Message-ID: <1207509190.33599.1311140198703.JavaMail.root@ahm.einfochips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de ----- "Prafulla Wadaskar" wrote: > > That can be thought of while adding support for othe SoCs. > Preferably define register struct in asm/arch/gpio.h > > Regards.. > Prafulla . . > ..snip.. (quoting from another reply..) > You have to follow all :-), more reviewers more better code output. > BASE+OFFSET strictly not recommended. > I think lei and me are suggesting similar things, macros should be used precisely, the code should be small and smarter. Hi Prafulla, I agree that macros make code look smaller and smarter. Now if you see the registers of GPIO they are not in order, I mean i cannot group together particular gpio set. can i do it this way, e.g. struct armdgpio_gplr_register { u32 gplr0; u32 gplr1; u32 gplr2; u8 pad[some_value]; //this padding is going to be big u32 gplr3; } then while using this particular set i can just use ARMD1_GPLR_BASE ( = ARMD1_GPIO_BASE + GPLR_OFFSET). moreover i am not using all the registers so i define only those register sets which are in use. what you say about this? Regards, Ajay Bhargav