diff options
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 433d3486de04..0b486a63460d 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
@@ -86,8 +86,6 @@ | |||
86 | /** Variables ****************************************************************** | 86 | /** Variables ****************************************************************** |
87 | *******************************************************************************/ | 87 | *******************************************************************************/ |
88 | 88 | ||
89 | static unsigned int disable_delay; /* Dummy delay */ | ||
90 | |||
91 | /* | 89 | /* |
92 | * sorted list of clock divider, register value pairs | 90 | * sorted list of clock divider, register value pairs |
93 | * taken from table 26-5, p.26-9, Freescale i.MX | 91 | * taken from table 26-5, p.26-9, Freescale i.MX |
@@ -121,6 +119,7 @@ struct imx_i2c_struct { | |||
121 | int irq; | 119 | int irq; |
122 | wait_queue_head_t queue; | 120 | wait_queue_head_t queue; |
123 | unsigned long i2csr; | 121 | unsigned long i2csr; |
122 | unsigned int disable_delay; | ||
124 | }; | 123 | }; |
125 | 124 | ||
126 | /** Functions for IMX I2C adapter driver *************************************** | 125 | /** Functions for IMX I2C adapter driver *************************************** |
@@ -212,7 +211,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) | |||
212 | * This delay caused by an i.MXL hardware bug. | 211 | * This delay caused by an i.MXL hardware bug. |
213 | * If no (or too short) delay, no "STOP" bit will be generated. | 212 | * If no (or too short) delay, no "STOP" bit will be generated. |
214 | */ | 213 | */ |
215 | udelay(disable_delay); | 214 | udelay(i2c_imx->disable_delay); |
216 | /* Disable I2C controller */ | 215 | /* Disable I2C controller */ |
217 | writeb(0, i2c_imx->base + IMX_I2C_I2CR); | 216 | writeb(0, i2c_imx->base + IMX_I2C_I2CR); |
218 | } | 217 | } |
@@ -243,7 +242,7 @@ static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, | |||
243 | * This delay is used in I2C bus disable function | 242 | * This delay is used in I2C bus disable function |
244 | * to fix chip hardware bug. | 243 | * to fix chip hardware bug. |
245 | */ | 244 | */ |
246 | disable_delay = (500000U * i2c_clk_div[i][0] | 245 | i2c_imx->disable_delay = (500000U * i2c_clk_div[i][0] |
247 | + (i2c_clk_rate / 2) - 1) / (i2c_clk_rate / 2); | 246 | + (i2c_clk_rate / 2) - 1) / (i2c_clk_rate / 2); |
248 | 247 | ||
249 | /* dev_dbg() can't be used, because adapter is not yet registered */ | 248 | /* dev_dbg() can't be used, because adapter is not yet registered */ |