On Thu, Aug 14, 2008 at 9:43 PM, Mike Rapoport <[EMAIL PROTECTED]> wrote: > > Ben Dooks wrote: >> On Thu, Aug 14, 2008 at 02:38:09PM +0300, Mike Rapoport wrote: >> >> Not very nice, how about making the i2c structure have pointers >> to each of the registers which can be setup at probe time. Or even >> just have a multiplier in the structure, as these all look to be reg/2 >> in the case of pxa3xx and adap.nr == 1... >> >> Note, adap.nr shouldn't really be used to differentiate, use the >> platform device number >> >> +#define _IDBR(i2c) ((i2c)->reg_base + (0x4 << (i2c)->reg_shift)) >> +#define _ICR(i2c) ((i2c)->reg_base + (0x8 << (i2c)->reg_shift)) >> etc. >> >> then do in the probe: >> >> i2c->reg_shift = (cpu_is_pxa3xx() && <is_power_i2c>) ? 0 : 1; >> > > This is really much nicer. The fixed patch follows: > > Signed-off-by: Mike Rapoport <[EMAIL PROTECTED]>
Looks much better now. You may use INIT_CLK() for the dummy I2C clk for consistency with other CLK definitions. _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
