[PATCH] i2c: devtree-aware iic support for PPC4xx

Eugene Surovegin ebs at ebshome.net
Sat Sep 15 20:04:34 EST 2007


On Sat, Sep 15, 2007 at 11:08:01AM +0200, Stefan Roese wrote:
> This patch reworks existing ibm-iic driver to an of_platform_device
> and enables it to talk to device tree directly. The ocp quirks are
> completely removed by this patch.
> 
> This is done to enable I2C support for the PPC4xx platforms now
> being moved from arch/ppc (ocp) to arch/powerpc (of). The first board
> using this driver will be the AMCC Sequoia (PPC440EPx).
> 
> Signed-off-by: Stefan Roese <sr at denx.de>
> 
> +	/* clckdiv is the same for *all* IIC interfaces,
> +	 * but I'd rather make a copy than introduce another global. --ebs
> +	 */
> +	/* Parent bus should have frequency filled */
> +	prop = of_get_property(of_get_parent(np), "clock-frequency", &len);
> +	if (prop == NULL) {
> +		printk(KERN_ERR
> +			"ibm-iic(%s):no clock-frequency prop on parent bus!\n",
> +			dev->np->full_name);
> +		goto fail;
> +	}
> +
> +	DBG("%s: clckdiv = %d\n", dev->np->full_name, dev->clckdiv);
> +

Where is dev->clkdiv initialized? 

My original version used iic_clkdiv() to calculate correct devider 
based on OPB frequency. Did you even test this code?

-- 
Eugene




More information about the Linuxppc-dev mailing list