[U-Boot] [PATCH V2 0/9] OMAP3-5: TWL[46]03[05]: cleanup register access and misc minimal cleanups

Sricharan R r.sricharan at ti.com
Tue Mar 26 10:31:14 CET 2013


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 <r.sricharan at ti.com> 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


More information about the U-Boot mailing list