From f1d9491e9c4330244e4e0ae27c6cbb671569f3ea Mon Sep 17 00:00:00 2001 From: Jack Halpin Date: Sun, 21 Mar 2010 06:10:44 +0000 Subject: [PATCH] sd-as3525v2.c: Only manipulate MCI_CLKENA for drive being used. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25265 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sd-as3525v2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index a440fb57ff..e1c2c0d7bd 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -390,8 +390,7 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl MCI_COMMAND |= CMD_RW_BIT | CMD_CHECK_CRC_BIT; } - int clkena = MCI_CLKENA; - MCI_CLKENA = 0; + MCI_CLKENA &= (1 << drive); MCI_ARGUMENT = arg; MCI_COMMAND |= CMD_DONE_BIT; @@ -401,12 +400,12 @@ static bool send_cmd(const int drive, const int cmd, const int arg, const int fl { if(--max == 0) /* timeout */ { - MCI_CLKENA = clkena; + MCI_CLKENA |= (1 << drive); return false; } } - MCI_CLKENA = clkena; + MCI_CLKENA |= (1 << drive); if(flags & MCI_RESP) {