diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2014-05-02 15:15:07 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-05-22 04:09:22 -0400 |
commit | a78f6a4140f95cbedc0b28c4c883e8aa9ba044f1 (patch) | |
tree | e74e54f21cfcce379adcc767889fc8f781fc0b92 | |
parent | 218e1496135e94e901bf1c136d81ede7e2b418b8 (diff) |
i2c: sh_mobile: replace magic hex values with constants
No functional change, binaries are identical.
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.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 1d79585ba4b3..d91625eea6bb 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c | |||
@@ -316,7 +316,7 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd, | |||
316 | 316 | ||
317 | switch (op) { | 317 | switch (op) { |
318 | case OP_START: /* issue start and trigger DTE interrupt */ | 318 | case OP_START: /* issue start and trigger DTE interrupt */ |
319 | iic_wr(pd, ICCR, 0x94); | 319 | iic_wr(pd, ICCR, ICCR_ICE | ICCR_TRS | ICCR_BBSY); |
320 | break; | 320 | break; |
321 | case OP_TX_FIRST: /* disable DTE interrupt and write data */ | 321 | case OP_TX_FIRST: /* disable DTE interrupt and write data */ |
322 | iic_wr(pd, ICIC, ICIC_WAITE | ICIC_ALE | ICIC_TACKE); | 322 | iic_wr(pd, ICIC, ICIC_WAITE | ICIC_ALE | ICIC_TACKE); |
@@ -327,10 +327,11 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd, | |||
327 | break; | 327 | break; |
328 | case OP_TX_STOP: /* write data and issue a stop afterwards */ | 328 | case OP_TX_STOP: /* write data and issue a stop afterwards */ |
329 | iic_wr(pd, ICDR, data); | 329 | iic_wr(pd, ICDR, data); |
330 | iic_wr(pd, ICCR, pd->send_stop ? 0x90 : 0x94); | 330 | iic_wr(pd, ICCR, pd->send_stop ? ICCR_ICE | ICCR_TRS |
331 | : ICCR_ICE | ICCR_TRS | ICCR_BBSY); | ||
331 | break; | 332 | break; |
332 | case OP_TX_TO_RX: /* select read mode */ | 333 | case OP_TX_TO_RX: /* select read mode */ |
333 | iic_wr(pd, ICCR, 0x81); | 334 | iic_wr(pd, ICCR, ICCR_ICE | ICCR_SCP); |
334 | break; | 335 | break; |
335 | case OP_RX: /* just read data */ | 336 | case OP_RX: /* just read data */ |
336 | ret = iic_rd(pd, ICDR); | 337 | ret = iic_rd(pd, ICDR); |
@@ -338,13 +339,13 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd, | |||
338 | case OP_RX_STOP: /* enable DTE interrupt, issue stop */ | 339 | case OP_RX_STOP: /* enable DTE interrupt, issue stop */ |
339 | iic_wr(pd, ICIC, | 340 | iic_wr(pd, ICIC, |
340 | ICIC_DTEE | ICIC_WAITE | ICIC_ALE | ICIC_TACKE); | 341 | ICIC_DTEE | ICIC_WAITE | ICIC_ALE | ICIC_TACKE); |
341 | iic_wr(pd, ICCR, 0xc0); | 342 | iic_wr(pd, ICCR, ICCR_ICE | ICCR_RACK); |
342 | break; | 343 | break; |
343 | case OP_RX_STOP_DATA: /* enable DTE interrupt, read data, issue stop */ | 344 | case OP_RX_STOP_DATA: /* enable DTE interrupt, read data, issue stop */ |
344 | iic_wr(pd, ICIC, | 345 | iic_wr(pd, ICIC, |
345 | ICIC_DTEE | ICIC_WAITE | ICIC_ALE | ICIC_TACKE); | 346 | ICIC_DTEE | ICIC_WAITE | ICIC_ALE | ICIC_TACKE); |
346 | ret = iic_rd(pd, ICDR); | 347 | ret = iic_rd(pd, ICDR); |
347 | iic_wr(pd, ICCR, 0xc0); | 348 | iic_wr(pd, ICCR, ICCR_ICE | ICCR_RACK); |
348 | break; | 349 | break; |
349 | } | 350 | } |
350 | 351 | ||