From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sricharan R Date: Tue, 26 Mar 2013 15:01:14 +0530 Subject: [U-Boot] [PATCH V2 0/9] OMAP3-5: TWL[46]03[05]: cleanup register access and misc minimal cleanups In-Reply-To: References: <1363988004-25819-1-git-send-email-nm@ti.com> <51508DC6.2090304@ti.com> Message-ID: <51516AE2.9090605@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Nishanth, On Monday 25 March 2013 11:50 PM, Nishanth Menon wrote: > Hi Sricharan, > > On Mon, Mar 25, 2013 at 12:47 PM, Sricharan R wrote: >> All of TWL[46]03[05]_i2c_[write/read]_u8 is doing the same. (ie) >> i2c_write(chip_no, reg, 1, &val, 1); >> i2c_read(chip_no, reg, 1, val, 1); >> >> We always seem to use 1 byte addresses and length. >> >> Then why can't we move to to twl_common.h and use just one function >> every where ? >> >> Otherwise, this is a required cleanup. >> > > I had initially considered that, but then having twl6030, 6035, 4030 > as API names help us to know from readability angle which register is > being accessed and if it the right one. > Further, the PMICs are drastically different that using a > twl_read_write_u8 might end up confusing reviewer/readability. > + the fact that they are inline allows us to have no overhead. Now, while adding support for VAYU which has TPS659038, in the current approach we will end up creating a new tps659038.h which does exactly the same thing. This does not feel correct. Can't we differentiate using register names that are passed instead ? Regards, Sricharan