From 609e6ec3f623f3c3aa2a056654fbc5886e092897 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 13 Dec 2012 20:48:49 +0000 Subject: ppc: m68k: Move i2c1_clk, i2c2_clk to arch_global_data Move these fields into arch_global_data and tidy up. This is needed for both ppc and m68k since they share the i2c driver. Signed-off-by: Simon Glass --- drivers/i2c/fsl_i2c.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c index 3cb232fdd1..1c7265d897 100644 --- a/drivers/i2c/fsl_i2c.c +++ b/drivers/i2c/fsl_i2c.c @@ -217,9 +217,9 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev, static unsigned int get_i2c_clock(int bus) { if (bus) - return gd->i2c2_clk; /* I2C2 clock */ + return gd->arch.i2c2_clk; /* I2C2 clock */ else - return gd->i2c1_clk; /* I2C1 clock */ + return gd->arch.i2c1_clk; /* I2C1 clock */ } void @@ -468,7 +468,8 @@ int i2c_set_bus_num(unsigned int bus) int i2c_set_bus_speed(unsigned int speed) { - unsigned int i2c_clk = (i2c_bus_num == 1) ? gd->i2c2_clk : gd->i2c1_clk; + unsigned int i2c_clk = (i2c_bus_num == 1) + ? gd->arch.i2c2_clk : gd->arch.i2c1_clk; writeb(0, &i2c_dev[i2c_bus_num]->cr); /* stop controller */ i2c_bus_speed[i2c_bus_num] = -- cgit