aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2014-05-02 15:15:13 -0400
committerWolfram Sang <wsa@the-dreams.de>2014-05-22 04:09:24 -0400
commited4121e129ae46615ab570318b5b8f31494ced98 (patch)
treedeacecd12aca9c76fe3e02a688e1c63d46cbf28b
parent7fe8a9993337e4d1957737b4468fc574af8fb957 (diff)
i2c: sh_mobile: remove superfluous offset parameter
Following the KISS principle, remove unneeded stuff. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index ddc9970fd724..9a5b693454e1 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -194,7 +194,7 @@ static void iic_set_clr(struct sh_mobile_i2c_data *pd, int offs,
194 iic_wr(pd, offs, (iic_rd(pd, offs) | set) & ~clr); 194 iic_wr(pd, offs, (iic_rd(pd, offs) | set) & ~clr);
195} 195}
196 196
197static u32 sh_mobile_i2c_iccl(unsigned long count_khz, u32 tLOW, u32 tf, int offset) 197static u32 sh_mobile_i2c_iccl(unsigned long count_khz, u32 tLOW, u32 tf)
198{ 198{
199 /* 199 /*
200 * Conditional expression: 200 * Conditional expression:
@@ -206,10 +206,10 @@ static u32 sh_mobile_i2c_iccl(unsigned long count_khz, u32 tLOW, u32 tf, int off
206 * account the fall time of SCL signal (tf). Default tf value 206 * account the fall time of SCL signal (tf). Default tf value
207 * should be 0.3 us, for safety. 207 * should be 0.3 us, for safety.
208 */ 208 */
209 return (((count_khz * (tLOW + tf)) + 5000) / 10000) + offset; 209 return (((count_khz * (tLOW + tf)) + 5000) / 10000);
210} 210}
211 211
212static u32 sh_mobile_i2c_icch(unsigned long count_khz, u32 tHIGH, u32 tf, int offset) 212static u32 sh_mobile_i2c_icch(unsigned long count_khz, u32 tHIGH, u32 tf)
213{ 213{
214 /* 214 /*
215 * Conditional expression: 215 * Conditional expression:
@@ -225,14 +225,13 @@ static u32 sh_mobile_i2c_icch(unsigned long count_khz, u32 tHIGH, u32 tf, int of
225 * to take into account the fall time of SDA signal (tf) at START 225 * to take into account the fall time of SDA signal (tf) at START
226 * condition, in order to meet both tHIGH and tHD;STA specs. 226 * condition, in order to meet both tHIGH and tHD;STA specs.
227 */ 227 */
228 return (((count_khz * (tHIGH + tf)) + 5000) / 10000) + offset; 228 return (((count_khz * (tHIGH + tf)) + 5000) / 10000);
229} 229}
230 230
231static void sh_mobile_i2c_init(struct sh_mobile_i2c_data *pd) 231static void sh_mobile_i2c_init(struct sh_mobile_i2c_data *pd)
232{ 232{
233 unsigned long i2c_clk_khz; 233 unsigned long i2c_clk_khz;
234 u32 tHIGH, tLOW, tf; 234 u32 tHIGH, tLOW, tf;
235 int offset;
236 235
237 /* Get clock rate after clock is enabled */ 236 /* Get clock rate after clock is enabled */
238 clk_prepare_enable(pd->clk); 237 clk_prepare_enable(pd->clk);
@@ -243,26 +242,24 @@ static void sh_mobile_i2c_init(struct sh_mobile_i2c_data *pd)
243 tLOW = 47; /* tLOW = 4.7 us */ 242 tLOW = 47; /* tLOW = 4.7 us */
244 tHIGH = 40; /* tHD;STA = tHIGH = 4.0 us */ 243 tHIGH = 40; /* tHD;STA = tHIGH = 4.0 us */
245 tf = 3; /* tf = 0.3 us */ 244 tf = 3; /* tf = 0.3 us */
246 offset = 0; /* No offset */
247 } else if (pd->bus_speed == FAST_MODE) { 245 } else if (pd->bus_speed == FAST_MODE) {
248 tLOW = 13; /* tLOW = 1.3 us */ 246 tLOW = 13; /* tLOW = 1.3 us */
249 tHIGH = 6; /* tHD;STA = tHIGH = 0.6 us */ 247 tHIGH = 6; /* tHD;STA = tHIGH = 0.6 us */
250 tf = 3; /* tf = 0.3 us */ 248 tf = 3; /* tf = 0.3 us */
251 offset = 0; /* No offset */
252 } else { 249 } else {
253 dev_err(pd->dev, "unrecognized bus speed %lu Hz\n", 250 dev_err(pd->dev, "unrecognized bus speed %lu Hz\n",
254 pd->bus_speed); 251 pd->bus_speed);
255 goto out; 252 goto out;
256 } 253 }
257 254
258 pd->iccl = sh_mobile_i2c_iccl(i2c_clk_khz, tLOW, tf, offset); 255 pd->iccl = sh_mobile_i2c_iccl(i2c_clk_khz, tLOW, tf);
259 /* one more bit of ICCL in ICIC */ 256 /* one more bit of ICCL in ICIC */
260 if ((pd->iccl > 0xff) && (pd->flags & IIC_FLAG_HAS_ICIC67)) 257 if ((pd->iccl > 0xff) && (pd->flags & IIC_FLAG_HAS_ICIC67))
261 pd->icic |= ICIC_ICCLB8; 258 pd->icic |= ICIC_ICCLB8;
262 else 259 else
263 pd->icic &= ~ICIC_ICCLB8; 260 pd->icic &= ~ICIC_ICCLB8;
264 261
265 pd->icch = sh_mobile_i2c_icch(i2c_clk_khz, tHIGH, tf, offset); 262 pd->icch = sh_mobile_i2c_icch(i2c_clk_khz, tHIGH, tf);
266 /* one more bit of ICCH in ICIC */ 263 /* one more bit of ICCH in ICIC */
267 if ((pd->icch > 0xff) && (pd->flags & IIC_FLAG_HAS_ICIC67)) 264 if ((pd->icch > 0xff) && (pd->flags & IIC_FLAG_HAS_ICIC67))
268 pd->icic |= ICIC_ICCHB8; 265 pd->icic |= ICIC_ICCHB8;