diff options
author | Sekhar Nori <nsekhar@ti.com> | 2010-05-10 03:11:18 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-05-13 13:05:19 -0400 |
commit | d78a9494fe8b63e2ec1e2284e45a8d709c4d02c0 (patch) | |
tree | 9c4fc04f4d146bdc42a02a7634896fc8271b5439 /arch/arm/mach-davinci/dma.c | |
parent | 243bc65447a74fbc674fc7fab6f212cce62e0152 (diff) |
davinci: edma: use BIT() wherever possible
This patch replaces occurences of (1 << x) with
BIT(x) as it makes for much better reading.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/dma.c')
-rw-r--r-- | arch/arm/mach-davinci/dma.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c index cc5fcdad9b92..1922d461387e 100644 --- a/arch/arm/mach-davinci/dma.c +++ b/arch/arm/mach-davinci/dma.c | |||
@@ -312,16 +312,16 @@ setup_dma_interrupt(unsigned lch, | |||
312 | 312 | ||
313 | if (!callback) | 313 | if (!callback) |
314 | edma_shadow0_write_array(ctlr, SH_IECR, lch >> 5, | 314 | edma_shadow0_write_array(ctlr, SH_IECR, lch >> 5, |
315 | (1 << (lch & 0x1f))); | 315 | BIT(lch & 0x1f)); |
316 | 316 | ||
317 | edma_cc[ctlr]->intr_data[lch].callback = callback; | 317 | edma_cc[ctlr]->intr_data[lch].callback = callback; |
318 | edma_cc[ctlr]->intr_data[lch].data = data; | 318 | edma_cc[ctlr]->intr_data[lch].data = data; |
319 | 319 | ||
320 | if (callback) { | 320 | if (callback) { |
321 | edma_shadow0_write_array(ctlr, SH_ICR, lch >> 5, | 321 | edma_shadow0_write_array(ctlr, SH_ICR, lch >> 5, |
322 | (1 << (lch & 0x1f))); | 322 | BIT(lch & 0x1f)); |
323 | edma_shadow0_write_array(ctlr, SH_IESR, lch >> 5, | 323 | edma_shadow0_write_array(ctlr, SH_IESR, lch >> 5, |
324 | (1 << (lch & 0x1f))); | 324 | BIT(lch & 0x1f)); |
325 | } | 325 | } |
326 | } | 326 | } |
327 | 327 | ||
@@ -374,7 +374,7 @@ static irqreturn_t dma_irq_handler(int irq, void *data) | |||
374 | SH_IER, j) & BIT(i))) { | 374 | SH_IER, j) & BIT(i))) { |
375 | /* Clear the corresponding IPR bits */ | 375 | /* Clear the corresponding IPR bits */ |
376 | edma_shadow0_write_array(ctlr, SH_ICR, j, | 376 | edma_shadow0_write_array(ctlr, SH_ICR, j, |
377 | (1 << i)); | 377 | BIT(i)); |
378 | if (edma_cc[ctlr]->intr_data[k].callback) | 378 | if (edma_cc[ctlr]->intr_data[k].callback) |
379 | edma_cc[ctlr]->intr_data[k].callback( | 379 | edma_cc[ctlr]->intr_data[k].callback( |
380 | k, DMA_COMPLETE, | 380 | k, DMA_COMPLETE, |
@@ -423,13 +423,13 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data) | |||
423 | for (i = 0; i < 32; i++) { | 423 | for (i = 0; i < 32; i++) { |
424 | int k = (j << 5) + i; | 424 | int k = (j << 5) + i; |
425 | if (edma_read_array(ctlr, EDMA_EMR, j) & | 425 | if (edma_read_array(ctlr, EDMA_EMR, j) & |
426 | (1 << i)) { | 426 | BIT(i)) { |
427 | /* Clear the corresponding EMR bits */ | 427 | /* Clear the corresponding EMR bits */ |
428 | edma_write_array(ctlr, EDMA_EMCR, j, | 428 | edma_write_array(ctlr, EDMA_EMCR, j, |
429 | 1 << i); | 429 | BIT(i)); |
430 | /* Clear any SER */ | 430 | /* Clear any SER */ |
431 | edma_shadow0_write_array(ctlr, SH_SECR, | 431 | edma_shadow0_write_array(ctlr, SH_SECR, |
432 | j, (1 << i)); | 432 | j, BIT(i)); |
433 | if (edma_cc[ctlr]->intr_data[k]. | 433 | if (edma_cc[ctlr]->intr_data[k]. |
434 | callback) { | 434 | callback) { |
435 | edma_cc[ctlr]->intr_data[k]. | 435 | edma_cc[ctlr]->intr_data[k]. |
@@ -444,11 +444,11 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data) | |||
444 | dev_dbg(data, "QEMR %02x\n", | 444 | dev_dbg(data, "QEMR %02x\n", |
445 | edma_read(ctlr, EDMA_QEMR)); | 445 | edma_read(ctlr, EDMA_QEMR)); |
446 | for (i = 0; i < 8; i++) { | 446 | for (i = 0; i < 8; i++) { |
447 | if (edma_read(ctlr, EDMA_QEMR) & (1 << i)) { | 447 | if (edma_read(ctlr, EDMA_QEMR) & BIT(i)) { |
448 | /* Clear the corresponding IPR bits */ | 448 | /* Clear the corresponding IPR bits */ |
449 | edma_write(ctlr, EDMA_QEMCR, 1 << i); | 449 | edma_write(ctlr, EDMA_QEMCR, BIT(i)); |
450 | edma_shadow0_write(ctlr, SH_QSECR, | 450 | edma_shadow0_write(ctlr, SH_QSECR, |
451 | (1 << i)); | 451 | BIT(i)); |
452 | 452 | ||
453 | /* NOTE: not reported!! */ | 453 | /* NOTE: not reported!! */ |
454 | } | 454 | } |
@@ -460,9 +460,9 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data) | |||
460 | * to just write CCERRCLR with CCERR value... | 460 | * to just write CCERRCLR with CCERR value... |
461 | */ | 461 | */ |
462 | for (i = 0; i < 8; i++) { | 462 | for (i = 0; i < 8; i++) { |
463 | if (edma_read(ctlr, EDMA_CCERR) & (1 << i)) { | 463 | if (edma_read(ctlr, EDMA_CCERR) & BIT(i)) { |
464 | /* Clear the corresponding IPR bits */ | 464 | /* Clear the corresponding IPR bits */ |
465 | edma_write(ctlr, EDMA_CCERRCLR, 1 << i); | 465 | edma_write(ctlr, EDMA_CCERRCLR, BIT(i)); |
466 | 466 | ||
467 | /* NOTE: not reported!! */ | 467 | /* NOTE: not reported!! */ |
468 | } | 468 | } |
@@ -666,7 +666,7 @@ int edma_alloc_channel(int channel, | |||
666 | } | 666 | } |
667 | 667 | ||
668 | /* ensure access through shadow region 0 */ | 668 | /* ensure access through shadow region 0 */ |
669 | edma_or_array2(ctlr, EDMA_DRAE, 0, channel >> 5, 1 << (channel & 0x1f)); | 669 | edma_or_array2(ctlr, EDMA_DRAE, 0, channel >> 5, BIT(channel & 0x1f)); |
670 | 670 | ||
671 | /* ensure no events are pending */ | 671 | /* ensure no events are pending */ |
672 | edma_stop(EDMA_CTLR_CHAN(ctlr, channel)); | 672 | edma_stop(EDMA_CTLR_CHAN(ctlr, channel)); |
@@ -1204,7 +1204,7 @@ void edma_pause(unsigned channel) | |||
1204 | channel = EDMA_CHAN_SLOT(channel); | 1204 | channel = EDMA_CHAN_SLOT(channel); |
1205 | 1205 | ||
1206 | if (channel < edma_cc[ctlr]->num_channels) { | 1206 | if (channel < edma_cc[ctlr]->num_channels) { |
1207 | unsigned int mask = (1 << (channel & 0x1f)); | 1207 | unsigned int mask = BIT(channel & 0x1f); |
1208 | 1208 | ||
1209 | edma_shadow0_write_array(ctlr, SH_EECR, channel >> 5, mask); | 1209 | edma_shadow0_write_array(ctlr, SH_EECR, channel >> 5, mask); |
1210 | } | 1210 | } |
@@ -1225,7 +1225,7 @@ void edma_resume(unsigned channel) | |||
1225 | channel = EDMA_CHAN_SLOT(channel); | 1225 | channel = EDMA_CHAN_SLOT(channel); |
1226 | 1226 | ||
1227 | if (channel < edma_cc[ctlr]->num_channels) { | 1227 | if (channel < edma_cc[ctlr]->num_channels) { |
1228 | unsigned int mask = (1 << (channel & 0x1f)); | 1228 | unsigned int mask = BIT(channel & 0x1f); |
1229 | 1229 | ||
1230 | edma_shadow0_write_array(ctlr, SH_EESR, channel >> 5, mask); | 1230 | edma_shadow0_write_array(ctlr, SH_EESR, channel >> 5, mask); |
1231 | } | 1231 | } |
@@ -1252,7 +1252,7 @@ int edma_start(unsigned channel) | |||
1252 | 1252 | ||
1253 | if (channel < edma_cc[ctlr]->num_channels) { | 1253 | if (channel < edma_cc[ctlr]->num_channels) { |
1254 | int j = channel >> 5; | 1254 | int j = channel >> 5; |
1255 | unsigned int mask = (1 << (channel & 0x1f)); | 1255 | unsigned int mask = BIT(channel & 0x1f); |
1256 | 1256 | ||
1257 | /* EDMA channels without event association */ | 1257 | /* EDMA channels without event association */ |
1258 | if (test_bit(channel, edma_cc[ctlr]->edma_unused)) { | 1258 | if (test_bit(channel, edma_cc[ctlr]->edma_unused)) { |
@@ -1298,7 +1298,7 @@ void edma_stop(unsigned channel) | |||
1298 | 1298 | ||
1299 | if (channel < edma_cc[ctlr]->num_channels) { | 1299 | if (channel < edma_cc[ctlr]->num_channels) { |
1300 | int j = channel >> 5; | 1300 | int j = channel >> 5; |
1301 | unsigned int mask = (1 << (channel & 0x1f)); | 1301 | unsigned int mask = BIT(channel & 0x1f); |
1302 | 1302 | ||
1303 | edma_shadow0_write_array(ctlr, SH_EECR, j, mask); | 1303 | edma_shadow0_write_array(ctlr, SH_EECR, j, mask); |
1304 | edma_shadow0_write_array(ctlr, SH_ECR, j, mask); | 1304 | edma_shadow0_write_array(ctlr, SH_ECR, j, mask); |
@@ -1337,7 +1337,7 @@ void edma_clean_channel(unsigned channel) | |||
1337 | 1337 | ||
1338 | if (channel < edma_cc[ctlr]->num_channels) { | 1338 | if (channel < edma_cc[ctlr]->num_channels) { |
1339 | int j = (channel >> 5); | 1339 | int j = (channel >> 5); |
1340 | unsigned int mask = 1 << (channel & 0x1f); | 1340 | unsigned int mask = BIT(channel & 0x1f); |
1341 | 1341 | ||
1342 | pr_debug("EDMA: EMR%d %08x\n", j, | 1342 | pr_debug("EDMA: EMR%d %08x\n", j, |
1343 | edma_read_array(ctlr, EDMA_EMR, j)); | 1343 | edma_read_array(ctlr, EDMA_EMR, j)); |
@@ -1346,7 +1346,7 @@ void edma_clean_channel(unsigned channel) | |||
1346 | edma_write_array(ctlr, EDMA_EMCR, j, mask); | 1346 | edma_write_array(ctlr, EDMA_EMCR, j, mask); |
1347 | /* Clear any SER */ | 1347 | /* Clear any SER */ |
1348 | edma_shadow0_write_array(ctlr, SH_SECR, j, mask); | 1348 | edma_shadow0_write_array(ctlr, SH_SECR, j, mask); |
1349 | edma_write(ctlr, EDMA_CCERRCLR, (1 << 16) | 0x3); | 1349 | edma_write(ctlr, EDMA_CCERRCLR, BIT(16) | BIT(1) | BIT(0)); |
1350 | } | 1350 | } |
1351 | } | 1351 | } |
1352 | EXPORT_SYMBOL(edma_clean_channel); | 1352 | EXPORT_SYMBOL(edma_clean_channel); |
@@ -1366,9 +1366,9 @@ void edma_clear_event(unsigned channel) | |||
1366 | if (channel >= edma_cc[ctlr]->num_channels) | 1366 | if (channel >= edma_cc[ctlr]->num_channels) |
1367 | return; | 1367 | return; |
1368 | if (channel < 32) | 1368 | if (channel < 32) |
1369 | edma_write(ctlr, EDMA_ECR, 1 << channel); | 1369 | edma_write(ctlr, EDMA_ECR, BIT(channel)); |
1370 | else | 1370 | else |
1371 | edma_write(ctlr, EDMA_ECRH, 1 << (channel - 32)); | 1371 | edma_write(ctlr, EDMA_ECRH, BIT(channel - 32)); |
1372 | } | 1372 | } |
1373 | EXPORT_SYMBOL(edma_clear_event); | 1373 | EXPORT_SYMBOL(edma_clear_event); |
1374 | 1374 | ||