[i2c] [RFC] PXA3xx: Add support for power i2c bus
eric.y.miao at gmail.com
Fri Aug 15 04:11:42 CEST 2008
On Thu, Aug 14, 2008 at 9:43 PM, Mike Rapoport <mike at compulab.co.il> 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))
>> 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 <mike at compulab.co.il>
Looks much better now.
You may use INIT_CLK() for the dummy I2C clk for consistency with
other CLK definitions.
More information about the i2c