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

From: Timur Tabi <[email-masked]>
Date: Thu, 31 Jul 2008 14:58:12 -0500

Wolfgang Grandegger wrote:

> But clock-frequency, aka bus-frequency, is already used by 
> fsl_get_sys_freq():
> 
> http://lxr.linux.no/linux+v2.6.26/arch/powerpc/sysdev/fsl_soc.c#L80

So?  clock-frequency is a per-node property.  I use it in the codec node on the
8610 (mpc8610_hpcd.dts).  It does not mean "platform clock frequency".

> U-Boot could then fixup that value like bus-frequency() and the i2c-mpc 
> driver simply calls fsl_get_i2c_freq().

This is just more complicated than it needs to be.  Why should the I2C driver
fetch the platform clock and the divider from the parent node, and then do
additional math, when it could just get the value it needs right from the node
it's probing?

Besides, U-Boot does not currently store the divider value.  Look at the code
I've posted twice already - it stores the frequency in i2c1_clk.  So now I would
need to create another variable in the gd_t to store the divider?  No thanks.

-- 
Timur Tabi
Linux kernel developer at Freescale