
----- "Prafulla Wadaskar" prafulla@marvell.com 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