[PATCH] powerpc: i2c-mpc: make speed registers configurable via FDT

Grant Likely grant.likely at secretlab.ca
Fri Aug 1 03:36:06 EST 2008


On Thu, Jul 31, 2008 at 11:06 AM, Jon Smirl <jonsmirl at gmail.com> wrote:
> On 7/31/08, Grant Likely <grant.likely at secretlab.ca> wrote:
>>  If you're careful, the table doesn't need to be huge.  It can be
>>  marked as initdata and conditionally compiled depending on which
>>  architectures are compiled in.  You should use .data in the driver's
>>  of_device_id table to provide machine specific ops for setting
>>  clocking to avoid a maze of if/else statements.
>
> Does this look ok for the mpc5200 i2c struct?
>
> /* I2C Registers */
> struct mpc52xx_i2c {
>        u8 madr;                        /* I2C + 0x00 */
>        u8 reserved1[3];                /* I2C + 0x01 */
>        u8 mfdr;                        /* I2C + 0x04 */
>        u8 reserved2[3];                /* I2C + 0x05 */
>        u8 mcr;                         /* I2C + 0x08 */
>        u8 reserved3[3];                /* I2C + 0x09 */
>        u8 msr;                 /* I2C + 0x0c */
>        u8 reserved4[3];                /* I2C + 0x0d */
>        u8 mdr;                 /* I2C + 0x10 */
>        u8 reserved5[15];       /* I2C + 0x11 */
>        u8 interrupt;           /* I2C + 0x20 */
>        u8 reserved6[3];                /* I2C + 0x21 */
>        u8 mifr;                        /* I2C + 0x24 */
> };

Ugh.  I hate all the registers defined in structures thing done for
5200, but I guess it is better to stick with established convention
than do it differently.

Yes, I think this is okay (but I haven't double checked the values; I
trust you).

g.


-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list