summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sd-as3525.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-24 15:07:15 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-24 15:07:15 +0000
commit13f159df57386b076b39ea331bc07583404be68a (patch)
treef0f722fa6fc475422cc27d0ebbc73acf95bfe0d5 /firmware/target/arm/as3525/sd-as3525.c
parent8d1ec38a1d8721330798dbfc55be456ecd964bdf (diff)
downloadrockbox-13f159df57386b076b39ea331bc07583404be68a.tar.gz
rockbox-13f159df57386b076b39ea331bc07583404be68a.zip
as3525*: sd_wait_for_state() is only used for waiting to SD_TRAN state
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26251 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525.c')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 81dc637617..fb1ec959e3 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -100,7 +100,7 @@ static const int pl180_base[NUM_DRIVES] = {
100#endif 100#endif
101}; 101};
102 102
103static int sd_wait_for_state(const int drive, unsigned int state); 103static int sd_wait_for_tran_state(const int drive);
104static int sd_select_bank(signed char bank); 104static int sd_select_bank(signed char bank);
105static int sd_init_card(const int drive); 105static int sd_init_card(const int drive);
106static void init_pl180_controller(const int drive); 106static void init_pl180_controller(const int drive);
@@ -321,7 +321,7 @@ static int sd_init_card(const int drive)
321 return -5; 321 return -5;
322 mci_delay(); 322 mci_delay();
323 323
324 if(sd_wait_for_state(drive, SD_TRAN)) 324 if(sd_wait_for_tran_state(drive))
325 return -6; 325 return -6;
326 /* CMD6 */ 326 /* CMD6 */
327 if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_ARG, NULL)) 327 if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_ARG, NULL))
@@ -570,7 +570,7 @@ bool sd_present(IF_MD_NONVOID(int drive))
570} 570}
571#endif /* HAVE_HOTSWAP */ 571#endif /* HAVE_HOTSWAP */
572 572
573static int sd_wait_for_state(const int drive, unsigned int state) 573static int sd_wait_for_tran_state(const int drive)
574{ 574{
575 unsigned long response = 0; 575 unsigned long response = 0;
576 unsigned int timeout = current_tick + HZ; 576 unsigned int timeout = current_tick + HZ;
@@ -581,7 +581,7 @@ static int sd_wait_for_state(const int drive, unsigned int state)
581 MCI_RESP|MCI_ARG, &response)) 581 MCI_RESP|MCI_ARG, &response))
582 return -1; 582 return -1;
583 583
584 if (((response >> 9) & 0xf) == state) 584 if (((response >> 9) & 0xf) == SD_TRAN)
585 return 0; 585 return 0;
586 586
587 if(TIME_AFTER(current_tick, timeout)) 587 if(TIME_AFTER(current_tick, timeout))
@@ -605,7 +605,7 @@ static int sd_select_bank(signed char bank)
605 panicf("SD bank %d error : 0x%x", bank, 605 panicf("SD bank %d error : 0x%x", bank,
606 transfer_error[INTERNAL_AS3525]); 606 transfer_error[INTERNAL_AS3525]);
607 607
608 ret = sd_wait_for_state(INTERNAL_AS3525, SD_TRAN); 608 ret = sd_wait_for_tran_state(INTERNAL_AS3525);
609 if (ret < 0) 609 if (ret < 0)
610 return ret - 2; 610 return ret - 2;
611 611
@@ -746,7 +746,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
746 if(write) 746 if(write)
747 memcpy(uncached_buffer, buf, transfer * SD_BLOCK_SIZE); 747 memcpy(uncached_buffer, buf, transfer * SD_BLOCK_SIZE);
748 748
749 ret = sd_wait_for_state(drive, SD_TRAN); 749 ret = sd_wait_for_tran_state(drive);
750 if (ret < 0) 750 if (ret < 0)
751 { 751 {
752 ret -= 2*20; 752 ret -= 2*20;